Apktool | A tool for reverse engineering Android apk files
kandi X-RAY | Apktool Summary
kandi X-RAY | Apktool Summary
It is a tool for reverse engineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications; it makes possible to debug smali code step by step. Also it makes working with app easier because of project-like files structure and automation of some repetitive tasks like building apk, etc. It is NOT intended for piracy and other non-legal uses. It could be used for localizing, adding some features or support for custom platforms and other GOOD purposes. Just try to be fair with authors of an app, that you use and probably like. If you discover a security vulnerability within Apktool, please send an e-mail to Connor Tumbleson at connor.tumbleson(at)gmail.com. All security vulnerabilities will be promptly addressed.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Generate the Qualifiers .
- Create the command line options .
- Compiles an APK2 package
- Processes the next token .
- Read config flags .
- Start tag .
- Escapes Java style characters in a string .
- Encode the given string as XML value .
- Decodes dex file .
- Build resources .
Apktool Key Features
Apktool Examples and Code Snippets
Community Discussions
Trending Discussions on Apktool
QUESTION
I am currently pentesting an Android app. I decompiled the app without any issues and whenever I try to recompile it back, the apktool.jar throw Unbound Prefix Error
from the locale_config.xml
file. Checked the syntax and they're all okay. I don't have any clue on what's going on.
ANSWER
Answered 2022-Mar-17 at 17:14For pentesting purposes, you might want to just get rid of localeConfig
.
To do this with minimal changes:
- Comment out all the
lines in
locales_config.xml
. - Remove
android:localeConfig="@xml/locales_config"
attribute of thetag in
AndroidManifest.xml
.
That should do it.
QUESTION
My app"s permissions are not being requested on launch, the only way to allow it is by settings>apps>my_app>permissions>allow_permissions
. Its possible to make the app request it just by modifying the manifest, the activity_main.xml, or some other file in the decompiled apk folder (using apktool) ?
ANSWER
Answered 2022-Feb-15 at 01:50No, runtime permissions must be requested in code.
They must be declared in the manifest (which they already are if they're showing up in the settings), but only the code can actually pop up the dialog to request the permission.
QUESTION
I would like to add something to an app, so I added some lines to a smali file (decompiled the apk using apktools) and then repackaged and ran it on a real device. It shows
- 10121 10211 E AndroidRuntime: os.json.JSONObject a.b.a.a.a.i.m(android.context.Context, java.lang.String) Failed to verify: os.json.JSONObject a.b.a.a.a.i.m(android.context.Context, java.lang.String): [0x161] v0 has type Conflict but expected Reference: java.lang.AutoCloseable (declaration of 'a.b.a.a.a.i' in /data/app/xxxx/xxxxx/base.apk)
So what does the [0x161] refer to? Is it a line number? 0x161 = 353 in decimal. So I checked the smali code, but the function a.b.a.a.a.i.m has less than 353 lines in smali, so there is no line 353 and I can not locate the error.
Neither does this function have enough lines in java (I used jadx to decompiled the generated apk).
So in which type of file can I locate the problem in file's line 353? Should I transformed the apk into some other format to find a line 353 to troubleshoot the error? Thanks in advance.
...ANSWER
Answered 2022-Jan-31 at 14:420x161
should be the relative offset/address in bytes from the start of the method.
You can enable in Jadx Show Dalvik Bytecode
from context menu of the smali code panel to see the offsets. The offset you are looking for should be shown in the second gray colored column (the one with the red border in the sample screenshot).
And the error should be caused by placing a wrong object reference in v0
.
QUESTION
I am trying to turn an apk into aab, decompile with apktool, and build with aapt2 and bundletool (all in command line, without gradle).
After decompile, aapt2 compile and link looks good, but when I execute build-bundle with bundletool, I got this error. What went wrong? And How can i fix it?
...ANSWER
Answered 2022-Jan-20 at 09:11I have found a solution to my own problem. I can provide -m
flag to decompile code like this:
QUESTION
I hava an apk file.
When the apk is used v1 signature, it is ok when unzip an apk file. But when using v2, unzip fails.
How can i get the original dex file?
What i want to do is to modify the dex with ida, then rebuild to get a new apk.
I know i can use apktool to get smali files, then modify smali file and rebuild to a new apk. But i want do try modify dex file in hex mode(eg. using ultra edit).
...ANSWER
Answered 2021-Nov-19 at 15:21You can pass -s, --no-src
to apktool for apktool -s name_of_apk.apk
and that will skip the sources. This is what is normally disassembled to smali folders.
QUESTION
I have an .apk file for an old version of an app but don't have the ability to rebuild the app from source using cordova. I'm trying to debug an error and would like to enable remote debugging. Is it possible to enable remote debugging of the webview without rebuilding the app?
I've tried unpacking the app using apktool, adding android:debuggable="true"
to the AndroidManifest.xml and then repacking and resigning the .apk.
When I run the app I can see the device in the device list of chrome://inspect#devices but the webview is not appearing. Am I missing something?
...ANSWER
Answered 2021-Sep-17 at 22:34On Android in order to debug a WebView inside of an app, the following must be set in the app's code:
WebView.setWebContentsDebuggingEnabled(true);
From: https://developer.chrome.com/docs/devtools/remote-debugging/webviews/
Given that you are reverse engineering an APK, you may want to look to see if the code exists and needs a special flag or attempt to add in the Smali code yourself.
QUESTION
4.1 dirthy, but this version was not official of apktool, and I was having some problems, so I upgraded to version 2.5.0 and official, however I want my apktool folder to be in /usr/share
but if I move my apktool folder to /usr/share
when I run apktool the result is this:
ANSWER
Answered 2021-Apr-14 at 05:42If you follow the steps to install apktool: https://ibotpeaches.github.io/Apktool/install/
You will notice there are 2 files you need:
- a script (the one you posted), which you should name
apktool
and set to executable on linuxchmod +x apktool
- a
jar
file:apktool.jar
You need to have both files in the same directory for the script to work, so if you've moved the apktool
file to /usr/share/apktool
, you need to also move apktool.jar
to /usr/share/apktool.jar
QUESTION
I'm trying to decompile an apk with the apk tools and I'm not getting it.
When I run apktool -d myapp.apk
it displays this error to me:
ANSWER
Answered 2021-Mar-05 at 07:12QUESTION
I'm using Nethunter, and the architecture is Linux arm, and I would love to use the apktool tool, I'm studying and reading pentest books, but I can't practice if I don't apply what's there, the problem is that for me rebuild an apk using apktool b app
it returns an error code 131, which according to the creator of apktool, is that aapt is not working for arm architecture, is there any way I can install aapt for arm?
ANSWER
Answered 2021-Mar-10 at 22:09So guys, as it is not possible to use this tool on Android devices, the solution I found was to use the Apk Editor Pro and change the files I need to change, but I found this Haxus tool that works on Android devices and does the same work that apktool
Haxus tool: https://github.com/Hax4us/Apkmod
QUESTION
Running into an issue around a native-Android Unity integration release into the Play Store. I extract it as a project out of Unity and migrate it as a Library in our native app.
When attempting to upload an .AAB into the Play Store, the following error occurs:
...ANSWER
Answered 2021-Feb-25 at 03:49The problem stemmed from the usage of '.bc' files contained within a Unity library I was using. These bc files are always interpreted as 32-bit. You'll have to upgrade whichever library you're using that contains these files.
You can determine if you have the same issue by running the following command on your APK or AAB file:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Apktool
You can use Apktool like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the Apktool component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page