[Windows][UTILITY][TOOL] APK Multi-Tool

Search This thread

Bcl2

Senior Member
Jul 24, 2015
166
24
Hello my friends, I need help. I'm trying to decompile the framework-res of a custom rom (pixel experience [android 8.1]), but when I try to decompile I get the following error (taken from the log):

java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
Exception in thread "main" java.lang.NullPointerException
at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(ResStyleValue.java:58)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:516)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:267)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:131)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:108)
at brut.apktool.Main.cmdDecode(Main.java:163)
at brut.apktool.Main.main(Main.java:81)

I think the java and sdk path are set correctly, since both ''java'' and ''adb'' command are recognized in the command prompt. What can I do?
 

mobisat

Senior Member
Feb 7, 2009
211
4
I have just installed this on my pc, created the folders and put an APK file in the folder to decompile. It returned an error, the log is below, any help would be much appreciated.

Code:
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) Client VM (build 25.191-b12, mixed mode)
I: Baksmaling...
Unable to create file E:\APKMultiTool\other\..\projects\Test.apk\smali\con.smali - skipping class
Unable to create file E:\APKMultiTool\other\..\projects\Test.apk\smali\aux.smali - skipping class
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
        at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:56)
        at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:491)
        at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:74)
        at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:66)
        at brut.androlib.Androlib.getResTable(Androlib.java:50)
        at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:189)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
        at brut.apktool.Main.cmdDecode(Main.java:146)
        at brut.apktool.Main.main(Main.java:77)
Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000
        at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)
        at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:44)
        at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:102)
        at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)
        at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
        ... 8 more
 

JerryGoyal

Senior Member
Jan 23, 2013
254
159
new delhi
www.jerrygoyal.com
not able to decompile OPSystemUI.apk for oneplus 6
here are the apk's https://drive.google.com/drive/u/0/folders/1Ahe0zTg6z8YfkE7I-yhZp5CFAFvFeAPD
I tried dragging framework file but keep getting error: "Sorry thats not the dependee apk, try again"
however i'm able to decompile framwork-res.apk

java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
Exception in thread "main" java.lang.NullPointerException
at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(ResStyleValue.java:58)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:516)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:267)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:131)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:108)
at brut.apktool.Main.cmdDecode(Main.java:163)
at brut.apktool.Main.main(Main.java:81)
 
Last edited:

3to4

Senior Member
Aug 13, 2009
377
36
Lyon
SBrowser.apk

Hello!
I am trying just to change the color of the statusbar of SBrowser (SBrowser_3.0.38.apk) in system/app/SBrowser_3.0.38 in my note 3 (Lollipop), but the recompiled apk always gets a FC.
(It starts and one second later, it gets a FC.)
I use Apk Multi-tool with apktool 2.2.2 (which I copied in "other" directory), with which I successfully customized SystemUI, SecSetting, etc. However, recompiled SBrowser always gets a FC, even when I do not change anything. I tried Android multitool as well, with the same result. So, I think the issue is not Apk multi-tool, but there may be some other issue.

Can someone suggest what I can try?

By the way, is SBrowser a system app or a non system app? I suppose it is a system app, because it is in system/app.

Thank you.
 

sga999

Senior Member
Mar 13, 2012
818
114
Hello!
I am trying just to change the color of the statusbar of SBrowser (SBrowser_3.0.38.apk) in system/app/SBrowser_3.0.38 in my note 3 (Lollipop), but the recompiled apk always gets a FC.
(It starts and one second later, it gets a FC.)
I use Apk Multi-tool with apktool 2.2.2 (which I copied in "other" directory), with which I successfully customized SystemUI, SecSetting, etc. However, recompiled SBrowser always gets a FC, even when I do not change anything. I tried Android multitool as well, with the same result. So, I think the issue is not Apk multi-tool, but there may be some other issue.

Can someone suggest what I can try?

By the way, is SBrowser a system app or a non system app? I suppose it is a system app, because it is in system/app.

Thank you.
I don't know if this will help you, but I used a newer version of apktool. Version 2.3.2 worked well for me a while back, while a couple of newer versions (2.3.3 and 2.3.4) did not work.
 

3to4

Senior Member
Aug 13, 2009
377
36
Lyon
I don't know if this will help you, but I used a newer version of apktool. Version 2.3.2 worked well for me a while back, while a couple of newer versions (2.3.3 and 2.3.4) did not work.

