Реверс-инжиниринг android приложений

A useful application that was designed to provide a fast Java decompiler and reduce the time and energy you spend on your projects

What’s new in JD-GUI 1.6.6:

  • Minor update on configuration parsing
  • Update JD-Core to 1.1.3:
  • Addition of a part of the test protocol described in this research paper : The Strengths and Behavioral Quirks of Java Bytecode Decompilers
  • Improved recompilation of decompiled source codes

Read the full changelog

NOTE: Free for non-commercial uses only.

Working as a programmer or software developer can be both challenging and rewarding, but it’s unlikely that one’s going to develop successful projects without the help of third-party specialized software solutions.

JD-GUI is one of the applications that can help you in the situation depicted above by providing you with everything you need for inspecting the code you just wrote and even decompile your applications in a controlled environment.

Portable application

Since this program is portable, you don’t need to install it on the target computer in order to benefit from its entire array of features, as simply unpacking the archive it comes in and launching the executable lets you do just that.

More so, its portability also implies that it won’t even attempt to tamper with your Windows registry entries or create additional files or folders on your computer without your direct permission. You can also run it from USB flash drives or external HDDs.

Simplistic interface

When it comes to JD-GUI’s design, you should know that there are no flashy menus, eye-catching animations or vividly-colored menus. Instead, you’ll face a series of plain, minimalistic menus, buttons and toolbars.

However, the need for such aesthetic elements enunciated above shouldn’t stop you dead in your tracks, not if you’re looking for a stable code analyzer and decompiler for your JAVA applications. Keeping it simple is not necessarily bad, especially in this situation.

Handles projects efficiently

As you probably figured out by now, JD-GUI was designed with Java code in mind, namely CLASS and JAR documents. However, you might want to use it on TXT and LOG files, but also ZIP archives, since they are fully supported.

Navigating through your projects or documents can be easily done by relying on the tree view available in the left-hand section of the main screen. This tree hierarchy mode lets you select the desired class that you want to review in a truly effective manner.

Features a Search option

Aside from its highly accessible interface, JD-GUI provides you with a «Search» function that can come in handy whenever you need to locate any piece of code that might need to be inspected.

Among the elements that can be identified by this function, you can find types, methods, constructors, fields and string constants. Any string or character can be looked up by using the «*» and «?» search operators as well.

Trustworthy Java code analyzer

To wrap it up, if you’re having trouble finding an efficient code analyzer and decompiler for your Java projects, you might want to give JD-GUI a try. It’s simple, packs a lightweight layout, can be run from a thumb drive, provides you with efficient project management and includes a search function.

Распространённые ошибки

  1. ‘java’ is not recognized as an internal or external command
    java не найдена.Решение: настроить переменные окружения (JAVA_HOME и PATH). JAVA_HOME содержит путь к java, а в PATH нужно добавить %JAVA_HOME%\bin

  2. Dx bad class file magic (cafebabe) or version …
    Может возникать при сочетании dx.jar из Delphi XE5 (Android 4.2) и Java 7. (Текущая версия Java выводится в начале работы скрипта)Решение: использовать Java 6.

  3. Чёрный экран при запуске приложения.
    Внутри apk находится более одного classes.dex.Решение: лишние classes.dex нужно отключать/удалять в меню Project -> Deployment.

Tools to Decompile APK Files

1. Java Decompilers

This is a great online APK decompiler tool. This tool uses an open source like APK and DEX decompiler known as Jadx. It will help you to obtain the source code from APK file in just one click.

How to decompile APK online to the source code

  • Go to this link.
  • Now select the APK file by Choose File option and then click on the Upload and Decompile

  • Depending upon the size of the file, it will take time to decompile.
  • Once the decompilation process is completed, click on the Save button to download the source code.

2. Show Java – A Java Decompiler

Show Java is a java decompiler which can easily extract the source code of an APK (Android app). This is a decompiler that extracts the source code of an Android application including XML files and image assets. It works directly from your Android device. You can also opt for CFR 0.110 or Jadx 0.6.1 to use as the decompiler.

3. Java N-IDE

