Как пользоваться apktool windows

Использование apktool

В статье про изготовление копий приложений для Android я упоминал о приложении SmartAPKTool. Оно может распаковывать, запаковывать и подписывать изменённые apk-файлы. Её достоинством является наличие графического интерфейса. Однако есть и серьёзный недостаток. SmartAPKTool давно не обновлялся, и программа некорректно распаковывает и запаковывает приложения для свежих версий Android. Поэтому здесь я попытаюсь объяснить, как пользоваться для этих целей приложением apktool.

Замечание 1.
Программу SmartAPKTool по-прежнему удобно использовать для подписи собранных apk-файлов.
Замечание 2.
Ссылки на упомянутые в статье программы находятся внизу ↓

Программа apktool не имеет графического интерфейса. Это является минусом для тех, кто не привык работать с командной строкой. Но есть и плюс: в отличие от SmartAPKTool, мы будем видеть все ошибки, а значит будем знать, что исправить.

Скачаем два архива: один общий для всех систем, другой для нашей системы (в примере — Windows):

Распакуем оба архива в одну и ту же пустую папку (в нашем примере C:\apktool\ ). Её содержимое должно получиться таким:

С этого момента мы можем использовать программу apktool.

Замечание 3.
Пользователям 64-битных версий Linux нужно будет установить пакет ia32-libs:

В эту же папку мы кладём тот файл, который нам нужно распаковать. Например, пусть он назвыается orig.apk
Нажав клавишу Shift и удерживая её, щёлкаем правой кнопкой мыши на любом пустом пространстве папки (щёлкать не по файлам!). После этого выбираем пункт „Открыть окно команд“. В появившейся консоли набираем [важно!] :

Теперь у нас в директории C:\apktool\ есть папка с распакованным приложением. Называется она так же, как и исходный файл, за вычетом расширения: C:\apktool\orig\ . Мы можем менять исходные файлы так, как описано в статье Android: как установить два одинаковых приложения на один телефон. После того, как мы сделали изменения, соберём копию приложения, запаковав исходные файлы в apk:

Здесь result.apk — имя файла, которое мы придумали для билда копии. Если ошибок нет, то файл соберётся:

Остальное выходит за рамки темы статьи:

  1. Если при сборке будут ошибки, нужно найти их причину и исправить.
  2. Осталось подписать получившийся файл result.apk . Это можно сделать с помощью SmartAPKTool, как говорилось выше; в нём всё интуитивно понятно. Есть также прочие способы подписать apk-файл.
  3. При установке копии, при её запуске или работе также могут возникать ошибки. Их нужно отлавливать с помощью утилиты adb , входящей в состав Android SDK.

Подписывать приложение надо обязательно, иначе оно не установится. Ошибки же встречаются не так часто, и самые распространённые вызывающие их проблемы описаны в статье Android: как установить два одинаковых приложения на один телефон.

Ссылки на упомянутые программы:

Важное замечание по apktool версий 2.x

В версии 2.0.0-Beta7 нужно применять ключ —output , чтобы указать директорию при декомпиляции и результирующий файл при сборке:

Как пользоваться apktool windows

Последнее обновление программы в шапке: 03.12.2020

Краткое описание:
Программа для «вскрытия» *.apk — файлов.

Описание:
Программа будет полезна разработчикам и переводчикам программ для платформы Android.
Может быть использована для локализации ПО, добавления функций и т.д.

На данный момент программа работает под управлением ОС Linux, Windows, MacOS. При помощи данной утилиты не может быть вскрыто приложение framework-res.apk, поскольку в нем используются некие собственные секретные разработки Google, но обещают, что в дальнейшем это будет исправлено.

Для использования программы требуются базовые знания по SDK, aapt, PATH, smali.

1.4.3:
updated builtin framework to SDK API14
fixed some «Multiple substitutions (. )» errors ( Issue 254 )

1.4.2:
added support for API14 (Android 4.0) resources
updated smali to v1.3.0
added —quiet option
fixed decoding error when string ends with ‘%’ ( Issue 169 )
fixed decoding error when

contains a reference ( Issue 234 )
fixed a broken res when decoding with positional substitutions ( Issue 222 )

1.4.1:
1.4.1
fixed builtin framework. See changelog and migration instructions of v1.4.0 below.

Читайте также:  Трелло приложение для windows

