HELP! How to decomplie (smali), edit and recompile .APK (OREO) - Android Q&A, Help & Troubleshooting

I'm trying to decompile a system .APK file for editing from a stock Oreo rom (for Galaxy S7 G930F, extracted from ROM using Kitchen).
The problem is when I try to decompile the APK, I do not get the Smali-files, but if I deodex the file I can properly see and edit the smali-files.
However, when I try to recompile it I get alot of errors. Even if I don't edit the files just decompile/recompile. (odex'd and deodex'd ones)
I've tried several softwares including ApkTool, Advanced APK Tool, Android MultiTool etc.
How can I do this right? Have I missed something?
Windows 10 x64
JRE & JDK installed
Framework-res.apk installed in software (odex for odex, and deodex for deodex)
Thanks in advance!

try batch apktool also install other special frameworks if there are any ( like mediatek-res.apk or cyanogenmod-res.apk)

Trex2017 said:
try batch apktool also install other special frameworks if there are any ( like mediatek-res.apk or cyanogenmod-res.apk)
Click to expand...
Click to collapse
Thanks, I will try it later tonight! Do you know specifically if/what frameworks needed for Galaxy roms? I've only read about "Framework-res.apk" so that's the one I've been trying with.

mrd0pe said:
Thanks, I will try it later tonight! Do you know specifically if/what frameworks needed for Galaxy roms? I've only read about "Framework-res.apk" so that's the one I've been trying with.
Click to expand...
Click to collapse
open framework folder and check , touchwiz modding topics , tuts can also be a good place to find help

Related

[Q] framework compile error

i have a problem to decompile an apk, it's the framework-miui-res.apk, when i try to decompile with apktool it give me a warning (W: Cant find 9patch chunk in file: "drawable-hdpi/popup_item_single_normal.9.png". Renaming it to *.png. ) anyways it decompile all the files and i can edit it, but whan i try to compile it's a completly mess, give me a lot of errors
i was googling it , and i found that the error is because there are two files with the same name in xml files, i try to replace it, rename it, using different tools and version of apktool, making "apktool if", but i just can't make it compile. any ideas?
Huncriter said:
i have a problem to decompile an apk, it's the framework-miui-res.apk, when i try to decompile with apktool it give me a warning (W: Cant find 9patch chunk in file: "drawable-hdpi/popup_item_single_normal.9.png". Renaming it to *.png. ) anyways it decompile all the files and i can edit it, but whan i try to compile it's a completly mess, give me a lot of errors
i was googling it , and i found that the error is because there are two files with the same name in xml files, i try to replace it, rename it, using different tools and version of apktool, making "apktool if", but i just can't make it compile. any ideas?
Click to expand...
Click to collapse
Your problem was stated on the decompile. The .9 issue will throw up errors on everything when it is the only thing wrong. Might want to ask on the MIUI site
already did that, but there's no answer
Huncriter said:
already did that, but there's no answer
Click to expand...
Click to collapse
Have you tried fixing the .9 png ?
yeap, it creates two files when decompile, one is 9.png but is trash(0kb) and the other is the .png file, i try to rename the png (with 9.png) delete the 9.png file but it didn't work.
also i decompile another framework-miui-res.apk from another rom(without error) , extrac the 9.png replace in my rom and still no work.
Huncriter said:
yeap, it creates two files when decompile, one is 9.png but is trash(0kb) and the other is the .png file, i try to rename the png (with 9.png) delete the 9.png file but it didn't work.
also i decompile another framework-miui-res.apk from another rom(without error) , extrac the 9.png replace in my rom and still no work.
Click to expand...
Click to collapse
Ok just renaming the png to a .9 will not work. .9 pngs are special made pngs with a special border system. Can you decompile and recompile the apk without the error?
zelendel said:
Ok just renaming the png to a .9 will not work. .9 pngs are special made pngs with a special border system. Can you decompile and recompile the apk without the error?
Click to expand...
Click to collapse
no, that's the problem, but i can decompile the framework-res-miui from another rom and extract the 9.png
can you try it? i let the framework at top
Huncriter said:
no, that's the problem, but i can decompile the framework-res-miui from another rom and extract the 9.png
can you try it? i let the framework at top
Click to expand...
Click to collapse
Sorry I don't touch anything from MIUI. There are a few threads around. Search for an MIUI themeing thread and they should be able to help you.
zelendel said:
Sorry I don't touch anything from MIUI. There are a few threads around. Search for an MIUI themeing thread and they should be able to help you.
Click to expand...
Click to collapse
, thanks, and no there's no thread with the solution for this, and i think the problem is not only in miui roms, and have other apps that i cant compile
i wonder if there is another way to compile wthout using apktool
Huncriter said:
, thanks, and no there's no thread with the solution for this, and i think the problem is not only in miui roms, and have other apps that i cant compile
i wonder if there is another way to compile wthout using apktool
Click to expand...
Click to collapse
The only two choices are using apktool or compiling it from the source code and making your changes and using apktool. What version of android is it for? ICS needs 2 versions. One to decompile and one to compile. I have themed every OS version I have used and with the right searching and some trial and error it has always worked. Including ics
it's based on android 2.3.7, and try that also(using 1.4.2 to decompile and 1.4.3 to compile)