Java N-IDE is a Java console for Android. It is an Apk builder. You can build and run a java file with JDK 1.7. It supports java compiler 1.7, java editor, java autocomplete code, java debugger. It runs java file, class file, Decompile class, jar. It supports layout builder for Android and also supports VCS. Along with this, the tools which the project includes are ( Javac – Java compiler, Aapt – Android asset package tool, Dx – Dex for dalvik vm, Zip Signer, Apk Builder ). This is a great app for people who want to learn Java and also to decompile Android Apk.

4. JaDX – Decompiler

JaDX is a decompiler for “apk”, “dex”, “jar”, “class” files. It is an Android adapted version JaDX. This program does not decompile XML files and other resources. This program only decompiles classes. It also extracts the assets folder which includes binary files.

5. ApkTool

ApkTool is a tool for reverse engineering closed & binary Android apps. This tool can decode resources to the nearly original form and rebuild them after making some modifications. ApkTool makes working with an app easier because of the project like file structure and automation of some repetitive tasks like building apk, etc. It could be used for localizing, adding some features or support for custom platforms, analyzing applications and much more, but it is not intended for piracy and other non-legal uses.

Features:

  • It dissembles resources to the new original form (including resources.arsc, classes.dex and XMLs)
  • It helps with repetitive tasks.
  • Rebuilds decoded resources back to binary APK/JAR.
  • Smali debugging.

6. JD-GUI (Java Decompiler – Graphical Utility Interface)

Java Decompiler is a tool to decompile apk and analyze Java 5 “byte code” and the later versions.

  • JD-Core – It is a library that reconstructs Java source code from one or more “.class” files. It is used to recover lost source code and it explores the source of Java runtime libraries. JD-Core supports annotations, generics or type “enum”. JD-GUI and JD-Eclipse include JD-Core library.
  • JD-GUI – It is a standalone graphical utility that displays Java source codes of “.class” files. For instant access to methods and fields, you can browse the reconstructed source code with the JD-GUI.
  • JD-Eclipse – It is a plug-in for the Eclipse platform. It allows you to display all the Java sources during your debugging process, even if you do not have them all.
  • JD-Intellij – It is a plug-in for IntelliJ IDEA.

7. Dexplorer

Dexplorer is an APK decompiler app in which you can explore the DEX/APK files of all your installed apps and downloaded APK’s.

Features:

  • Browse through java packages and files
  • It allows you to browse through assets, lib and res folders, and files
  • You can view the AndroidManifest.xml
  • Previews of commonly used file types:
  • XML files (syntax highlighting)
  • Image files (adjustable background colors)
  • Audio files with playback
  • Font files with a text editor

8. Java Manager; Emulate Java

You can Emulate and Manage Java projects. This app helps you to decompile APK and your own Java programs. You can use Java in your Android. With this application, you can run java files, class files, and jar files. You can also compile and decompile your own Java programs with the help of this application.

This app runs only in command line mode.

Download link

9. DexDump

DexDump is another app to reverse-engineering Android apps. It is very easy to use. It is designed for mobile devices to decompile android applications instantly. It has easy to navigate user interface. It supports decompilation of APK, dex, odex and oat files to smali code. You can also apply a package filter to filter out uninteresting packages and search through class/field/method names within this app.

All of the above mentioned some of the tools and apps will help you to decompile APK file to the source code.

Теория

APK — исполнимый файл Android приложения. По сути ZIP архив, внутри которого лежит classes.dex, AndroidManifest.xml, нативные библиотеки (.so) и пр. ресурсы. Embarcadero Delphi XE использует собственный classes.dex, который помещается в каждое Android приложение, собранное в этой IDE. Файл различается в разных версиях Delphi XE. Чтобы использовать Java классы или Java библиотеку в Android приложении на Delphi, нужно добавить их в classes.dex и подменить его в процессе сборки.

Декомпиляция — процесс воссоздания исходного кода декомпилятором.

Чтобы открыть командную строку в текущей папке, используйте SHIFT + клик правой кнопкой мыши -> Открыть командную строку здесь.

Теория