Thank you for your suggestion. I am very sorry, the apk I am trying to change is in my Galaxy TAB S (Lollipop) and not in my note 3, but anyway, your suggestion is of course valid. So, I tried apktool 2.3.2 but I still get a FC with recompiled SBrowser in which I don't change anything. I had tried before 2.3.4 and 2.4.0, with the same result. It is very strange... Do you maybe have another suggestion. I am out of ideas...
 

sga999

Senior Member
Mar 13, 2012
818
114
Thank you for your suggestion. I am very sorry, the apk I am trying to change is in my Galaxy TAB S (Lollipop) and not in my note 3, but anyway, your suggestion is of course valid. So, I tried apktool 2.3.2 but I still get a FC with recompiled SBrowser in which I don't change anything. I had tried before 2.3.4 and 2.4.0, with the same result. It is very strange... Do you maybe have another suggestion. I am out of ideas...
Sorry, no idea. I only used apktool one time, and using a different version did work for me. But I didn't have the same issue that you are having. I actually had errors when running it with some versions, but not with the one that I mentioned.
 

3to4

Senior Member
Aug 13, 2009
377
36
Lyon
I found a solution!! I simply copied resources.arsc from the recompiled apk into the original apk. Then, I flashed it into my Galaxy Tab S, and the apk works well without any FC, and with the statusbar color changed.
Thank you anyway.
 
  • Like
Reactions: 5taavenida

Devilix

Senior Member
Sep 23, 2009
169
22
Why i get this error when i try to decompile an APK?
I have java update, and java sdk installed...
Please help me, thanks!

Code:
--------------------------------------------------------------------------
|22/07/2020 -- 16:02:25,33|
--------------------------------------------------------------------------
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)
Exception in thread "main" java.lang.NullPointerException
        at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(Re
sStyleValue.java:58)
        at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResour
ces.java:516)
        at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:267
)
        at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:131)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:108)
        at brut.apktool.Main.cmdDecode(Main.java:163)
        at brut.apktool.Main.main(Main.java:81)
Premere un tasto per continuare . . .
 