1.4.0
Major changes:
added Honeycomb support (3.1, API 12). See migration instructions below.
support for mipmaps and xlarge, xhdpi resource qualifiers
updated builtin framework to 3.1 (API 12) broken
completely rewritten mechanism of enclosing/escaping strings in XML files:
fixed legendary Issue 100
fixed a lot of other bugs discovered when writting integration tests
string format is simpler and more compact now: ‘» «‘ instead of ‘\u0020 ‘, ‘\»‘ instead of ‘\»‘, etc.
fixed incompatibilities between newer aapt and apks built by older one. New aapt is more restrictive, some apps can’t be built using it, even if you would have sources. Apktool tries to convert/fix these incompatibilities: it adds formatted=»false» for tags and enumerates substitutions for plurals.
updated smali to v1.2.6
added automatic integration tests for resource decoding and building
first official release of apktool built using Maven from open source

Minor changes:
sort framework ids before storing them in apktool.yml. aapt command requires you to include frameworks in order.
zero-padding of MCC resource qualifier
prefer to use raw values when decoding XML attrs. This could make decoded XMLs a little more similar to original ones.
close apktool.yml file handler after generating it
added error message about missing input file when decoding
added more info messages during decoding.
do not decode res-references as . Now they’re decoded as e.g. @android:string/ok instead of @android:string/ok .
changed encoding of generated XML files from UTF-8 to utf-8 — it’s more consistent with Android SDK.
add new line at the end of generated XML files.