В большинстве случаев декомпиляция приложения не вызывает особых проблем. Для каждой задачи, которую нужно проделать, написаны программы, работающие на любой платформе где можно установить Java Runtime. Итак, суть декомпиляции заключается в следующем: Вы можете либо просматривать декомпилированный код виртуальной машины Dalvik, а также все файлы ресурсов приложения (манифест, разметка и т.д.). А можете преобразовать код Dalvik в код Java. В первом случае программе передается путь к apk-файлу. Во втором из apk-файла (который по сути обычный архив) нужно вытащить файл. Этот файл содержит весь исполняемый код для машины Dalvik (да, весь код объединен в один файл). Специальная программа преобразует код Dalvik в код Java, который потом можно открыть любым java-декомпилятором. Казалось бы, второй способ предпочтительнее, но есть одна хитрость. И заключается она в том, что некоторые участки кода невозможно конвертировать, либо логика кода становится далека от того, как писал разработчик

Для простых программ этого конечно достаточно, но для понятия всего кода конечно обращать внимание стоит и на Java, и на Dalvik. Давайте же наконец поговорим о том, что конкретно нам нужно делать для декомпиляции Android приложений

Декомпилируем файлы APK онлайн

Отдельно хотелось бы отметить расширение для браузера, поскольку оно позволит быстро запустить, например, игру. Поэтому если вы не желаете загружать увесистые программы на свой компьютер, присмотритесь к плагину — он отлично справляется со своей задачей.

Мы же переходим непосредственно к осуществлению поставленной задачи — получению исходного когда. Выполнить это можно с помощью двух простых методов.

Способ 1: Decompilers online

Веб-сервис Decompilers online предназначен не только для объектов APK, но и работает с другими элементами, написанными на языке Java. Что же касается декомпиляции требуемого расширения, то здесь она происходит так:

  1. Откройте главную страницу сайта, воспользовавшись указанной выше ссылкой, и переходите к загрузке приложения.

В «Проводнике» выделите необходимый файл, а затем кликните на «Открыть».

Убедитесь в том, что элемент был добавлен, после чего щелкните на «Upload and Decompile».

Расшифровка данных может проводиться достаточно долгое время, ведь размер и функциональность каждой программы разная.

Теперь вам доступно ознакомление со всеми найденными файлами и директориями.

Выберите один из файлов, чтобы ознакомиться с написанным в нем кодом.

Если хотите сохранить декомпилированный проект себе на компьютер, кликните на «Save». Все данные будут загружены в формате одного архива.

Теперь вы знаете, как с помощью простого интернет-ресурса под названием Decompilers online можно вытащить информацию и исходные коды из APK-файлов. На этом ознакомление с упомянутым выше сайтом завершено.

Способ 2: APK Decompilers

В этом способе мы рассмотрим такой же процесс расшифровки, только уже с использованием онлайн-сервиса APK Decompilers. Вся процедура выглядит так:

  1. Перейдите на сайт APK Decompilers и нажмите на «Выберите файл».

Как и в предыдущем способе, загрузка объекта осуществляется через «Проводник».

Запустите обработку.

Внизу будет отображен таймер предположительного времени, которое будет затрачено на декомпиляцию APK.

После обработки появится кнопка, щелкните по ней, чтобы начать скачивание результата.

Готовая информация будет скачана в виде архива.

В самой закачке будут отображаться все присутствующие в APK директории и элементы. Открыть и редактировать их можно с помощью соответствующего софта.

Процедура декомпиляции APK-файлов требуется далеко не всем пользователям, однако для некоторых полученная информация представляет большую ценность. Поэтому сайты, подобные тем, которые мы рассмотрели сегодня, значительно упрощают процедуру получения исходного кода и других библиотек.

Опишите, что у вас не получилось.
Наши специалисты постараются ответить максимально быстро.

9 ответов

Вы можете выполнить следующие шаги, чтобы изменить свой класс Java:

  1. Декомпилируйте файл .class, как вы это сделали, и сохраните его как .java
  2. Создайте проект в Eclipse с этим Java-файлом, оригинальным JAR
    как библиотека и все ее зависимости
  3. Измените .java и скомпилируйте
  4. Получите измененный файл .class и поместите его снова в исходный
    JAR.

Используйте редактор байт-кода, например:

Будьте осторожны, потому что вам нужно очень хорошее знание байт-кода Java.

Вы также можете изменить класс во время выполнения с помощью переплетения байт-кода (например, AspectJ).

В JD EClipse Decompiler вы видите декомпилированное представление байтового кода в файле .class. Даже если вы измените текст, это не повлияет на байт-код.