Top Liked Posts

  • There are no posts matching your filters.
  • 384
    I am currently working on a major update to the apk manager application as well and changing the name to APK Multi-Tool with some new added features and also to fix some issues with some code errors.

    I am also changing a lot of the features as well since a lot of the code has been outdated for a while.
    I have updated all the files and modified Apk manager's Scripts to fix many user reported bugs from Daneshm90 apk manager which he had written a simple script to ease the process of editing apks. Got a lot of downloads so thought its in demand
    Whether you're doing basic image editing or editing the smali or xml files, on average u have to use (Brut.all or JF's smali/baksmali) awesome tool to extract the apk, edit it, then sign the apk and then adb push/install it. This process is quite tiresome if you are testing a method that needs fine tweaking.
    This script should make the process a LOT smoother.
    Theres an option of compiling/signing/installing all in one step
    Thanks:
    Goes to Daneshm90 the Original Writer of APK Manager
    Goes to Brut.all for his awesome tool.
    Goes to JF for ofcourse, smali/baksmali


    Features:
    - Added framework dependent decompiling (For non propietary rom apks). (Option 10). Checks whether the dependee apk u selected is correct.
    - Allows multiple projects to be modified, switch to and from.
    - Allows to modify system apk's using apktool but ensures maximum compatibility in terms of signature / manifest.xml
    - Batch optimize apk (Zipalign,optipng,or both)
    - Batch Ogg optimization
    - Batch install apk from script (option 19)
    - Batch Theme Image Transfer TOOL
    - Batch Theme optipng TOOL
    - Batch Theme Zipalign APK TOOL
    - Compression level selector (monitor status above menu)
    - Error detection. Checks if error occurred anytime u perform a task, and reports it
    - Extract, Zip apk's.
    - Incorporates brut.all's apktool
    - Improved syntax of questions/answers
    - Logging on/off has been removed. Instead a log.txt is created which logs the activities of the script organized using time/date headers
    - Optimize pngs (ignores .9.pngs)
    - Pull apk from phone into modding environment.
    - Push to specific location on phone
    - Quick sign an apk (Batch mode supported)
    - Read log (Option 24)
    - Sign apks
    - Supports batch installation, so if u drag multiple apks into the script (not while its running) it will install them all for u. U can ofcourse drag a single apk as well
    - User can change the max java heap size (only use if certain large apks get stuck when decompiling/compiling apks) (Option 19)
    - U can now set this script as ur default application for apks. When u do, if u double click any apk it will install it for u.
    - Zipalign apks
    - Much Much More
    Instructions:
    - Place apk in appropriate folder (Any filename will work, if running for first time folders will not be there, you must run and then the folders will be created)
    - Run script
    - Minimize the script
    - Edit files inside the project folder
    - Maximize the script

    Requirements:
    Java 1.6
    Android SDK


    FAQ

    Resulting apk file is much smaller than original! Is there something missing?

    First: compression of resources.arsc file. Sometimes this file is compressed in original apk, sometimes not and apktool always compress it. Second: lack of META-INF dir. Apktool builds unsigned apks, so they lack signatures stored in this dir. Third: apktool uses newest Android SDK, so it could optimize files better, especially if original app is old. So: unpack both original and resulting apk, remove META-INF from original and then compare sizes. If they're still much different, then you could report on XDA or somewhere.

    There is no META-INF dir in resulting apk. Is this ok?

    Yes. META-INF contains apk signatures mostly and after modifying apk in no longer signed, so there are no signatures in it. You have to sign resulting apk and then META-INF dir will be created.

    What do you call "magic apks"?
    Sometimes there are some apks which (for my current knowledge) are invalid, broken, theoretically they shouldn't exist. There may be many reasons of their existence: my lack of understanding of Android resources; some non-public, maybe future SDK tools or custom modifications of these; manual hacking of binaries, etc. Usually I can't do anything about it, but you could at least try to replace broken parts by something valid. Actually it's quite likely that they aren't even used, because if they would, then application would crash.

    Got problems ?
    1. Make sure your path has no spaces
    2. Your filename has no wierd characters
    3. Java/adb are in your path
    4. It's not a proprietary rom's apk (aka Sense,Motorola,Samsung) (If u are, then use option 11 and drag the required framework, eg com.htc.resources, twframework-res...etc)
    5. It's not a themed apk (if it is, expect .9 png errors, use as close to stock as possible)
    6. Look at the log to know whats happening
    7. If all else fails, post as much info as possible and we will try to assist you.

    TO DO LIST
    Add new feature to Randomly Generate a new Key File for signing the apk files after modifying and recompiling of the apk files this will also allow of uploading to the android market as this added feature will allow you to sign apk files that you may of compiled without signing beforehand.

    Modify the Signapk script to be compatible with the Randomly Generation feature in the works

    and a few other added features are in the works as I am redesigning the application and rewriting a lot of the code to fix issues as well as some of the new features have broken parts as some features have been moved and broken some command line prompts.

    Installing APK Multi-Tool Itself

    Run the installer and make sure it is pointed to the root of hard drive
    Example
    C:\APKMultiTools\

    Downloads:
    http://apk-multi-tool.github.io/APK-Multi-Tool/ for all downloads and updates
    Please check back daily or weekly as this project is under active Development and I am releasing Alpha releases on the website for Testing and bug reports.
    Latest test build http://hugefiles.net/79bvb14x2f8p
    Mailing List:
    Google Group Email mailing List

    If you like this and wish to wish to send cash my way Donations Are Welcome
    9
    Optipng'ing is not working for me. After extraction, Optipng will be run and will do nothing because it says it cannot find the folder.

    Which optiping are you using the batch theme opt or the original method

    Sent from my DROID using xda premium
    9
    added lollipop support to 2.0 wip branch
    8
    On the Windows 2.0 WIP branch I have added the latest patches and support for the Lolly-pop Android Versions.

    On the Master branch of the Linux version I have also added support for Lolly-pop Android versions

    in the download section you will see two different links to download the latest builds one is a adfly link and a Normal Link.

    Help support the website by using the adfly links which every click will help support the site with a small advertisement. to get the download just click on the SKIP AD button in the upper right corner which will appear after 5 seconds and to further help please have any ad blocker turned off on the website.

    I have not received any donations in over a year and i have noticed that on a average i am getting between 300-1000 downloads of my application daily and it is hard work and cost money to run a website and also I am unemployed because of a disability and have zero income right now as my disability case is still in limbo and working on a lawyer to get it. I have been unemployed for over a year now and my wife is working three jobs and we are getting behind in the bills and rent because i am unable to work so any support is welcome specially with a wife and 2 kids a 2 year old and a year old.
    8
    APK Multi-Tools Version 1.0.9 Now Released

    Version 1.0.9
    Fixed the broken Option menu list
    Fixed the broken Complier scripts for system Files
    Fixed the broken Complier scripts for non system Files
    Added the ability to create Signed None System APK files with both the keep folder option and to bypass the keep folder
    Added the Option to create unsigned APK Files with out using the keep folder