Hi, okay guys, i wanna ask something. I was able to decompile, recompile, sign apk (using 7-zip) last year. Then, somethings happened to my laptop. I have to install a new windows 8.
All i have done is :
1) Installing JRE 7u45 64 bit and JDK 7u40 64 bit
2) Pulling SemcGenericUxpRes.apk, installing it by typing on the command "apktool if SemcGenericUxpRes.apk"
3) Pulling framework-res.apk, installing it by typing on the command "apktool if framework-res.apk"
4) Decompiling some app. After that, i typed on the command "apktool b XXX" where XXX refers to the decompiled folder
5) Drag and Drop the META-INF folder from the original to the new one
6) Pushing to my Xperia Miro. But the app doesnt show up on the launcher
7) When i recompile SystemUI.apk, signing it, then pushing it to system/app, setting the permissions, then using Restart SystemUI app, its worked. But after i restarted my phone, my SystemUI is gone
Does anybody here have the same problem with me?
Here is my Specification of my laptop :
Acer Aspire E1 -471G
Windows 8 64 bit version
JRE and JDK installed as ive told you above
Apktool, tried from version 1.5.1PR2 until 1.5.2 version
7-zip version 9.20 64 bit version
Winrar version 5.00 64 bit version
The last time i was able to recompile and use the modified apk was one year ago. The specification is same like above. Help me, please! :crying:
Did you sign your new apk?
PulseDroid said:
Did you sign your new apk?
Click to expand...
Click to collapse
Hi, thanks for your reply. Okay, in this post : http://forum.xda-developers.com/showthread.php?t=2011325 its showed me to copy the META-INF folder. And ive already copy that folder. Its failed to install in my phone. I tried using Adb Install xx.apk but shows me this :
"Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]"
And when i push it manually to /data/app/ or /system/app/ it doesnt showed up to my launcher.
Ive tried to zipalign it, but still error. So, what is wrong with my phone?
What certificate did you use in Zipalign?
Certificate from the original apk. Drag and Drop the META-INF folder using 7-zip
Skip the META-INF copy step.
Rather use this
Okay, ive downloaded the application.
So, ive just decompiled the SystemUI.apk. Which one should i select? Thanks for your help
Related
Im not trying to re-engineer an app, but I simply want to check out an apk to look at the placement of a certain line of code. When i open up the files within the apk though, i get a bunch of nonsense. How do I edit the files within the apk...i know theres a way, or else we wouldnt have custom roms.
Apktool (or some wrapper like Apk Manager). It's quite outdated, so you won't be able to decode some newer apks though.
Brut.all said:
Apktool (or some wrapper like Apk Manager). It's quite outdated, so you won't be able to decode some newer apks though.
Click to expand...
Click to collapse
gahh, i was hoping there would be an easier way than that xP...I experimented with apktool, but it wasnt recognizing the .apk i was typing in...i just suck with command prompt stuff
....thanks anyway though
schwartzman93 said:
gahh, i was hoping there would be an easier way than that xP...I experimented with apktool, but it wasnt recognizing the .apk i was typing in...i just suck with command prompt stuff
Click to expand...
Click to collapse
Brut.all also mentioned APK Manager in his post which is a script wrapper for his apktool that automates much of the process. It's available at the link I gave for both Windows and Linux. All you should need to do is run the script, place your apk in the appropriate folder created by the script, have the script decompile your apk, then you can find the decoded xml file(s) of interest.
thanks guys
i was having a bit of trouble with apk mananger, i couldnt get it to do anything with this one app, i would tell it an action and it just closed the script
EDIT: I figured it out
Hi guys, i'm using APK Manager and i was able to change the xml without having any trouble by decompressing the apk. I'm wondering what i need to do in order to resign the APK. I have already tried to compress the apk and then sign it, but streight away after I installed the apk i got in boot looping.
The file i'm talking about is the framework-res.apk
Any suggestion?
Thanks in advance.
Edit/
Solved.
Basically i was trying to sign framework-res.apk, instead i have found the solution in this forum that actually worked fine for me:
Code:
1. Place your original "framework-res.apk" into "\place-apk-here-for-modding\" folder
2. Run "script.bat"
3. Set Project (22) and choose the "framework-res.apk" (1)
4. Decompile (9)
5. Place or overwrite new Xmls and PNGs in "\projects\framework-res.apk\res\drawable or drawable-hdpi"
5. Recompile (11)
6. Answer "Yes" when it asks wheter it is system file
7. Answer "Yes" when it asks "would you like to copy over any additional files...?"
8. Script is paused => (don't press a key)
9. Go to the "keep" folder (it's in the same folder than "script.bat")
10. In this "Keep" Folder,
- delete "resources.arsc" file
- delete originals "stat_sys_battery.xml" and "stat_sys_battery_charge.xml" from the "keep\res\drawable" folder
- delete all originals PNGs that were meant to be edited
11. Go back to "script.bat" and press a key to let him finish the job
12. Your new "framework-res.apk" has been created in the "\place-apk-here-for-modding\" folder. It's called "unsignedframework-res.apk".. but he's not working yet.
13. Unzip all the content of the "unsignedframework-res.apk". You should have 5 objects (3 folders, 2 files).
14. Zip these files with Winrar/Winzip (whatever) but you must choose "No compression" method to zip it.
15. Rename this zip into "framework-res.apk".
15. Put it into an update.zip and it should be OK to flash trough the recovery mode.
Thanks anyway!
Hi guys. Phone is Samsung Galaxy Ace, rooted, Android 2.3.6
1. Pulled and decompiled the system app SystemUI.apk
2. Edited \res\layout\statusbar.xml by adding a line which is supposed to change the color of the status bar clock
3. Might have added a few line spaces after the line so that I can find it easily next time I want to change the color.
4. Recompiled and named the apk as SystemUI-new.apk
5. Opened SystemUI.apk & SystemUI-new.apk using 7zip. Copied the edited statusbar.xml from SystemUI-new.apk to SystemUI.apk
6. Pushed SystemUI.apk (which now has the edited statusbar.xml) back into the phone.
7. Whole status bar disappears!!!
What did I do wrong?
Thanks guys!
You should also copy the resources.arcs or something like that that's in the modded app.
Hey dxppxd, sorry to bother you again. I removed the sdk program from my laptop and uninstalled java because I wanted to start from scratch again.
I have re-installed java, these are now in my laptop:
Java SE Development Kit 7 Update 4 (64-bit)
Java(TM) 7 Update 4 (64-bit)
JavaFX 2.1.0 SDK (64-bit)
JavaFX 2.1.0 (64-bit)
I have also reinstalled android sdk and adb, and have managed to pull framework-res.apk from my galaxy ace.
My problem is when I type:
apktool if framework-res.apk
C:\android-sdk-windows\platform-tools>apktool if framework-res.apk
'java' is not recognized as an internal or external command,
operable program or batch file.
Can you help please? I was able to execute that command last time without error
Thank you.
I'm sorry I can't be of much help in this case. Seems there is a component missing from the Java runtime environment. Also, t ry reinstalling apktool directly by coping the .jar, .bat and other files to your windows folder.
Other than that Google is your best friend.
I'm getting this issue:
I got Settings.apk and framework.apk from a rom, then i opened apktool and
1) imported fw: apktool if framework.apk
2) decompiled apk: apktool d Settings.apk
3)edited a string in a xml
4) rebuilt all: apktool b Settings Settings.apk
5)pushed it into system/app
6) fix permissions and reboot.
Settings now should work, but it doesnt. Can somebody tell me where i do a mistake?
Thank you
(I used win8, but i could use macos or ubuntu as well)
sign it first
ej8989 said:
sign it first
Click to expand...
Click to collapse
I did it. same result. maybe the application I used is not good (Auto-Sign v0.65). what application i've to use?
I didnt write it before, however the rom is on 4.2.1 (cyanogen 10.1)
put your re-complied apk to your phone's sd card and use zipsigner2 from playstore to sign it.
ej8989 said:
put your re-complied apk to your phone's sd card and use zipsigner2 from playstore to sign it.
Click to expand...
Click to collapse
Nothing. Maybe this is not good for 4.2.1? (I've used it lots of times with 4.1)
Well, apktool is using smali/baksmali to compile/decompile classes.dex/apk_name.odex file.
The problem can occur when you use different baksmali version when you decompile and also not the right version to compile (as the system expects it to be). You can also experience issues if the apk is not zipaligned properly (check down who to do that)
apktool has the smali/baksmali code inside it so you will need to get the newest version for it for JB for example.
You can check why the status bar is not there when you monitor the logcat and look for DEX related logs in the beginning.
You can also use smali/baksmali on your own: http://code.google.com/p/smali/wiki/DeodexInstructions
and just place the generated classes.dex in the apk
then zipalign -f 4 filein.apk fileout.apk (http://developer.android.com/tools/help/zipalign.html)
then push back fileout.apk (sytemui.apk in your case)
Sent from my Galaxy Nexus using xda premium
HI!
I have a problem with an apk i am trying to edit. So i have an apk that i changed from .apk to .zip and then opened it with WINRAR to replace original PNGs with new PNGs becouse i didnt like them haha (i kept the same name). then i changed extension back from .zip to .apk and when i tried to install it on my phone (Xperia Miro ICS) it gave me an error. Please help me, what can I do? :good:
jaka_music said:
HI!
I have a problem with an apk i am trying to edit. So i have an apk that i changed from .apk to .zip and then opened it with WINRAR to replace original PNGs with new PNGs becouse i didnt like them haha (i kept the same name). then i changed extension back from .zip to .apk and when i tried to install it on my phone (Xperia Miro ICS) it gave me an error. Please help me, what can I do? :good:
Click to expand...
Click to collapse
except system apk, you must sign it. Using apk editor is easier if you only change .png.
[email protected] said:
except system apk, you must sign it. Using apk editor is easier if you only change .png.
Click to expand...
Click to collapse
Thanks, but how do I sign it?
jaka_music said:
Thanks, but how do I sign it?
Click to expand...
Click to collapse
just gogling guys, or find here in xda. Many tools for that: apkmanager, apktool etc (via pc) or apkeditor, ninjamorph etc (via device)
How to sign apks
How to sign an apk file & make a flashable zip without PC
pySignare - Quickly Sign APKs (Windows)
Signing and zipaligning your app (Using eclipse or android studio)
Found it
Netherlander said:
How to sign an apk file & make a flashable zip without PC
pySignare - Quickly Sign APKs (Windows)
Signing and zipaligning your app (Using eclipse or android studio)
Click to expand...
Click to collapse
Thank you but i found very easy way to sign it. Heres how:
Instruction :
1) Download Attached "SignApk.rar"
2) Unrar "SignApk.rar" to any folder
3) Copy your apk to be signed to SignApk dir
4) Open command Prompt and go to SignApk dir
5) Type the following command:
java -jar signapk.jar certificate.pem key.pk8 your-app.apk name-off-signed-app.apk
or
signapk.jar certificate.pem key.pk8 your-app.apk name-of-signed-app.apk
I'm trying to get into modding apps. I first wanted to decompile/recompile an unmodded app just to make sure it would work in the end.
I downloaded apktool (2.0RC4) with the JAR and BAT wrapper (on Windows 7) and got it working properly.
I pulled the /system/framework framework-res.apk from my device
I ran the following commands without any sign of error
Code:
//install framework
apktool if framework-res.apk
//decompile to \app folder
apktool d app.apk
//recompile \app folder
apktool b app
Now I went in and took the app.apk in dist folder and ran on my phone. It errored that the APK wasn't structured correctly, or something.
So I opened up both my original APK and my new APK in WinRar and copies over resources.arsc, the META-INF folder and AndroidManifest.xml.
Side question: This is supposedly supposed to re-sign the apk. I understand how this MIGHT work here since it's unmodified, but generally speaking it makes no sense if you could copy the signature to something else and say it's signed. I imagine the internal validation would fail? Should I be re-signing it myself? As long as it runs on the phone I don't care who people think it came from.
Anyway, after I copy the new APK to my phone and run it, it installs for a while then throws up "App Not Installed" with the DONE button.
I tried using APKSigner to put a bogus signature on there to see if that helped, and it did. I managed to install the APK but when it boots up it becomes unresponsive almost immediately.
How can I decompile/recompile an apk and then run it without any modifications?
Thanks in advance!
Debug Mode
After checking catlog I noticed the app tried to re-orient and broke shortly after, so after rebooting my APK it ran. I just had some bad luck.
However now that I can re-compile the application, I am trying to re-compile it in debug mode so I can step through it and find where I want to be. I have done this tutorial:
<Was unable to post link, it is entitled HowTo: Debug Android APKs with Eclipse and DDMS on blog.dornes.nu>
The steps are:
//this decompiles in debug mode
apktool d -d app.apk -o source
I then manually edited the AndroidManifest.xml and added android:debuggable='true' to the 'application' tag
//rebuild in debug
apktool b -d source app.debug.apk
Then I signed the APK using ZipSigner
Installed APK successfully
Went to developer options and used select debug app
(The Wait for Debug to Start option does keep the app from running, but when I turn it off the app boots and crashes)
So now that it is recompiled in debug, it crashes, and I've tried it many times.
I will see if I can complete the rest of the tutorial next time I'm in front of a PC, maybe with it connected to the debugger I can step through. Any reason why an app decompiled and recompiled into debug would crash?
Thanks!