Используйте библиотеку Java java assist для управления байт-кодом Java (файл .class) приложения.

— > Spring, Hibernate, EJB, использующий это для реализации прокси

— > мы можем манипулировать байт-кодом, чтобы выполнить некоторый программный анализ

— > мы можем использовать Javassist для реализации прозрачного кэша для возвращаемых значений метода, перехватывая все вызовы метода и делегируя только супер реализации при первом вызове.

Вы можете изменить код при декомпиляции, но его нужно перекомпилировать в файл , декомпилятор выводит , этот код должен быть перекомпилирован с тем же путем к классам, что и исходный / файл

Насколько мне удалось выяснить, простого способа сделать это не существует. Самый простой способ — на самом деле не преобразовать файл класса в исполняемый файл, а обернуть исполняемый модуль запуска вокруг файла класса. То есть создайте исполняемый файл (возможно, исполняемый файл сценариев для ОС), который просто вызывает класс Java через командную строку.

Если вы хотите, чтобы на самом деле была программа, которая это делает, вам стоит взглянуть на некоторые из автоматических установщиков.

Вот способ, который я нашел:

Вы можете использовать любой декомпилятор, чтобы сначала декомпилировать файл.

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

  1. Извлеченный файл класса из банки

  2. Открыл его в декомпиляторе (я использую JD GUI, вы можете легко получить его из многих ресурсов в интернете)
    Вы можете скачать его с здесь

  3. Вы можете просмотреть все файлы в банке с помощью графического интерфейса JD.

  4. внес изменения в файл, который я хотел, и скопировал весь код из этого файла
  5. Создал новый проект в eclipse только с этим классом ( с той же структурой пакета, что и в jar ), предоставил исходный jar в виде библиотеки и все другие зависимости.
  6. Скомпилировал класс, вставил файл .class обратно в папку jar из папки bin моего рабочего пространства
  7. Протестировал мое изменение, отпраздновал его, потягивая чашку кофе:)

Иногда нам нужно собрать один файл из тысячи файлов, чтобы решить проблему. В таком случае можно создать такую ​​же структуру папок, как путь к классу, декомпилировать файл в java или скопировать файл java из исходного кода. Внесите необходимые изменения, скомпилируйте один конкретный файл в класс со всеми зависимостями /классами и, наконец, замените файл класса. Наконец перезапустите контейнер. После того, как война взорвана, файл не будет заменен.

Frequently Asked Questions

What is Android Reverse Engineering?

Android reverse engineering is used by developers to understand the working of apps and find out how things work. It is also used for reading another’s code while experimenting with developing new apps.

How Can I Get Source Code From Apk?

Rename Apk from app.apk to app.zip and extract the zip file into a folder. Use JADX tool to read the source code, present in classes.dex file.

How Do I Decompile An App?

In order to decompile an App, you need to install an APK extractor on your Android phone. Plus, you would also need Android SDK, dex3jar, and JD_GUI for this purpose.

apktool Tutorial to Edit APK Files

We will cover only the basics of APK file manipulation. This only includes decompilation and compilation. Anything else lies outside of the scope of this article and should be covered in a separate writing.

Related Post How to Install APK Using ADB Commands

Decompile, Edit and Recompile APK Files

First, download the APK file which you need to decompile and edit. In this guide, we will be using the Facebook Lite App APK as an example. You can download it here.

Next, open a terminal emulator or command prompt inside the folder you downloaded the APK file to. To do this on Windows, navigate to the folder using Windows Explorer and then type CMD in the address bar as shown below. Hit enter and a command prompt window will open.

Decompiling an APK file is quite simple. You just need to issue a command in the following form:

apktool d <APK filename>

For the Facebook Lite App, this will get into:

apktool d facebook_lite_v118.0.0.9.94.apk

Apktool will create a new folder with the same name as the APK file and place all the App data inside it.

The new folder will have a structure similar to the following:

  • The res folder contains everything that has to do with translations and user interface layout.
  • The smali folder contains App source code in the smali form. Smali is a language type similar to assembly. To make any changes apart from cosmetic ones to an App, these are the files you need to mess with.
  • The unknown folder contains everything else that comes packaged inside the APK file but does not follow Google’s guidelines for APK packaging.
  • Lastly, AndroidManifest.xml is the Manifest file. This contains information like the App name and characteristics, the Intents it listens to and the Permissions it uses.