1.3.2 (2010.09.03):
updated smali to v1.2.4
added support for API Level 8 resource qualifiers: night, car, etc. ( Issue 65 )
added support for broken file-resources ( Issue 91 )
don’t generate sdkVersion («-v») resource qualifiers if they’re «natural» ( Issue 85 )
always compress resources.arsc file (Issue 67)
throw warnings instead of exceptions on unknown files inside smali dir ( Issue 77 )
added support for resources using invalid/unknown config flags, e.g. from future APIs or added by manufacturer ( Issue 65 )
added an option to keep broken resources to fix them manually ( Issue 65 )
fixed case-sensitivity problems (Issue 86)
fixed an issue when *.9.png doesn’t have 9patch chunk in it ( Issue 59 )
fixed NPE when there is a file without extension in drawable dir ( Issue 62 )
fixed escaping of chars in XML style tags ( Issue 64 )
fixed an error, when there are missing resources in a type, which does not have default config (http://forum.xda-developers.com/showthread.php?p=7949440#post7949440)
try to use original value of XML attribute — instead of parsed one. Fixes an issue when apktool was decoding e.g. «01» as «1» ( Issue 76 )
added more debugging info when omitting unknown config flags («Config size > 32» message)

install-windows-2.2_r01-3 (2010.09.03):
fixed an issue when path to apktool.bat contains spaces ( Issue 81 )

1.3.1 (2010.06.14):
added decoding of XML tags in res strings (Issue 15)
fixed some issues (Issue 45), (Issue 46), (Issue 48), (Issue 56)

1.3.0 (2010.06.12):
added 9patch images (*.9.png) decoding (Issue 2)
fixed support for apks lacking res dir or resources.arsc file (Issue 44, Issue 50)
changed default name of built file from out.apk to
added possibility to choose location of output apk when building

(2010.06.04):
updated install packages to 2.2r01-1 version. Apktool 1.2.0 requires newer aapt tool, so you must update to use it.

1.2.0 (2010.06.03):
added feature for installing and using custom framework files — pulled from a device. See FrameworkFiles (Issue 27)
Froyo support (Issue 37)
updated Android framework to 2.2r1
removed HTC framework
no need to use -s/-r switch, when apk doesn’t contain sources/resources
added protection against accidental remove of important files when decoding (Issue 36)
made outdir argument optional when decoding
fix: adding dummy resources if some of them are missing (Issue 40)
fix: better recognition of AXML files (Issue 41)

Читайте также:  Avast для windows x64

1.1.1 (2010.04.29):
much better recognition of register types when debugging (Issue 24)
fixed SIGSEGV error, which usually occured after several steps when debugging (Issue 26)

Версия: 2.3.4 Сообщение №2065, автор hussein209
Версия: 2.3.3 Сообщение №2015, автор siegheilx
Версия: 2.3.2 APKTool (PC) (Пост georgearn #72155798)
Версия: 2.3.1 APKTool (PC) (Пост OsitKP #68533937)
Версия: 2.3.0 APKTool (PC) (Пост Shamil_92 #65377659)
Версия: 2.2.4 APKTool (PC) (Пост OsitKP #63737776)
Версия: 2.2.2 APKTool (PC) (Пост OsitKP #57713692)
Версия: 2.2.1 APKTool (PC) (Пост GrAlNik #54271368)
Версия: 2.2.0 APKTool (PC) (Пост Kocmuq #52477482)
Версия: 2.1.1 APKTool (PC) (Пост xxxsadistxxx #49460498)
//4pda.ru/forum/dl/post/968583/apktool_install_linux_r04_brut1.zip — пакет зависимостей и скриптов для Linux
//4pda.ru/forum/dl/post/968585/apktool_install_macosx_r04_brut1.zip — пакет зависимостей и скриптов для MacOS X
//4pda.ru/forum/dl/post/968582/apktool_install_windows_r04_brut1.zip — пакет зависимостей и скриптов для Windows
Версия: 2.1.0 APKTool (PC) (Пост OsitKP #48439847)
версия: 2.0.3 fix APKTool (PC) (Пост Enyby #46807838)
версия: 2.0.3 APKTool (PC) (Пост OsitKP #45863914)
версия: 2.0.2 APKTool (PC) (Пост OsitKP #43651919)
версия: 2.0.1 //4pda.ru/forum/d…8654/apktool_2.0.1.jar
версия: 2.0.0 APKTool (PC) (Пост Dimon55584 #39621157)
версия: 2.0.0 RC4 //4pda.ru/forum/d…5/apktool_2.0.0rc4.jar
версия: 2.0.0 RC3 //4pda.ru/forum/dl/post/5426930/apktool.jar
версия: 2.0.0 RC2 //4pda.ru/forum/d…7/apktool_2.0.0rc2.jar
версия: 2.0.0 beta 9 apktool_2.0.0b9.jar ( 7,85 МБ )
версия: v2 RC1 APKTool (PC) (Пост #34425590)
версия: 2.0.0 beta 8 APKTool (PC) (Пост #28248823)
версия: 2.0.0 beta 7 apktool_2.0.0b7.jar ( 7,42 МБ )

Сообщение отредактировал iMiKED — 03.12.20, 12:21

Как пользоваться apktool windows

Последнее обновление программы в шапке: 03.12.2020

Краткое описание:
Программа для «вскрытия» *.apk — файлов.

Описание:
Программа будет полезна разработчикам и переводчикам программ для платформы Android.
Может быть использована для локализации ПО, добавления функций и т.д.

На данный момент программа работает под управлением ОС Linux, Windows, MacOS. При помощи данной утилиты не может быть вскрыто приложение framework-res.apk, поскольку в нем используются некие собственные секретные разработки Google, но обещают, что в дальнейшем это будет исправлено.

Для использования программы требуются базовые знания по SDK, aapt, PATH, smali.

1.4.3:
updated builtin framework to SDK API14
fixed some «Multiple substitutions (. )» errors ( Issue 254 )

1.4.2:
added support for API14 (Android 4.0) resources
updated smali to v1.3.0
added —quiet option
fixed decoding error when string ends with ‘%’ ( Issue 169 )
fixed decoding error when

contains a reference ( Issue 234 )
fixed a broken res when decoding with positional substitutions ( Issue 222 )

1.4.1:
1.4.1
fixed builtin framework. See changelog and migration instructions of v1.4.0 below.

1.4.0
Major changes:
added Honeycomb support (3.1, API 12). See migration instructions below.
support for mipmaps and xlarge, xhdpi resource qualifiers
updated builtin framework to 3.1 (API 12) broken
completely rewritten mechanism of enclosing/escaping strings in XML files:
fixed legendary Issue 100
fixed a lot of other bugs discovered when writting integration tests
string format is simpler and more compact now: ‘» «‘ instead of ‘\u0020 ‘, ‘\»‘ instead of ‘\»‘, etc.
fixed incompatibilities between newer aapt and apks built by older one. New aapt is more restrictive, some apps can’t be built using it, even if you would have sources. Apktool tries to convert/fix these incompatibilities: it adds formatted=»false» for tags and enumerates substitutions for plurals.
updated smali to v1.2.6
added automatic integration tests for resource decoding and building
first official release of apktool built using Maven from open source

Minor changes:
sort framework ids before storing them in apktool.yml. aapt command requires you to include frameworks in order.
zero-padding of MCC resource qualifier
prefer to use raw values when decoding XML attrs. This could make decoded XMLs a little more similar to original ones.
close apktool.yml file handler after generating it
added error message about missing input file when decoding
added more info messages during decoding.
do not decode res-references as . Now they’re decoded as e.g. @android:string/ok instead of @android:string/ok .
changed encoding of generated XML files from UTF-8 to utf-8 — it’s more consistent with Android SDK.
add new line at the end of generated XML files.

Читайте также:  Ivms 4200 linux 64 бит

1.3.2 (2010.09.03):
updated smali to v1.2.4
added support for API Level 8 resource qualifiers: night, car, etc. ( Issue 65 )
added support for broken file-resources ( Issue 91 )
don’t generate sdkVersion («-v») resource qualifiers if they’re «natural» ( Issue 85 )
always compress resources.arsc file (Issue 67)
throw warnings instead of exceptions on unknown files inside smali dir ( Issue 77 )
added support for resources using invalid/unknown config flags, e.g. from future APIs or added by manufacturer ( Issue 65 )
added an option to keep broken resources to fix them manually ( Issue 65 )
fixed case-sensitivity problems (Issue 86)
fixed an issue when *.9.png doesn’t have 9patch chunk in it ( Issue 59 )
fixed NPE when there is a file without extension in drawable dir ( Issue 62 )
fixed escaping of chars in XML style tags ( Issue 64 )
fixed an error, when there are missing resources in a type, which does not have default config (http://forum.xda-developers.com/showthread.php?p=7949440#post7949440)
try to use original value of XML attribute — instead of parsed one. Fixes an issue when apktool was decoding e.g. «01» as «1» ( Issue 76 )
added more debugging info when omitting unknown config flags («Config size > 32» message)

install-windows-2.2_r01-3 (2010.09.03):
fixed an issue when path to apktool.bat contains spaces ( Issue 81 )

1.3.1 (2010.06.14):
added decoding of XML tags in res strings (Issue 15)
fixed some issues (Issue 45), (Issue 46), (Issue 48), (Issue 56)

1.3.0 (2010.06.12):
added 9patch images (*.9.png) decoding (Issue 2)
fixed support for apks lacking res dir or resources.arsc file (Issue 44, Issue 50)
changed default name of built file from out.apk to
added possibility to choose location of output apk when building

(2010.06.04):
updated install packages to 2.2r01-1 version. Apktool 1.2.0 requires newer aapt tool, so you must update to use it.

1.2.0 (2010.06.03):
added feature for installing and using custom framework files — pulled from a device. See FrameworkFiles (Issue 27)
Froyo support (Issue 37)
updated Android framework to 2.2r1
removed HTC framework
no need to use -s/-r switch, when apk doesn’t contain sources/resources
added protection against accidental remove of important files when decoding (Issue 36)
made outdir argument optional when decoding
fix: adding dummy resources if some of them are missing (Issue 40)
fix: better recognition of AXML files (Issue 41)

1.1.1 (2010.04.29):
much better recognition of register types when debugging (Issue 24)
fixed SIGSEGV error, which usually occured after several steps when debugging (Issue 26)

Версия: 2.3.4 Сообщение №2065, автор hussein209
Версия: 2.3.3 Сообщение №2015, автор siegheilx
Версия: 2.3.2 APKTool (PC) (Пост georgearn #72155798)
Версия: 2.3.1 APKTool (PC) (Пост OsitKP #68533937)
Версия: 2.3.0 APKTool (PC) (Пост Shamil_92 #65377659)
Версия: 2.2.4 APKTool (PC) (Пост OsitKP #63737776)
Версия: 2.2.2 APKTool (PC) (Пост OsitKP #57713692)
Версия: 2.2.1 APKTool (PC) (Пост GrAlNik #54271368)
Версия: 2.2.0 APKTool (PC) (Пост Kocmuq #52477482)
Версия: 2.1.1 APKTool (PC) (Пост xxxsadistxxx #49460498)
//4pda.ru/forum/dl/post/968583/apktool_install_linux_r04_brut1.zip — пакет зависимостей и скриптов для Linux
//4pda.ru/forum/dl/post/968585/apktool_install_macosx_r04_brut1.zip — пакет зависимостей и скриптов для MacOS X
//4pda.ru/forum/dl/post/968582/apktool_install_windows_r04_brut1.zip — пакет зависимостей и скриптов для Windows
Версия: 2.1.0 APKTool (PC) (Пост OsitKP #48439847)
версия: 2.0.3 fix APKTool (PC) (Пост Enyby #46807838)
версия: 2.0.3 APKTool (PC) (Пост OsitKP #45863914)
версия: 2.0.2 APKTool (PC) (Пост OsitKP #43651919)
версия: 2.0.1 //4pda.ru/forum/d…8654/apktool_2.0.1.jar
версия: 2.0.0 APKTool (PC) (Пост Dimon55584 #39621157)
версия: 2.0.0 RC4 //4pda.ru/forum/d…5/apktool_2.0.0rc4.jar
версия: 2.0.0 RC3 //4pda.ru/forum/dl/post/5426930/apktool.jar
версия: 2.0.0 RC2 //4pda.ru/forum/d…7/apktool_2.0.0rc2.jar
версия: 2.0.0 beta 9 apktool_2.0.0b9.jar ( 7,85 МБ )
версия: v2 RC1 APKTool (PC) (Пост #34425590)
версия: 2.0.0 beta 8 APKTool (PC) (Пост #28248823)
версия: 2.0.0 beta 7 apktool_2.0.0b7.jar ( 7,42 МБ )

Сообщение отредактировал iMiKED — 03.12.20, 12:21

Оцените статью