[UTIL][JAN 20, 2024] Apktool - Tool for reverse engineering apk files

Search This thread

iBotPeaches

Recognized Developer
Apr 8, 2011
951
4,500
Tampa
connortumbleson.com
apktool-logo_1491x543-1.png

Originally Posted by Brut.all, Updated by iBotPeaches
It is a tool for re-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.

Features:
  • decoding resources to nearly original form
  • rebuilding application
  • helping with some repetitive tasks
Links:
v2.9.3 (Released January 20th, 2024)


Apktool 2.9.3
  • md5 e28e4b4a413a252617d92b657a33c947
  • sha256 7956eb04194300ce0d0a84ad18771eebc94b89fb8d1ddcce8ea4c056818646f4

Details of Release: https://connortumbleson.com/2024/01/20/apktool-v2-9-3-released/
Doc site: https://apktool.org/blog/apktool-2.9.3

Thread Tips n Tricks
  1. If you don't know the following terms (aapt, apk, java) - then please don't post in this thread.
  2. If you didn't install frameworks (see FrameworkFiles) - then do that first before asking.
  3. If you want to engage in developer discussions - then post here.
  4. If you want to thank someone or express gratitude - sure why not post here.
  5. If your building from source - do not post those snapshot builds in this thread as we mix builds and makes users confused.
  6. If you believe you've found a bug, I'd prefer you post here: Bug List
  7. If you send me a PM about Apktool support, I will ignore it.
  8. If you post any stacktraces, error logs or console output. Use Ubuntu Paste or Pastebin. Don't clutter our thread with 200 line posts.

Donations:
plegdroid, fisha1, djdarkknight96, Gerard, rquiett, myn, nick1313, robm1911, Accidd, allyourbase, NCandiano, Noxious Ninja, Darkman_RS, XperienceD, Primokorn, muzicfreako, __alax74__, daveyannihilation, aluedeke

Previous Versions:
apktool v2.9.3 -
https://xdaforums.com/t/util-jan-05-2024-apktool-tool-for-reverse-engineering-apk-files.1755243/post-89286996
apktool v2.9.2 - https://xdaforums.com/t/util-dec-06-2023-apktool-tool-for-reverse-engineering-apk-files.1755243/page-306#post-89258153
apktool v2.9.1 - https://xdaforums.com/t/util-oct-08-2023-apktool-tool-for-reverse-engineering-apk-files.1755243/post-89203146
apktool v2.9.0 - https://xdaforums.com/t/util-jul-22-2023-apktool-tool-for-reverse-engineering-apk-files.1755243/page-305#post-89090293
apktool v2.8.1 - https://xdaforums.com/t/util-jul-17-2023-apktool-tool-for-reverse-engineering-apk-files.1755243/post-88784969
apktool v2.8.0 - https://xdaforums.com/t/util-nov-24-2022-apktool-tool-for-reverse-engineering-apk-files.1755243/page-305#post-88763303
apktool v2.7.0 - https://xdaforums.com/t/util-feb-26-2022-apktool-tool-for-reverse-engineering-apk-files.1755243/post-87771235
apktool v2.6.1 - https://xdaforums.com/t/util-sep-2-2021-apktool-tool-for-reverse-engineering-apk-files.1755243/page-300#post-86491353
apktool v2.6.0 - https://xdaforums.com/t/util-dec-2-2020-apktool-tool-for-reverse-engineering-apk-files.1755243/page-299#post-85570929
apktool v2.5.0 - https://xdaforums.com/t/util-apktool-tool-for-reverse-engineering-apk-files.1755243/page-297#post-84037727
apktool v2.4.1 - https://xdaforums.com/showpost.php?p=81056995&postcount=5864
apktool v2.4.0 - https://xdaforums.com/showpost.php?p=79028225&postcount=5709
apktool v2.3.4 - https://xdaforums.com/showpost.php?p=77541764&postcount=5507
apktool v2.3.3 - https://xdaforums.com/showpost.php?p=76348010&postcount=5385
apktool v2.3.2 - https://xdaforums.com/showpost.php?p=76158353&postcount=5345
apktool v2.3.1 - https://xdaforums.com/showpost.php?p=74967023&postcount=5178
apktool v2.3.0 - https://xdaforums.com/showpost.php?p=73876294&postcount=5032
apktool v2.2.4 - https://xdaforums.com/showpost.php?p=73219384&postcount=4936
apktool v2.2.3 - https://xdaforums.com/showpost.php?p=72654985&postcount=4819
apktool v2.2.2 - https://xdaforums.com/showpost.php?p=70687935&postcount=4635
apktool v2.2.1 - http://xdaforums.com/showpost.php?p=69188139&postcount=4478
apktool v2.2.0 - http://xdaforums.com/showpost.php?p=68082595&postcount=4324
apktool v2.1.1 - http://xdaforums.com/showpost.php?p=66745194&postcount=4163
apktool v2.1.0 - http://xdaforums.com/showpost.php?p=66069282&postcount=4017
apktool v2.0.3 - http://xdaforums.com/showpost.php?p=64577679&postcount=3839
apktool v2.0.2 - http://xdaforums.com/showpost.php?p=63272013&postcount=3682
apktool v2.0.1 - http://xdaforums.com/showpost.php?p=61884133&postcount=3474
apktool v2.0.0 - http://xdaforums.com/showpost.php?p=60255972&postcount=3063
apktool v2.0.0 RC4 - http://xdaforums.com/showpost.php?p=58809096&postcount=2728
apktool v2.0.0 RC3 - http://xdaforums.com/showpost.php?p=57076271&postcount=2547
apktool v2.0.0 RC2 - http://xdaforums.com/showpost.php?p=55853617&postcount=2425
apktool v1.5.2 - http://xdaforums.com/showpost.php?p=37509949&postcount=1391
apktool v1.5.1 - http://xdaforums.com/showpost.php?p=35982966&postcount=1180
apktool v1.5.1 PR3 - http://xdaforums.com/showpost.php?p=35812999&postcount=1123
apktool v1.5.1 PR2 - http://xdaforums.com/showpost.php?p=35664185&postcount=1084
apktool v1.5.1 PR1 - http://xdaforums.com/showpost.php?p=34090869&postcount=828
apktool v1.5.0 - http://xdaforums.com/showpost.php?p=31040851&postcount=382
apktool v1.4.10 - http://xdaforums.com/showpost.php?p=30526526&postcount=321
apktool v1.4.9 - http://xdaforums.com/showpost.php?p=29447823&postcount=131
apktool v1.4.8 - http://xdaforums.com/showpost.php?p=28457465&postcount=28
 