Compile APK from a Modified Source

Compiling a modified source with apktool is as simple as decompiling. You can get the job done by just issuing a command in the form:

apktool b <app_source_path>

In our example with the Facebook Lite App, this will get into:

apktool b facebook_lite_v118.0.0.9.94

That is all you need to know if you want to compile and decompile APK files for Android. Stay tuned for special guides about manipulating App icons and colors and adding or removing functionalities to your apps! Try it now and let us know if you were able to decompile and compile an APK. I just hope our apktool tutorial will help you edit APK files yourself.

Read Next Build.prop Tweak to Improve Interface FPS on Android

Apktool

Для начала скачиваем утилиту Apktool, который представляет собой jar-файл с номером версии. Для удобства переименовываем его в короткий вид apktool.jar, так как будем работать в командной строке. Подопытный файл разместите в той же папке с утилитой.

Запускаем в окне командной строки утилиту с флагом d:

Появится отдельная папка, имя которой будет совпадать с именем вашего файла. Зайдите в неё и исследуйте файлы. Вы заметите, что XML-файлы теперь доступны для чтения в нормальном виде. Таким образом, мы можем открыть файл activity_main.xml и узнать разметку своей активности.

В папке вы также найдёте множество системных файлов, которые проект тянет с собой при создании приложения. На них не обращаем внимания. Вам нужно искать только те файлы, которые создавали программисты, хакеры, вы.

При изучении своей или чужой программы вам надо посмотреть на файл манифеста, чтобы узнать используемые разрешения, список активностей, сервисов и т.д. А в папке res изучить все ресурсы, относящиеся к программе.

Моя тестовая программа была слишком проста. В других примерах могут быть дополнительные папки, например, assets, которая может содержать файлы, картинки и т.д. Там могут находиться html-файлы с сценариями на Javascript, которые ведут на вредные страницы.

В папке smali находятся уже файлы классов с тем же расширением smali. Код выглядит как в ассемблере и при желании можно понять листинг, но очень неудобно. Оставив файлы пока в покое.

Первую часть задачи мы выполнили.

How to Decompile and Recompile APK Files

  1. Download the ADB files and extract them to a folder on your PC. Avoid extracting them on Desktop, because the black spaces in the username might pop some errors during the decompiling and recompiling.
  2. Download and extract the Apktool files in the same folder where you extracted the adb tools.
  3. We are taking SystemUI.apk as the test apk to decompile and recompile, you can take any apk you want to mod. So you will have similar files:
  4. Now open a command prompt in the ADB folder by holding Shift key and Right Click in the empty space in the folder.
  5. Now you need to install the framework on your device. You can install the SystemUI.apk alone, but installing the framework-res.apk is also recommended in case of system apps. Type the following command to install:
    apktool if <app-name.apk>

    In this case:

    apktool if framework-res.apk
    

    You will get the output similar to this:

  6. Now similarly install the SystemUI.apk using the command:

    apktool if SystemUI.apk
  7. Now we are ready to decompile the SystemUI.apk file. Type the following command to decompile the file:
    apktool d <apk-name.apk>

    In this Case:

    apktool d SystemUI.apk

    You will see a lot of activity on your command screen, the output should be similar to this:

  8. As you can see that the decompiling process takes resource table from the framework we installed in the previous steps. After the APK is decompiled you will see a folder in the ADB tools directory itself with the name of the decompiled apk. Inside the folder, you will get the folders similar this:
  9. These folders are more or less similar to an APK file. The res folder contains all the media files including images, ringtones and many more. It also contains the front end XML files which can be used to alter the look and feel of the app you’ve decompiled.
  10. The Smali folder is the tricky part, it contains the processed Java files in the form of .smali files. This folder only appears if the APK is deodexed, otherwise, these files are compressed in a single file with an extension .odex which will be found outside the APK. So you won’t get the Smali files unless the APK is deodexed.
  11. The Smali files are responsible for the functionality of the app, and handling them would create direct impacts to the app. So be careful while editing these files as they might cause unexpected responses on your device.
  12. Start your tinkering and make the necessary modifications to the APK, once finished we can recompile the APK.
  13. To recompile the APK type the following command:
    apktool b <decompiled-folder-name>

    In this case:

    apktool b SystemUI

    You will get a similar output once you press enter after typing the command:

  14. Now you can find the recompiled APK in the dist folder in the decompiled APK directory (SystemUI\dist)
  15. Now the APK is built, but due to the modifications made, the APK might not be compact and uses much more system resources than it actually should. To avoid this, we will align the package using Zipalign tool.
  16. Download the Zipalign tool and extract it in the same folder where you have placed the recompiled APK. →
  17. Now type the following command to Zipalign the APK
    zipalign -v 4 <recompiled-apk.apk> <final-apk.apk>

    In this case:

    zipalign -v 4 SystemUI.apk SystemUI-final.apk

    Once you press enter, you will see a lot of lines scrolling up. Don’t worry, it is just aligning your app package. At the end you should see a success message like this:

  18. Now you will see a new file created in the folder with the name SystemUI-new.apk (or whatever APK you modded) This is the final APK which is optimized using the Zipalign tool.
  19. You can flash this modded app in any possible way, you are comfortable with.