[Q] apktool

Hey guys just wondering if you guys can point me in the right direction to a apktool that is working on the s3.
I've attempted to extract and set the framework.apk and decompile systemui.apk, which worked fine but when compiling the modded file I'm getting errors..
Wont compile with out any modifications either..
Any tips and comments will be appreciated... excuse my grammer as I'm writing this on my phone.
I managed to recompile framework-res.apk with apk tool however it boot looped so not convinced.
Do you have to decompile with dependencies with samsung frameworks?
Sent from my GT-I9300 using Tapatalk 2
rootSU said:
I managed to recompile framework-res.apk with apk tool however it boot looped so not convinced.
Do you have to decompile with dependencies with samsung frameworks?
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
I'm not sure to be honest... hopefully someone can clear this up for us !
https://docs.google.com/open?id=0Bx7xmGB4IFU7bHNSdUtaWjFTOVMtN1VjZnJBcUFWUQ
framework-res.apk won't compile with samsung based roms...i don't know why but in most cases it doesn't.
Make sure to press the thanks button.!!!!
Thanks for the tip, although not being able to recompile SystemUI.apk is a different issue all together..
Iv tried setting framework.apk & twframework-res.apk from the stock firmware which came with my phone.. attempted to compile.. fails.
Iv got a feeling this is going to be something silly..
EDIT: Something has come to mind, iv only ever been able to decompile systemUI for CM9 based roms.. forgot were working with stock Samsung.. last time I had this issue I hit a brick wall pretty much apktool couldnt decompile sammy systemUI .. this may have changed.
rohan999 said:
https://docs.google.com/open?id=0Bx7xmGB4IFU7bHNSdUtaWjFTOVMtN1VjZnJBcUFWUQ
framework-res.apk won't compile with samsung based roms...i don't know why but in most cases it doesn't.
Make sure to press the thanks button.!!!!
Click to expand...
Click to collapse
There was a way of doing it where there was one apktool.jar for decompile and another for recompile. It seemed to work for me but it was not successful.
I'll create my own thread.
I need some help on this too. APKTOOL is not taking if apktool framework-res.apk in CMD. Any ideas? I'm just trying to decompile SystemUI.apk, lol. It shouldn't be this hard.
I have a big problem.
When i use untouched original framework-res and systemui, i can decompile and compile but only when i made no changes.
when i got the framework-res and systemui from my checkrom to mod some xmls ican decompile. but i can not compile
I`ve a look to my pathes but there correct.
My phone SGS3 with checkromV4
AndroidGraphix said:
I need some help on this too. APKTOOL is not taking if apktool framework-res.apk in CMD. Any ideas? I'm just trying to decompile SystemUI.apk, lol. It shouldn't be this hard.
Click to expand...
Click to collapse
apktool work fine here!
i guess you should mount twframework-res.apk in apktool
Code:
apktool if twframework-res.apk
apktool if framework-res.apk
I've managed to compile both SystemUI and framework-res using APK manager for ICS.
Sometimes when you try to use a FW res or system ui from a custom or themed rom you will get errors because of the customizations they made to them. That's why a lot of time they will tell you to start with a stock fw or systemui.
For example, when I tried to recompile a themed FW res (JB domination) I got errors, when I used a stock "virgin" copy it was fine.

problem with Signing kitkat apk

Hello,I have problem with recompiling any system apk for kitkat firmware,tried to decompile and recompile framework-res as the usual way of any 4.3 firmware and lower,it does decompile and recompile successfully but when I replace it back instead of the original one I got it stuck at sprint screen for NOTE3 SPRINT .also when I try with SecSettings ,the settings icon disappear after replacing the original one,I even tried building the apk without any modification and I got the same thing.
there is must be something with signing kitkat apk different than 4.3 and lower firmware.
I used the same method of signing A System apk of taking META-INF and AndroidManifest.xml and inserting them into the new APK.
apktool version 1.5.3
phone:NOTE3 SPRINT N900P 4.4.2 STOCK FIRMWARE.
THANK YOU
motiam4 said:
Hello,I have problem with recompiling any system apk for kitkat firmware,tried to decompile and recompile framework-res as the usual way of any 4.3 firmware and lower,it does decompile and recompile successfully but when I replace it back instead of the original one I got it stuck at sprint screen for NOTE3 SPRINT .also when I try with SecSettings ,the settings icon disappear after replacing the original one,I even tried building the apk without any modification and I got the same thing.
there is must be something with signing kitkat apk different than 4.3 and lower firmware.
I used the same method of signing A System apk of taking META-INF and AndroidManifest.xml and inserting them into the new APK.
apktool version 1.5.3
phone:NOTE3 SPRINT N900P 4.4.2 STOCK FIRMWARE.
THANK YOU
Click to expand...
Click to collapse
you shoul install framework and systemui of kitkat and then compile and decompile it
Vaibhav Chauhan said:
you shoul install framework and systemui of kitkat and then compile and decompile it
Click to expand...
Click to collapse
thank you for your reply,but I have already tried that,I did install framework-res.apk and twframework-res.apk and SystemUI.apk
but it fails,tried this time with SecContacts_OSup.apk but it does disappear after replacing it too.
any idea?
motiam4 said:
thank you for your reply,but I have already tried that,I did install framework-res.apk and twframework-res.apk and SystemUI.apk
but it fails,tried this time with SecContacts_OSup.apk but it does disappear after replacing it too.
any idea?
Click to expand...
Click to collapse
which tool you are using??
Vaibhav Chauhan said:
which tool you are using??
Click to expand...
Click to collapse
APKTOOL Version 1.5.3
Ok.thank you.I tried to do it on linux and got it working.
thank you.
motiam4 said:
Ok.thank you.I tried to do it on linux and got it working.
thank you.
Click to expand...
Click to collapse
:good:

[Q] question : how to decompile and compile protected apk ?

hi
i have a program that i want to decompile and change something and then compile it
and i use 2 way
first i use apktool that decompile it but when i want compile it , it show errors ( even withot change nothing )
second i rename apk with zip and extract all and then without change nothing I compress extracted file and rename it to apk and sign it and then the program not work .
the program attached
i think it use some protection or ...
any one have an idea ?
thanks a lot
zeytunak said:
any one have an idea ?
Click to expand...
Click to collapse
Update your apktool...
XperienceD said:
Update your apktool...
Click to expand...
Click to collapse
hi
thanks for your reply
now i update my apktool but after compile decompiled package its not work
even after i use below swith when decompilation
apktool d -s -r b15.apk
you can chack the compiled apk and signed not work correctly .
Is that after doing your mods, just because it builds with no errors doesn't mean the mod hasn't broke something.
Also alot of apps are starting to add code that will break it if it is modded in anyway. Many paid apps are doing this to prevent pirating the app or getting some of the paid features for free. There is nothing you can really do if this is the case.

twframework-res.apk

Hi everybody
I've used apktool V2.0.3 for decompiling and compiling my
framework-res.apk
SystemUI.apk
SecSettings.apk
ClockPackage_Osup.apk
MultiWindowTrayService.apk
SecContacts_Phone_OSup.apk
SecMms_Candy.apk
SamsungMusic_20.apk
without any problem.
But now I want to make afew changes to "twframework-res.apk" and I'm getting a huge list of error while compiling this apk ( I posted the error log at end of the post)
I use twframework-res of two different rom but still getting the same error
I think it can not locate or read the Values folder when compiling because all those resource that Apktool claimed not there is actually there (all those value are present at "Colors" and "drawables" at "values" folder)
when I enter the hex color directly at "color" folder files, the error for colors at compiling disappeared but there are too much error at drawable for fixing manually
when I remove (( forced-package-id: '2' )) line from the "apktool.yml" file, apk compile ok with just a few error in "Style" but when I use this compiled apk on my phone it won't boot
does anybody have any idea how I can fix this issue because I really need to modify this apk file
My phone is Samsung Galaxy Note 3 SM-N900 on Lollipop 5.0 (Deodexed Rom)
Log.txt:
http://s000.tinyupload.com/download.php?file_id=22857363641838387918&t=2285736364183838791824181
Go here....http://forum.xda-developers.com/showthread.php?t=1633333
I cant remember exactly, but you decompile with one apktool.jar and compile with a different one. There are like 5 different apktool.jar.
Try searching that thread.
The Sickness said:
Go here....http://forum.xda-developers.com/showthread.php?t=1633333
I cant remember exactly, but you decompile with one apktool.jar and compile with a different one. There are like 5 different apktool.jar.
Try searching that thread.
Click to expand...
Click to collapse
Thanks alot
It really worked
Thank you so much for your help
I use Apktool V2.0.3 for decompile the apk and Apktool V2.0.0rc2 for compile it
again thank you:good::good::good::good:
badboy_6120 said:
Thanks alot
It really worked
Thank you so much for your help
I use Apktool V2.0.3 for decompile the apk and Apktool V2.0.0rc2 for compile it
again thank you:good::good::good::good:
Click to expand...
Click to collapse
what framework did you use I can decompile it with 2.1.1 only but wont recompile with Apktool V2.0.0rc2 or any other one I have tried

Categories

Resources