Last edited:

fisha21

Senior Member
Nov 23, 2007
2,331
4,379
Thanks for posting this, great to see someone carrying on brut.all's awesome work!

Sadly, still won't play nicely with some HTC One apks, but I know that's HTC's fault not yours :)

Look forward to seeing what you've got coming up...

EDIT: Donation sent!
 
Last edited:

rtfpessoa

Senior Member
Dec 30, 2010
579
668
Lisbon
Good work!!!
I started testing and i still have problems with framework-miui-res, any tip?
I think the errors are those about change ex: <id to <item type="id"
Isn't that fixed in this version?

NOTE: If you don't what this kind of questions here, just say it np.
 
Last edited:

iBotPeaches

Recognized Developer
Apr 8, 2011
951
4,500
Tampa
connortumbleson.com
Good work!!!
I started testing and i still have problems with framework-miui-res, any tip?
I think the errors are those about change ex: <id to <item type="id"
Isn't that fixed in this version?

NOTE: If you don't what this kind of questions here, just say it np.


Yeah that should be fixed. The only times it seemed to fail is when the value of that item was @null or null. Which I hardcoded a fix in for. Send me that APK.
 

rtfpessoa

Senior Member
Dec 30, 2010
579
668
Lisbon

iBotPeaches

Recognized Developer
Apr 8, 2011
951
4,500
Tampa
connortumbleson.com

iBotPeaches

Recognized Developer
Apr 8, 2011
951
4,500
Tampa
connortumbleson.com
http://pastebin.com/Q653Thdr

I had the same problem with that smali too.
Any tip?

I just re-built smali/baksmali with the new changes JF made yesterday. Let me know if they work. Re-uploaded to same location.

Code:
root@cyclotron [/home/connor/public_html/miui/other/jf]# md5sum *
37d228ca4fa8c36af89531bd5a2b37c4  baksmali-1.3.4-dev.jar
824abf2deae6954756e34969836b96d4  baksmali-1.3.4-dev-jar-with-dependencies.jar
09fac38365d09afdfbd95557088a4976  baksmali-1.3.4-dev-jar-with-dependencies-small.jar
6e1ab315833a0c34e65a06fc8c4764e4  dexlib-1.3.4-dev.jar
1cd1b4a117d87c5a27aed6bd68715a06  smali-1.3.4-dev.jar
4d1c6ea1f07946d4823f80b5d1f470c9  smali-1.3.4-dev-jar-with-dependencies.jar
181ba18558c5f650c9c1797f8682891c  smali-1.3.4-dev-jar-with-dependencies-small.jar
a41726d66fb78dcc9d835a73b05198e1  util-1.3.4-dev.jar
 