That’s it, you have now decompiled an APK, then modded it, recompiled the modded APK and finally you have optimized its performance using the Zipalign tool.

Lot of things to learn in a single tutorial, right? Leave your feedback in the comments section below.

Read Next Decompile, Modify and Compile APK Files with APK Easy Tool

News

  • 29 Nov 2019 — Apktool v2.4.1 Released

    Details / Download

  • 03 Mar 2019 — Apktool v2.4.0 Released

    Details / Download

  • 05 Sep 2018 — Apktool v2.3.4 Released

    Details / Download

  • 26 Apr 2018 — Apktool v2.3.3 Released

    Details / Download

  • 07 Apr 2018 — Apktool v2.3.2 Released

    Details / Download

  • 26 Dec 2017 — Apktool v2.3.1 Released

    Details / Download

  • 21 Sep 2017 — Apktool v2.3.0 Released

    Details / Download

  • 29 Jul 2017 — Apktool v2.2.4 Released

    Details / Download

  • 13 Jun 2017 — Apktool v2.2.3 Released

    Details / Download

  • 07 Jun 2017 — Sourcetoad Sponsors Apktool

    Details / Sourcetoad

  • 23 Jan 2017 — Apktool v2.2.2 Released

    Details / Download

  • 18 Oct 2016 — Apktool v2.2.1 Released

    Details / Download

  • 07 Aug 2016 — Apktool v2.2.0 Released

    Details / Download

  • 07 May 2016 — Apktool v2.1.1 Released

    Details / Download

  • 27 Mar 2016 — Apktool v2.1.0 Released

    Details / Download

  • 31 Dec 2015 — Apktool v2.0.3 Released

    Details / Download

  • 12 Oct 2015 — Apktool v2.0.2 Released

    Details / Download

  • 15 Jul 2015 — Apktool v2.0.1 Released

    Details / Download

  • 21 Apr 2015 — Apktool v2.0.0 Released

    Details / Download

  • 18 Mar 2015 — Moved from GoogleCode to GitHub
  • 16 Mar 2015 — GoogleCode Update

    project starred by 3000 users!

  • 12 Feb 2015 — Apktool v2.0.0 RC4 Released

    Details / Download

  • 26 Nov 2014 — Apktool v2.0.0 RC3 Released

    Details / Download

  • 05 Oct 2014 — Apktool v2.0.0 RC2 Released

    Details / Download

  • 06 Feb 2014 — Apktool v2.0.0 beta 9 Released

    Details / Download

  • 13 Oct 2013 — Apktool v2.0.0 beta 7 Released

    Details / Download

  • 27 May 2013 — GoogleCode Update

    project starred by 2000 users!

  • 02 Feb 2013 — Apktool v1.5.2 Released

    / Download

  • 28 Dec 2012 — Apktool v1.5.1 Released

    / Download

  • 23 Dec 2012 — Scripts r05-ibot Released

    Mac, Windows, Linux

  • 02 Sep 2012 — Apktool v1.5.0 Released

    Changes / Download

  • 21 Aug 2012 — Apktool v1.4.10 Released

    / Download

  • 28 Jul 2012 — Apktool v1.4.9 Released

    / Download

  • 08 Jul 2012 — Apktool v1.4.8 Released

    / Download

  • 05 Jul 2012 — Apktool v1.4.7 Released

    / Download

  • 14 Feb 2012 — Apktool v1.4.6 Released

    / Download

  • 07 Jan 2012 — Apktool v1.4.5 Released

    / Download

  • 11 Dec 2011 — Apktool v1.4.4 Released

    / Developer (iBotPeaches)

  • 08 Dec 2011 — Apktool v1.4.3 Released

    / Download

  • 07 Dec 2011 — GoogleCode Update

    project starred by 1000 users!

  • 02 Dec 2011 — Apktool v1.4.2 Released

    / Download

  • 15 May 2011 — Apktool v1.4.1 Released

    / Download

  • 15 May 2011 — Apktool v1.4.0 Released

    / Download

  • 04 May 2011 — Scripts r04-brut1 Released

    Mac, Windows, Linux

  • 19 Jan 2011 — Apktool Source Released
  • 03 Sep 2010 — Apktool v1.3.2 Released

    / Download

  • 03 Sep 2010 — Script 2.2r01-3 Released
  • 16 Jun 2010 — Apktool v1.3.1 Released

    / Download

  • 10 Jun 2010 — Apktool v1.3.0 Released

    / Download

  • 04 Jun 2010 — Scripts 2.2r01-1 Released

    Mac, Windows, Linux

  • 03 Jun 2010 — Apktool v1.2.0 Released

    / Download

  • 29 Apr 2010 — Apktool v1.1.1 Released

    / Download

  • 28 Apr 2010 — Apktool v1.1.0 Released

    / Download

  • 02 Apr 2010 — Apktool v1.0.0 Released

    / Download

  • 13 Mar 2010 — Apktool v0.9.2 Released

    / Download

  • 02 Mar 2010 — Apktool v0.9.1 Released

    / Download

  • 01 Mar 2010 — Initial Release (v0.9.0)

    Developer (brut.alll)

