[Q] Help with custom .apk - General Questions and Answers

So, I extracted my Tweetdeck .apk and edited the .9 inside for the widget; I recompiled (AKA renamed the .zip back to .apk) and now the application won't install. "Application Not Installed" it says, after saying "Installing...". Anybody know how to fix this? I didn't edit anything but that .9.png....

obsidianchao said:
So, I extracted my Tweetdeck .apk and edited the .9 inside for the widget; I recompiled (AKA renamed the .zip back to .apk) and now the application won't install. "Application Not Installed" it says, after saying "Installing...". Anybody know how to fix this? I didn't edit anything but that .9.png....
Click to expand...
Click to collapse
if you edit a market app (or any nonsystem app) you have to resign the apk...if you use apkmanager put the app in "place here for signing" and then hit option 16 (in windows version anyway)

Alright, so, the file I edited is in res/drawable-hdpi . It's the widget_bg.9.png. I install the app (it worked great, thanks!), but... the bar widget looks no different.
I've been trying to do this for TWO HOURS... what did I do wrong, man?

Sorry for double post, but here's my CURRENT error log:
java.io.FileNotFoundException: ..\place-apk-here-for-modding\unsignedunsignedcom.thedeck.android.app-2.apk (The system cannot find the file specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at com.android.signapk.SignApk.main(SignApk.java:437)
Could Not Find C:\Users\Owner\Desktop\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedunsignedcom.thedeck.android.app-2.apk
When trying to sign with apkmanager. Well, I checked, and that file is in both the "place for modding" and in the "place for signing" folders.

Related

Easiest Way to Resign an .apk

All I want to do is open up a few .apk's and change the notification bar icons to look better on a black bar. I've accomplished this so far, but I keep getting errors after I zip them back to .apk's and try to install. After some research it seems I need to sign them. What is the easiest way to do this?
Much Thanks.
7zip
download 7zip, then you can open the .apk in archive drop in the icons and wont have to resign.
Emul8or said:
download 7zip, then you can open the .apk in archive drop in the icons and wont have to resign.
Click to expand...
Click to collapse
I have 7zip already, is there a certain way to open it in archive, or is it just the regular way. Just now I opened it in 7zip, dropped my new files into it, and then zipped it up again. Then on my phone I changed the extension from zip to apk, and I got the same parsing errror as usual.
Emul8or said:
download 7zip, then you can open the .apk in archive drop in the icons and wont have to resign.
Click to expand...
Click to collapse
That's stupid. If you change ANYTHING inside an APK, you have to resign. The signing method is the following for a new, freshly created apk:
- List all files into /META-INF/MANIFEST.MF, with their SHA1-digest checksum
- Place the public key to this folder too (to be used for verification)
- For all files, 'sign' their SHA1-digest with the private key-certificate and store it under /META-INF/CERT.SF
And when you install an app, it will check.
First, the SHA1-digest does not match the one in MANIFEST.MF. It get's overwritten temporarily, but when the system checks this DIGEST against the signed digest, it will fail and drop you back -> APK is useless.
Use testsign.jar to sign your files, google it, and you will find many tutorials!
Basic usage (command line):
java -classpath testsign.jar testsign [inputfile.apk] [*OPTIONAL*outputfile.apk]
If no outputfile is specified, output will overwrite input file!
So I guess the answer is there is no easy way to do this...
Man, I just told you the easy way...
Grab the testsign.jar, place it next to edited APK, and type what I wrote, and you are done! APK signed!
Or, you can use APK Manager, what has a built in signing tool
fonix232 said:
Man, I just told you the easy way...
Grab the testsign.jar, place it next to edited APK, and type what I wrote, and you are done! APK signed!
Or, you can use APK Manager, what has a built in signing tool
Click to expand...
Click to collapse
One more question. I have found two places that have a Google Voice apk. There is one in data/app and also in system/app. Which one should I edit? Then when I am done (if I can get it signed) do I need to put it back in the right spot, or can I just install it like a regular apk?
Turns out a really easy way to do this is with Ninja Morph.
easiest way to sign an apk is to download zipsigner from the market (free app)
Easy way
Before you say a method is stupid, try it first. I've modded my framework-res.apk many times with this method. Copy drawable-hdpi from your .apk and edit the .png's, then right click on the .apk and select 7zip>open archive and drop in the modded drawable-hdpi. Done, no need to resign.
fonix232 said:
That's stupid. If you change ANYTHING inside an APK, you have to resign. The signing method is the following for a new, freshly created apk:
- List all files into /META-INF/MANIFEST.MF, with their SHA1-digest checksum
- Place the public key to this folder too (to be used for verification)
- For all files, 'sign' their SHA1-digest with the private key-certificate and store it under /META-INF/CERT.SF
And when you install an app, it will check.
First, the SHA1-digest does not match the one in MANIFEST.MF. It get's overwritten temporarily, but when the system checks this DIGEST against the signed digest, it will fail and drop you back -> APK is useless.
Use testsign.jar to sign your files, google it, and you will find many tutorials!
Basic usage (command line):
java -classpath testsign.jar testsign [inputfile.apk] [*OPTIONAL*outputfile.apk]
If no outputfile is specified, output will overwrite input file!
Click to expand...
Click to collapse
Stericson made a batch file to sign easily (here) if you don't like the 7zip method
Another way is by using themes (morphs) with ZipThemer. Here's an example. ZipThemer signs patched files and then packages them in a signed update zip file that you flash to apply the changes.
Ken
I have a batch file that is invoked by right clicking on an apk and choosing "open with->sign apk", a new signed apk is created with "-signed.apk" appended to the name.
Initial setup takes a few minutes but later on signing takes < 3 seconds
note: /system apks dont need to be resigned.
attached, needs java.
To associate it with apk files right click on an apk, choose open with, browse and select "sign apk.bat", uncheck "make this the default action"

Anyone managed to change style.xml and recompile/add resources.arsc

Tried everything I can find and no luck with this with Sony framwork-res.apk doing my head in, My new resources.arsc is alwyas about 200kb smaller aswell after recompiling, furthest ive got is bootanimation then restart lol. Anyone had any luck with it? All i need to change is 1 bloody line in style.xml to change bottom popup menu to black, driving me mad lol
go3asy said:
Tried everything I can find and no luck with this with Sony framwork-res.apk doing my head in, My new resources.arsc is alwyas about 200kb smaller aswell after recompiling, furthest ive got is bootanimation then restart lol. Anyone had any luck with it? All i need to change is 1 bloody line in style.xml to change bottom popup menu to black, driving me mad lol
Click to expand...
Click to collapse
Have you followed this guide to the letter?
I changed the progressbar_horizontal.xml in my framework using this guide and it worked!
yeah , changed that worked fine but the style.xml file isnt viewable unless you decompile the apk then when you recompile the folder value with style.xml is compiled into the above file resources.arsc and not had any luck with it at all lol
Try asking Mr.Rusch or Calum?
Sent from my X10a using XDA App
go3asy said:
yeah , changed that worked fine but the style.xml file isnt viewable unless you decompile the apk then when you recompile the folder value with style.xml is compiled into the above file resources.arsc and not had any luck with it at all lol
Click to expand...
Click to collapse
Hmm style.xml is not viewable but also not any other .xml is viewable or readable if you do not decompile.
So I return to My_Immortal's initial question. Have you followed calum's guide about decomipling/recompiling the resources to the letter? What about the part where you take the .asrc file from the unsigned.apk and you chose to add it to the copmressed .zip file (which is the original signed apk that you have renamed). Have you done that exactly as you should?
_calum_ said:
This will create a new framework-res.apk in a subfolder out.
IMPORTANT: Do not push this apk to your phone unless you want to reflash
Extract the xml files and images from the newly generated apk (you can use the original images, but the xml files must be the newly compiled ones from the new apk). Add these files to the original framework-res.apk that you want to push to your phone (see the previous post).
Extract the resources.arsc from the root of the apk
Rename the original framework-res.apk from your theme to framework-res.zip
Right-click the extracted resources.arsc and choose the 7zip menu item ‘Add to archive’
In the dialog that appears set the achive field at the top to the framework-res.zip from step 7. And set the archive format to zip. Now set the Compression level to store and click OK(if you do not do this your phone will not boot). The settings are in the attached screenshot.
Rename framework-res.zip to framework-res.apk and double check that the compressed size or resources.arsc is the same as the original size (see screenshot)
Done. Push the new framework to your phone.
Click to expand...
Click to collapse
Its tge re compiling tgatsvthe problem aleays get sources not founf error in apktool. Read that it might be im not using fresh framework files tgat havent already been fiddlef eith but dont have any originnalsat the moment they all gave battery mod
Sent from my X10i using XDA App

[Q] How to edit .xml files within and .apk

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!

[Q]Modified APK Installation Problem

I've downloaded an APK in the internet and successfully installed it o my Android, then decided to modified it. So I did the following:
Copy APK file to my Computer
Change the extension to ZIP
Extract it
Edited it here and there (Actually I just replaced the splash screen)
Compress it with ZIP
Change the extension back to APK
Put it to my phone
Can not be installed. When I trying to install. It said "Application not installed."
Any suggestion guys?
this is not the way to modify apk. use apktool.

[Resolved] How to sign an apk

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

Categories

Resources