rtfpessoa

Senior Member
Dec 30, 2010
579
668
Lisbon
I just re-built smali/baksmali with the new changes JF made yesterday. Let me know if they work. Re-uploaded to same location.

Code:
root@cyclotron [/home/connor/public_html/miui/other/jf]# md5sum *
37d228ca4fa8c36af89531bd5a2b37c4  baksmali-1.3.4-dev.jar
824abf2deae6954756e34969836b96d4  baksmali-1.3.4-dev-jar-with-dependencies.jar
09fac38365d09afdfbd95557088a4976  baksmali-1.3.4-dev-jar-with-dependencies-small.jar
6e1ab315833a0c34e65a06fc8c4764e4  dexlib-1.3.4-dev.jar
1cd1b4a117d87c5a27aed6bd68715a06  smali-1.3.4-dev.jar
4d1c6ea1f07946d4823f80b5d1f470c9  smali-1.3.4-dev-jar-with-dependencies.jar
181ba18558c5f650c9c1797f8682891c  smali-1.3.4-dev-jar-with-dependencies-small.jar
a41726d66fb78dcc9d835a73b05198e1  util-1.3.4-dev.jar

Tried with that new and same problem.
I confirmed the md5sum.
What is the smali MiuiAndroid used in last week build?
 

rtfpessoa

Senior Member
Dec 30, 2010
579
668
Lisbon

iBotPeaches

Recognized Developer
Apr 8, 2011
951
4,500
Tampa
connortumbleson.com
I'm using MiCode script to deodex the rom, this one https://raw.github.com/MiCode/patchrom_tools/088aa9f2d8158e16e40d2e208506f69123f7b153/deodex.sh
It works if i use any other smali version.

---------- Post added at 06:19 PM ---------- Previous post was at 06:09 PM ----------

Do you suggest other script?

I did make a deodex script. It was dependent on another script I wrote though. I'll make an independent functioning one when I have time.

ibotpeaches stole me apktool :eek:

BAT is nothing compared to CAT.
 

iBotPeaches

Recognized Developer
Apr 8, 2011
951
4,500
Tampa
connortumbleson.com
I've already have a few users report a few problems. To be honest. I spend 100% of my time in MIUI. I never tested some of these APKs (Sense, etc). Though, most have been sent to me. I will work through some of these and figure out why some of them aren't fixed.

All the MIUI ROMs work fine though :)
 

rtfpessoa

Senior Member
Dec 30, 2010
579
668
Lisbon
I've already have a few users report a few problems. To be honest. I spend 100% of my time in MIUI. I never tested some of these APKs (Sense, etc). Though, most have been sent to me. I will work through some of these and figure out why some of them aren't fixed.

All the MIUI ROMs work fine though :)

My problem is with MIUI i' still making tests but not sucess yet is very strange
 

v5HMeca

Senior Member
Dec 7, 2007
451
144
Los Angeles
For anyone that cares, I wrote this batch script for executing apktool in Windows.

Code:
@echo off
set APKTOOL_ERROR=
if not defined APKTOOLVER set APKTOOLVER=1.4.7
java -Xmx512m -jar "%~dp0android\apktool_%APKTOOLVER%.jar" %*
if errorlevel 1 set APKTOOL_ERROR=%ErrorLevel%
if [%1]==[] call :help
if [%1]==[--help] call :help
if [%1]==[-?] call :help
goto :eof

:help
echo ===============================================================================
echo NOTES
echo ===============================================================================
echo APKTool 1.4.5 and above are unofficial builds.
echo - bin: http://bit.ly/LqXR5P
echo - src: http://bit.ly/Jr6AG7
echo - xda: http://bit.ly/ODjm97
echo.
echo See the following discussion for a simple how-to.
echo - http://xdaforums.com/showthread.php?t=707189
goto :eof

Name it apktool.cmd (or something else if you're a weirdo) and stick it somewhere in your path.

Error codes will be stored as APKTOOL_ERROR

If you want to use a different version, simply define the version number with APKTOOLVER.

One caveat is that I keep apktool_*.jar in a subfolder of this batch script called "android," i.e.,
.\apktool.cmd
.\android\apktool_1.4.3.jar
.\android\apktool_1.4.5.jar
.\android\apktool_1.4.7.jar

If that rubs you the wrong way, then simply remove or replace "android" in the part of the script that says %~dp0android\. (note: %~dp0 resolves to the fully qualified path name of the batch script.)
 
Last edited:

Top Liked Posts