Register

How to decompile/compile using apktools

This is a discussion on How to decompile/compile using apktools within the Galaxy Nexus Hacking & Mods [LTE/CDMA] forums, part of the Galaxy Nexus Development category; Originally Posted by cynkrzy So the missing .jar extension is just a typo, I see the next command includes it. The rest of the instructions ...

Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 50
Like Tree11Likes

Thread: How to decompile/compile using apktools

  1. #11
    Cassiopeia
    Member #
    2856
    Liked
    4 times
    Join Date
    Jan 2012
    Posts
    78
    Quote Originally Posted by cynkrzy View Post
    So the missing .jar extension is just a typo, I see the next command includes it. The rest of the instructions worked like a champ, I added the framework, de-compiled and re-compiled systemUI without any problems, now to actually edit some .xml and see if I can change the color on the notification dropdown.

    Thanks so much for this, really made things so much easier!
    Oh good catch yeah it was a typo, I fixed my original post.


    Glad it all worked for you.

  2. #12
    Milky Way
    Member #
    5125
    Join Date
    Feb 2012
    Posts
    20
    Hi, New member here and even newer editor. I want to tell what I am finding on my end using your instructions.

    At the c:\apktoolscommand prompt if I use "java and -jar" in the line it will not work.
    If I just use "apktool.jar if framework-res.apk" it works.
    So for me if I leave it out on any of the commands its all good.

    I am Win7x64 Pro, with the latest Java. So its not the same for everyone eh?

  3. #13
    Milky Way
    Member #
    5125
    Join Date
    Feb 2012
    Posts
    20
    I need some clarification. Please?

    If you only changed xml files, then you just need to copy the resources.arsc file and place it in the original apk file. The reason you need to do this is the signature will change and you want to keep that intact.
    I don't grasp this.

    Copy the "resources.arsc file" from where?
    Place it in the original apk file. I take it this means the apk file from which I got the xml file I made changes in?

    Thanks

  4. #14
    Aquarius
    Member #
    614
    Liked
    507 times
    Join Date
    Dec 2011
    Location
    San Luis Obispo
    Posts
    2,736
    Sorry I didn't see this before, after you recompile the app, there is a folder created called "Dist" with the compiled .apk in it.use 7zip to open it and extract the file. Then open the .apk from the rom, drag the extracted file into the same location. Sorry I can show you screen shots, I'm out of town and don't have my laptop. The .apk files are digitally signed so this method preserves the digital signature of the original file. If you still need help when I get home tuesday, I'll get ya some detailed screen shots

    Sent from my Galaxy Nexus using Tapatalk
    gapi likes this.


  5. #15
    Milky Way
    Member #
    5325
    Join Date
    Feb 2012
    Posts
    2
    @cynkrzy & Ghosthunter

    Useful thread thanks! I'm an owner of a i9000 but also was looking for this. Tried with several APK Tools/Managers
    but this way is kinda flawless.

    Got one question; I editted:

    SystemUI.apk\res\values\drawables.xml
    and
    SystemUI.apk\smali\com\android\systemui\statusbar\ StatusBar.smali

    After doing this I followed your steps but I also don't get what you mean by:

    "Once you have your apk file built you will need to open it with 7zip, and
    copy out any files you changed to the original apk. If you only changed xml
    files, then you just need to copy the resources.arsc file and place it in
    the original apk file. The reason you need to do this is the siganture will
    change and you want to keep that intact."

    I see nicely in my NEW APK a resources.arsc but what shall I do after this?
    Do I need to grab this resources.arsc and put it in somewhere? Or do I need
    to delete it? And shall I do somethin with classes.dex? Or shall I put the
    resources.arsc from the original SYSTEMUI in the new one?

    It's very confusing sorry

    (and I have an ICS'd / CM9 rom for i9000)


  6. #16
    Aquarius
    Member #
    614
    Liked
    507 times
    Join Date
    Dec 2011
    Location
    San Luis Obispo
    Posts
    2,736
    These instructions only apply to .xml edits, I have never attempted to edit the .smali code so can't speak to that.

    I installed the apktools in "c:\apktools" - I'll refer to this as the "installation folder" in all the instructions

    1) Locate the compiled systemUI.apk in "installation folder\systemui\dist"

    2) Open systemUI.apk with 7zip



    3) Copy resources.arsc to your desktop (or anywhere you can easily find it)





    we need to replace the resources.asrc file in the systemUI.apk that you extracted from your ROM and decompiled.
    it should be located in "installation folder" (the place you copied it to before you de-compiled it)

    4) open that file with 7zip

    5) copy resources.asrc from your desktop (or wherever you placed it) into the root of systemUI.apl (replace)

    6) zip up your new systemUI.apk using the instructions found here:
    [How-To] Softkey Mods [WIP] installs with update.zip in CWM

    You now have a flashable .zip with your edited .xml

    The way I understand it you cannot just use the systemUI.apk that you compiled after editing because it needs to have the correct digital signature. I have read other places that Apktool can sign the compiled .apks but I didn't attempt this.

    The method above was recommended to ensure the .apk you install has the digital signature preserved.

    It seemed the safest method and least likely to cause headaches.

    If you read through the posts in this thread there are links to more information about XML editing and using APKTool.

    Hope this helps, Cyn~
    gapi likes this.


  7. #17
    Milky Way
    Member #
    5125
    Join Date
    Feb 2012
    Posts
    20
    Great5, Thanks.........

  8. #18
    Milky Way
    Member #
    5325
    Join Date
    Feb 2012
    Posts
    2
    Nice people! Gonna try it tomorrow morning! Should go fine now

    EDIT: so besides that, if I'm reading it well, the resources.arcs IS containing the modification(s) I did in for example SMALI and .XML?
    Last edited by Anonymous; 02-15-2012 at 03:25 PM.

  9. #19
    Aquarius
    Member #
    614
    Liked
    507 times
    Join Date
    Dec 2011
    Location
    San Luis Obispo
    Posts
    2,736
    Quote Originally Posted by Anonymous View Post
    Nice people! Gonna try it tomorrow morning! Should go fine now

    EDIT: so besides that, if I'm reading it well, the resources.arcs IS containing the modification(s) I did in for example SMALI and .XML?
    Only XML, not the code.

  10. #20
    Milky Way
    Member #
    5923
    Join Date
    Feb 2012
    Posts
    7
    Ok, running into a problem...maybe someone can help me?

    I followed your directions to the T.

    Framework installed and decompiled...but when i try to then decompile launcher2.apk..

    it hangs on I:baksmaling

    Here is a picture of my issues... I even tried renaming the 1.4.2 and 1.4.3 jars back and forth before trying to decompile the Launcher2.apk

    smali.JPG

 

 
Page 2 of 5 FirstFirst 1234 ... LastLast

Remove Ads

Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

apktool
,
apktool compile
,
apktool windows jar
,

apktool.yml

,
apktool.yml not found
,

apktools

,
apktools.apk
,
arsc decompila
,
building adb framework-res pathnotexist apktool.yml
,
compile and recompile apk apktool
,
exception in thread main brut.androlib.androlibexception: brut.directory.pathnotexist: apktool.yml
,
how to decompile framework.jar
,
how to use apktool
,
pathnotexist apktool.yml
,
resources.arsc decompile
Click on a term to search for related topics.