Добавление своего Java класса

  1. Разместить исходники класса внутри папки src.
  2. Разместить classes.dex в папке lib.
    Если во время исполнения скрипта файл classes.dex не будет обнаружен в папке lib, будет использоваться classes.dex от Embarcadero (к нему необходимо указать путь — EMBO_DEX)
  3. Внести изменения в build.bat: указать путь к *.java файлам. Найти и заменить src\com\company\package\*.java в 28 строке файла build.bat.
  4. Запустить ./build.bat из командной строки (находясь в папке compile, содержащей этот файл).
    Результатом слияния, если оно прошло успешно, будет output\dex\classes.dex.
  5. Если ваш класс Service или Activity, вероятно, его необходимо будет прописать в шаблоне манифеста — AndroidManifest.template.xml. Такой шаблон можно найти в папке любого проекта на Delphi XE с target-platform = Android.
  6. Модифицированный classes.dex необходимо подключить к проекту в меню Project -> Deployment на подобие того, как это сделано с оригинальным classes.dex. Оригинальный classes.dex при этом следует отключить.

При первом использовании рекомендуется заглянуть в build.bat и определить переменные ANDROID и EMBO_DEX в соответствии со своим рабочим окружением.

  • ANDROID — Путь к ANDROID SDK (рекомендуется использовать SDK, распространяющийся вместе с Delphi XE);
  • EMBO_DEX — Путь к classes.dex от Embarcadero (не нужен, если присутствует classes.dex в папке lib этого набора).
  • PROJ_DIR — Рабочая директория (т.е. папка, из которой запущен скрипт).

Автоматический путь

Вы можете использовать APKTool. Он будет автоматически извлекать все классы (), ресурсы (), затем он преобразует двоичный XML в удобочитаемый XML, а также будет разобрать классы для вас. < ш > Разборка всегда будет более надежной, чем декомпиляция, особенно с помощью
JAR, запутанные Pro Guard!

Просто скажите APKTool, чтобы декодировать APK в каталог, а затем изменить то, что вы хотите,
и, наконец, закодировать его обратно в APK. Это все.

Важно: APKTool разборки. Это не декомпилировать

Сгенерированный код не будет источником Java.
Но вы должны уметь читать и даже редактировать его, если вы знакомы с jasmin.
Если вы хотите источник Java, перейдите по пути Manual.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector