What is the best way to decompile and recompile the Email.apk properly?
When I recompile it without changing anything, it is giving me some errors when I open the app up.
Mysteriouskk said:
What is the best way to decompile and recompile the Email.apk properly?
When I recompile it without changing anything, it is giving me some errors when I open the app up.
Click to expand...
Click to collapse
We need to know the errors if you would like us to help
Sent from my SGH-M919 using Tapatalk 2
Usually, when having issues doing an unmodified decompile/recompile, the issue comes from apktool, or filesystem issues. [cough]*NTFS*[/cough] My suggestion would be to use baksmali/smali to decompile/recompile. If it still doesn't work you should try doing the same on a Linux box or VM. The .smali naming scheme often does squirly things with non-case sensitive filesystems.
Sent from my GT-I9505G
first copy framework-res.apk to C:\Users\You\apktool and call it 1.apk
Then do:
apktool d Email.apk
make changes
apktool b Email Email2.apk
open Email.apk and Email2.apk, now drag everything except AndroidManifest.xml from Email2.apk to Email.apk, when it's merged it's ready to use
Mysteriouskk said:
What is the best way to decompile and recompile the Email.apk properly?
When I recompile it without changing anything, it is giving me some errors when I open the app up.
Click to expand...
Click to collapse
There is some issue with resources in that apk. Use apktool -r to bypass resources or just use backsmali/smali on .dex instead.
You can also try the newest beta of apktool, but you'll have to build it yourself on a linux box (doesn't build on windows yet).
Change sdk to 16 for email
Sent from my XT912 using xda app-developers app
Related
I decompiled an apk and made some changes to the xml files in it but I'm having issues compiling it again. I've used apktool and apk manager to try to do it and I get what looks like an apk but I can't get it to show up when I push it to my emulator. Am I missing something here? Any help would be appreciated, I'm new to android programming.
You're pushing it to /system/app/ I assume?
illogic6 said:
You're pushing it to /system/app/ I assume?
Click to expand...
Click to collapse
You assume correctly. I just don't think the apk is being compiled correctly. I see it in the /system/app folder on the emulator but that's as close as it gets for me.
Don't make it harder than it has to be, forget signing the apk and using that method. Simply open the apk your editing with winrar highlight the res folder, press delete, then copy over the res folder with the edited xmls. Hit okay, and push to /system/app, that's what i do. The other method is just to complicated and time consuming.
Sent from my SPH-D700 using XDA App
bubby323 said:
Don't make it harder than it has to be, forget signing the apk and using that method. Simply open the apk your editing with winrar highlight the res folder, press delete, then copy over the res folder with the edited xmls. Hit okay, and push to /system/app, that's what i do. The other method is just to complicated and time consuming.
Sent from my SPH-D700 using XDA App
Click to expand...
Click to collapse
Ill give that a try when I get home. It has been time consuming... thanks bubby, I love your rom
Ok, I tried bubby's method, and it show up now in the emulator but I'm getting FC. I was wondering if not transferring the xml back to binary could be the cause? I've seen lots of articles on how to translate the binary xml to human-readable xml but I can't find anything on transferring it back to binary.
Could someone help walk me through this? I've decompiled/recompiled plenty of apks, however the framework-res.apk is being relatively stubborn. After recompiling the apk I get force closes in random areas of settings, etc.
I use apktool (as I need to edit an xml file's value), to decode, then build.
Are there any random steps I'm missing?
I've tried this over and over to get the same results everytime.
Someone said it is because of corrupted xml, and if so how do I prevent the problem from happening?
Anyway, thanks in advance.
Check out the theme guides in epic themes and apps forum, grab apk manager, the op says to decompile and recompile without making any changes as some apks can just be problematic and error. But you should be able to edit xmls (no pngs! Drag and drop after!) And recompile with no prob, use like notepad++ as windows notepad adds junk characters tat cause issues too.
Sent from my SPH-D700 using Tapatalk
I have been trying all night to compile SystemUI.apk
Does anyone have a quick link to a guide that they used to de/compile SystemUI.apk so i can change some smali and some .xmls??
all the guides ive found have not solved my compiling issues.
Download apktool and set it up correctly make sure the latest java is installed along with the most recent jdk. You have to load the framework usually before you edit a system apk, and remember system.apk's don't need to be signed. Sometimes it is necessary to load a secondary framework-res most likely for tw roms/firmware
apktool if framework-res.apk
apktool d SystemUI.apk
Leave window open
apktool b SystemUI blahblahblah.apk
After it's done
Drag meta-inf and androidmanifest.xml from old apk to new one, zip align and rename blahblahblah.apk to specific apk and voila push to system/app set permissions rw-r-r or chmod 644 reboot wipe cache and dalkvik fix permissions and you're ready to rock and roll
There is a thread on xda by ibotpeaches concerning apktool I would take a long hard look at it before you get into this stuff. Wouldn't want you messing anything up getting your phone stuck in a boot loop.
USMC0341 said:
Download apktool and set it up correctly make sure the latest java is installed along with the most recent jdk. You have to load the framework usually before you edit a system apk, and remember system.apk's don't need to be signed. Sometimes it is necessary to load a secondary framework-res most likely for tw roms/firmware
apktool if framework-res.apk
apktool d SystemUI.apk
Leave window open
apktool b SystemUI blahblahblah.apk
After it's done
Drag meta-inf and androidmanifest.xml from old apk to new one, zip align and rename blahblahblah.apk to specific apk and voila push to system/app set permissions rw-r-r or chmod 644 reboot wipe cache and dalkvik fix permissions and you're ready to rock and roll
There is a thread on xda by ibotpeaches concerning apktool I would take a long hard look at it before you get into this stuff. Wouldn't want you messing anything up getting your phone stuck in a boot loop.
Click to expand...
Click to collapse
I already know about installing the framework, and i installed both twframework-res.apk and framework-res.apk. i also installed SystemUI.apk as per several posts. I already read through ibotpeaches' post, that is where i got apktool afterall = ). in still running into compiling errors however.
Any ideas?
As implied, I have decompiled no problem, its compiling im running into issues with.
Nv1dia said:
I have been trying all night to compile SystemUI.apk
Does anyone have a quick link to a guide that they used to de/compile SystemUI.apk so i can change some smali and some .xmls??
all the guides ive found have not solved my compiling issues.
Click to expand...
Click to collapse
Here you go man he tells you exactly how to do it its not that hardhttp://forum.xda-developers.com/showthread.php?t=2279024
Sent from my GT-I9505 using xda premium
jthrasher47 said:
Here you go man he tells you exactly how to do it its not that hardhttp://forum.xda-developers.com/showthread.php?t=2279024
Sent from my GT-I9505 using xda premium
Click to expand...
Click to collapse
I am afraid this is not the answer as my errors look nothing like that. I remember reading a while back when i themed for the GS3 that i needed to move files out of apk before decompiling, i can't seem to find this page again however..... in any case thank you both for the help, i will just have to continue looking.
Nv1dia said:
I am afraid this is not the answer as my errors look nothing like that. I remember reading a while back when i themed for the GS3 that i needed to move files out of apk before decompiling, i can't seem to find this page again however..... in any case thank you both for the help, i will just have to continue looking.
Click to expand...
Click to collapse
Why haven't you posted the log so the compile error can be seen. How can you expect help without giving all the vital information?
Sent from my SAMSUNG-SGH-I337 using Tapatalk 4 Beta
Nv1dia said:
I am afraid this is not the answer as my errors look nothing like that. I remember reading a while back when i themed for the GS3 that i needed to move files out of apk before decompiling, i can't seem to find this page again however..... in any case thank you both for the help, i will just have to continue looking.
Click to expand...
Click to collapse
That link is showing the framework-res.apk error. Your getting "style" errors correct? You need to modify 2 XMLs from the res/layout folder. And cause I'm a nice guy I'll link you to my DB that has the modified ones and originals. PM me and I'll share my DB folder with you. Its very easy. The aapt for apktool needs updating but we Ave to resort to workarounds for the time being. Same thing for framework-res.apk and others. We'll get ya straightened out!
Sent from my SPH-L720 using Tapatalk 2
reverepats said:
That link is showing the framework-res.apk error. Your getting "style" errors correct? You need to modify 2 XMLs from the res/layout folder. And cause I'm a nice guy I'll link you to my DB that has the modified ones and originals. PM me and I'll share my DB folder with you. Its very easy. The aapt for apktool needs updating but we Ave to resort to workarounds for the time being. Same thing for framework-res.apk and others. We'll get ya straightened out!
Sent from my SPH-L720 using Tapatalk 2
Click to expand...
Click to collapse
I have resolved the issue.. Thanks for the help though! Turns out a simple reboot of my computer was all i needed. I wasnt getting a styel error. It was a simple Java error is all. Thank you everyone for all your help!
Hey I was wondering and have been looking for a while how to put the source all back together from the .dex file. I extracted all the .Java files and want to turn it into classes.dex again. So any one can possible help me out?
Thanks in advanced!
cole59z said:
Hey I was wondering and have been looking for a while how to put the source all back together from the .dex file. I extracted all the .Java files and want to turn it into classes.dex again. So any one can possible help me out?
Thanks in advanced!
Click to expand...
Click to collapse
I'm not sure this is a good place to talk reverse-engineering, but well...
Decompiling an apk to Java is usually a very destructive process, even more if the apk was ProGuarded.
This means that unless you manage to fix all the compile issues generated by the decompilation process, you won't be able to pack it back together into a working app (and believe me, you won't).
This is why people bother with smali code, smali/baksmali is the only way to modify an apk and recompile it, afaik.
Either way, this should be done for educational purposes only.
People usually don't use assembly for fun if they could use Java instead^^
I'm not even sure if I don't prefer the BrainF*ck language to smali.
That's the whole point of guarding your source code so no one steals your app. It's very easy to load just about anything into the play store by just changing the package name through all the files. Normally apktool is used to hack smali for system apps or free apps like Facebook to theme them.
Hopefully your asking for educational purposes.
Sent from my HTCONE using XDA Premium 4 mobile app
I was trying to translate a chinese opera browser. So I decompiled the apk with apktool. To test if it works, I edited app_name_title in /res/values/strings.xml. Then recompiled and signed it. After installing, it worked because it's app name was changed according to the translation but when i launch the app it force close after showing the Opera logo. What can i do now ?
madboy777 said:
I was trying to translate a chinese opera browser. So I decompiled the apk, edited /res/values/strings.xml. Then recompiled and signed it. After installing, when i launch the app it force close after showing the Opera logo. What can i do now ?
Click to expand...
Click to collapse
logcat it then you read the logs and find out what is causing the force close
marcussmith2626 said:
logcat it then you read the logs and find out what is causing the force close
Click to expand...
Click to collapse
Yes, I tried "logcat -v long" and "logcat /E" but can't figure out the problem. Actually I don't understand it fully. What i saw is that when i launch the app two shared lib files are loaded and nothing else.
madboy777 said:
Yes, I tried "logcat -v long" and "logcat /E" but can't figure out the problem. Actually I don't understand it fully. What i saw is that when i launch the app two shared lib files are loaded and nothing else.
Click to expand...
Click to collapse
did the app work before you edited it?
it may be that the name you changed is referenced in different locations
other than that cant really help you
marcussmith2626 said:
did the app work before you edited it?
it may be that the name you changed is referenced in different locations
other than that cant really help you
Click to expand...
Click to collapse
No i changed the chinese name that appeared on the launcher. OK I will edit something other than this tomorrow. Thank you very much.
marcussmith2626 said:
did the app work before you edited it?
it may be that the name you changed is referenced in different locations
other than that cant really help you
Click to expand...
Click to collapse
I just decompiled and compiled without editing. The app doesn't work. So apktool is the real problem. That app worked before i decompiled and recompiled.
What can i do now ???
madboy777 said:
I just decompiled and compiled without editing. The app doesn't work. So apktool is the real problem. That app worked before i decompiled and recompiled.
What can i do now ???
Click to expand...
Click to collapse
make sure you are using the correct framework-res to decompile and recompile
most 3rd party apps use jb framework
you may also need to resign the apk
marcussmith2626 said:
make sure you are using the correct framework-res to decompile and recompile
most 3rd party apps use jb framework
you may also need to resign the apk
Click to expand...
Click to collapse
Where can i download jb framework ? I signed the apk and it installed so signing might not be any problem.
madboy777 said:
Where can i download jb framework ? I signed the apk and it installed so signing might not be any problem.
Click to expand...
Click to collapse
here you go
http://d-h.st/zAg
marcussmith2626 said:
here you go
http://d-h.st/zAg
Click to expand...
Click to collapse
Thank you very much... Gonna try ASAP...
marcussmith2626 said:
here you go
http://d-h.st/zAg
Click to expand...
Click to collapse
apktool shows this error while installing framework-res.apk ...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode ars
c file
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:54)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:40)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:611)
at brut.androlib.Androlib.installFramework(Androlib.java:469)
at brut.apktool.Main.cmdInstallFramework(Main.java:253)
at brut.apktool.Main.main(Main.java:81)
Caused by: java.io.IOException: Expected: 0x00000008, got: 0x00000000
at brut.util.ExtDataInput.skipCheckShort(ExtDataInput.java:56)
at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:219)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:179)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:167
)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:133)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:10
8)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:81)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
... 5 more
Press any key to continue . . .
madboy777 said:
apktool shows this error while installing framework-res.apk ...
Click to expand...
Click to collapse
either the file didnt upload properly or it didnt download properly or theres a problem with your apktool cause it works fine on mine using apktool if framework-res.apk
i'll download my upload and check
edit
iv checked my uploaded and that framework installs fine on my apktool
either it didnt download properly on your computer or theres a propblem with your apktool
I suggest downloading the file again and make sure you have the java developent tools JDK installed
marcussmith2626 said:
either the file didnt upload properly or it didnt download properly or theres a problem with your apktool cause it works fine on mine using apktool if framework-res.apk
i'll download my upload and check
edit
iv checked my uploaded and that framework installs fine on my apktool
either it didnt download properly on your computer or theres a propblem with your apktool
I suggest downloading the file again and make sure you have the java developent tools JDK installed
Click to expand...
Click to collapse
ok, md5 cheaksum of framework-res.apk matches with dev host. I have java(JDK) installed. downloading apktool_2.jar...
marcussmith2626 said:
either the file didnt upload properly or it didnt download properly or theres a problem with your apktool cause it works fine on mine using apktool if framework-res.apk
i'll download my upload and check
edit
iv checked my uploaded and that framework installs fine on my apktool
either it didnt download properly on your computer or theres a propblem with your apktool
I suggest downloading the file again and make sure you have the java developent tools JDK installed
Click to expand...
Click to collapse
downloaded apktool 2 beta 9 and it accepts your framework-res.apk but still no luck. That app still force closes. Is it possible that a 3rd party app can not be modified with apktool and if you do it will not work ?
madboy777 said:
downloaded apktool 2 beta 9 and it accepts your framework-res.apk but still no luck. That app still force closes. Is it possible that a 3rd party app can not be modified with apktool and if you do it will not work ?
Click to expand...
Click to collapse
cant really answer that as im not doing the modding but you should be able to mod anything
im guessing your apktool was out of date and couldnt accept jb firmware