[Q] system apk - EVO 4G Q&A, Help & Troubleshooting

what is considered a system apk? framework-res.apk? com.htc.resources.apk?
all files with com. in front of them? all files in the /system/app/ ? I'm using apk_manager_4.9 to experiment with some simple theming and at one point during zipping it ask if it's a regular apk or a system apk. I haven't a clue. I've only messed with Gmail.apk and I considered it a system apk from the file location it was in. Did I guess right?

In apk manager system apk is a question that, if answered yes, will prompt to keep other files (such as the signature) when recompiling the apk.
In apk manager there is a little hint about when you would choose yes or no to system app. It just takes a little bit of reading.
When in doubt just choose yes to system app and the follow up question. When the apk is recompiled you will have "unsignedxxx.apk". Copy that unsigned file somewhere and then sign the apk. Now you have a signed and unsigned version of the recompiled apk. If the unsigned version doesn't work try the signed version. If that doesn't work then you need to go back and see what you changed that might be causing the issue.

thanks, good info. I can work with that.

Which one would be the first pick to try to install, signed or unsigned. Guess I should go find out the difference.
Sent from my PC36100 using XDA App

Related

[Q] Do I have to theme using an update zip?

Noob to theme'ing.
Do I have to make an update zip to theme or can I modify the framework apk and just push that to /system/app?
You can just modify and push framework-res.apk to system/framework/
Sent from my ADR6300 using XDA App
Oddity said:
You can just modify and push framework-res.apk to system/framework/
Click to expand...
Click to collapse
system/framework/
sorry i've been at this computer too long lol
My replacement keeps giving me boot loops.
All I changed was: I duplicated the green lockslider and its components and renamed them to replace the other gray locksliders.
then I compressed the framework-res to a zip (using built in mac zip compression, mac user so i can't use winrar) and change zip to apk. adb push to system/framework/
any ideas what is going wrong?
cupcakera said:
My replacement keeps giving me boot loops.
All I changed was: I duplicated the green lockslider and its components and renamed them to replace the other gray locksliders.
then I compressed the framework-res to a zip (using built in mac zip compression, mac user so i can't use winrar) and change zip to apk. adb push to system/framework/
any ideas what is going wrong?
Click to expand...
Click to collapse
Have you tried installing it via a update.zip?
cupcakera said:
My replacement keeps giving me boot loops.
All I changed was: I duplicated the green lockslider and its components and renamed them to replace the other gray locksliders.
then I compressed the framework-res to a zip (using built in mac zip compression, mac user so i can't use winrar) and change zip to apk. adb push to system/framework/
any ideas what is going wrong?
Click to expand...
Click to collapse
Well this gets to be a bit confusing. I will say what i know hopefully others can help out too.
APKs are just zip containers that are signed, that means there is no compression. In your zip program look for a setting under compression labeled store. You would then have to sign that bad boy in order for your phone to work. You can not use the testsign certificate.
With that being said here is a guide...
Modifying?
PNG's -> open the apk up in the zip program, navigate to the res/whatever_folder_had_the_original and drop your files in.
9.PNGs and XML more complicated. You will have to decompile the apk [apktool] then modify them [look for articles on that, i cant get too indepth here]. Compile the apk. Drag the now compiled xml and 9.pngs to the respective folder open in your zip program.
Really the object is not to mess up the signing that comes with the apk. opening up the apk in a zip program, allows you to view, and replace files with not destroying the signature.
This method will not work with all applications. I have still not figured why some programs work with being signed with a testcert and others are not. I have a hunch that all userspace programs can be test signed and all system files need their own [htc?] key.
Also to note is that for some reason the phone when looking at framework-res, services.jar and others does not seem to mind the differences in CRC of the files stored in it, with what is in the manifest. I still can figure out the phones reasoning to allow this to happen on some but not all apps.
I hope this was not very confusing. I am working on video toturials of this same subject. Stay tuned!
That really helps a lot. Thanks.
I'll try that out tonight. Any recommendations for zip programs with a store feature for mac?
cupcakera said:
That really helps a lot. Thanks.
I'll try that out tonight. Any recommendations for zip programs with a store feature for mac?
Click to expand...
Click to collapse
I use BetterZip on my mac..........open the apk with Betterzip, then extract the res folder to your desktop (or wherever you want). Edit the .png files you want.......steer clear ( unless you know how) of editing the 9.png files. Delete the original res folder from the framework folder and insert the res folder you just edited. Then save the framework-res.apk and push back to where it belongs.
I like 7zip better, but this works okay, since there is no 7zip for a mac.
Betterzip worked perfectly! Thanks again.

[Q] problem installing modded app...questions

hey guys.
i've been getting into modding apps to match my liking. i've modded widgetlocker, sms unread count, ported the cm6 mail app and modded it, and also lookout. pretty much what i'm doing is changing .png's. i've done it by openining the .apks with apk manager, editing the .pngs, zipping and then signing it. then i install and bam, everything works.
however, now i'm trying to mod MixZing and i'm having an issue. bear with the long explanation:
tried the regular method using .apk manager. if i unzip/edit/zip/sign and try to install, i get "Application not installed"...if i do unzip/edit/zip as system app (no signature) and try to install, same message. if i do unzip/edit/zip as regular app but dont sign it, same message. if i edit the file with 7Zip and try to install, also get the same message...
if i unzip/edit/zip/sign and try to copy/paste over the existing .apk in /data/app i get force closes when i try to open the app.
now, if i edit the .apk with 7-zip and i copy it over the existing .com.mixzing.basic-1.apk in /data/app then it works! the widgets work, the app works. all is well....until i reboot the phone. then i come back and the app wont launch, as if it wasn't there.
i go to /data/app/ the .apk is there, but it wont launch. if i try to install it from there, it also gives me "Application not installed"...interestingly enough, when i try to install it, it tells me it would overwrite an existing application. yet when i go to the Market, it shows as Mixzing NOT being installed and lets me install a new copy just fine.
if i install again from the market, and copy/paste my copy over it in /data/app, it works again...until I reboot...and the cycle repeats.
what am i doing wrong here?
I am also trying to theme/mod apks to my liking. I am also getting the same errors as you are"application not installed ". I posted the same questions, yours are more detailed, on Riptides theme thread. Riptide has themed several add-ons that are flashed via recovery. I am waiting on a reply. Maybe check his thread and see if your questions are answered on there also...
Sent from my PC36100
No help or suggestions???
Sent from my PC36100
What files are you modifying? Are they *.9.png files? If so, they need to be decompiled, not just extracted so you can see the borders.
Sent from my PC36100 using Tapatalk
yeah the majority of the images edited are the buttons, all of which are .9.pngs. would that make a difference as to the app not installing? or the fact that it's recognized prior to boot but not after boot?
EDIT: i decompiled the .apk with APK Manager. replaced the .9.pngs with my own. tried to recompile and when it was about done it gave an error. after that it allowed me zip the apk. when i went to install, got the same message..."application not installed"...
why this issue with MixZing and not Lookout, SMS Unread Count, CM6 Email, WidgetLocker???
Max_Pain said:
yeah the majority of the images edited are the buttons, all of which are .9.pngs. would that make a difference as to the app not installing? or the fact that it's recognized prior to boot but not after boot?
EDIT: i decompiled the .apk with APK Manager. replaced the .9.pngs with my own. tried to recompile and when it was about done it gave an error. after that it allowed me zip the apk. when i went to install, got the same message..."application not installed"...
why this issue with MixZing and not Lookout, SMS Unread Count, CM6 Email, WidgetLocker???
Click to expand...
Click to collapse
Ok, .9 png files are not normal image files. To make a long story short, they are special image files that contain meta-data. Usually this meta-data is used to tell the widget where to stop and start (basically borders). Developers use .9 png files instead of hard-coding the borders to make it easier and more flexible for widgets and other images to display on a wide variety of devices.
When you extract .9 files, you will not see the meta-data. Chances are what is happening is when you are modifying the .9 files, you are also erasing the metadata. All .9 png files must have either a black border on the edge to tell the application where the border is, or it must have a white (blank) border surrounding the image. When you decompile the images, you should see some black lines on the edges of the .9 image files (make sure you are using APKManager 4.9).
So, when editing .9 png files, you have 3 options:
1. The easiest is to simply edit it the way you have been and remove the .9 filename. So for example, if the file is called background.9.png, rename it to background.png. This works about 50% of the time.
2. Decompile the .9 png file to see the borders, edit the image file and either keep the existing border or make your own black border on the edge (it doesn't need to be thick, just a small black line will do). The only problem with this is that sometimes you can see the black lines after it is compiled again.
3. The best way, IMHO, is to make a blank edge on the border of the background. This will avoid any compiling errors and eliminates the chance of seeing the black border. It doesn't need to be thick, just as long as the app can distinguish the border.
thanks for detailed post. will look at it with more time tonight or tomorrow.
i tried quickly now but didnt work.
i decompiled the apk using apk manager 4.9, i was able to see the .9.pngs with the black border. i changed all the extensions to just be .png for all of them. then edited them all in photoshop (make them clear is all i want), saved, and recompiled. for the first time APK Manager didn't give me an error. got all the way to asking me if it was a system app. i chose no. then i signed the app. again, no errors from apk manager. but when i tried installing, again got "application not installed"
ahhh...
will try other methods from your post later. if you have an idea as to why my first attempt didnt work i'm all ears.
Max_Pain said:
thanks for detailed post. will look at it with more time tonight or tomorrow.
i tried quickly now but didnt work.
i decompiled the apk using apk manager 4.9, i was able to see the .9.pngs with the black border. i changed all the extensions to just be .png for all of them. then edited them all in photoshop (make them clear is all i want), saved, and recompiled. for the first time APK Manager didn't give me an error. got all the way to asking me if it was a system app. i chose no. then i signed the app. again, no errors from apk manager. but when i tried installing, again got "application not installed"
ahhh...
will try other methods from your post later. if you have an idea as to why my first attempt didnt work i'm all ears.
Click to expand...
Click to collapse
I know what the problem is. You need to uninstall the previous version before installing the modified version. Even though they are the same app, the signatures are different, so they won't overwrite. I make that mistake a lot too.
uninstalled mixzing, tried installing my signed copy and again, application not installed.
does it matter that i mixed the renaming of the 9.pngs to just .png from step 1 to the decompilation of the .apk from steps 2 and 3? maybe i should just rename the .9.pngs through 7zip without decompiling?
any more suggestions?
to test out a theory, i did the following:
1) extracted .apk with apk manager, changed 4 .png files that were not stretchable .9.pngs. zipped .apk, option 2, then signed .apk.
i uninstalled my working version of mixzing, tried to install this one, and got application not installed.
2) i decompiled .apk with apk manager, changed the same 4 .png files, recompiled apk, non-system app option, signed .apk.
mixzing was still uninstalled, tried to install this version, got same application not installed message.
neither of these tries including any .9.png modifications and still failed?

[Q] Changing the graphics in an apk? (Handcent theming)

I'm trying to replace the unknown contact image in Handcent to the one in the AOSP contact app. I shrunk the second image to the size of the first one, replaced it in the apk, and then signed it again. Only now, it fails to install. I've seen people here theming a lot of different apps, so I thought this would be the place to ask: what am I doing wrong?
I used the autosign.bat with testsign.jar to sign it. When I try to install it, it says "Application not installed" after I get past the security screen. So it would seem something's wrong with how I signed it.
I thought I might have screwed up by signing the apk since it seems like the thing I used to sign it is only for signing flashable zips. So, I tried without signing and it wasn't any luck. What do people use to crack apks? This should be simpler than I'm making it.
why are you taking the apk apart? to replace drawables, you should just be able to drag the image into the the drawable folder, without unpacking or repacking.
maybe i'm wrong here, but...i think smali baksmali is just for dinking with the framework
I think market apps need to be resigned if modified. Try using apkmanager to decompile it and then change the images before compiling and signing.
nukedukem said:
I think market apps need to be resigned if modified. Try using apkmanager to decompile it and then change the images before compiling and signing.
Click to expand...
Click to collapse
Thanks, that seems to work better. Now it will install, but it won't run. I think the png files might be 9.ping files and I need to figure out how to make those properly.

Unzipping and zipping apk files?

I unzipped a apk file to change some of the images in the drawable-hdpi folder, how do I zip it back into an apk file to reinstall it on my phone. Or can I flash the zip file? I dunno how that would work...
Sent from my HTC Vision using XDA App
Can you get another copy of the apk?
If you can then the best thing to do is use winRAR or 7zip to open/explore the apk just like with a .zip file. That way you never unzip it and don't run into that issue. Using those allows you to delete and add files. You can also do the same thing on your phone using root explorer or something similar.
As far as correcting what you've done already (assuming you can't get a copy of that apk) I've completely forgotten since I never have to do it. I know if you look on the android sdk's site you can find the answer though.
adamtheindien said:
I unzipped a apk file to change some of the images in the drawable-hdpi folder, how do I zip it back into an apk file to reinstall it on my phone. Or can I flash the zip file? I dunno how that would work...
Sent from my HTC Vision using XDA App
Click to expand...
Click to collapse
An apk is just a zip file with the apk extension, once you zip it up change it from a .zip to a .apk
Sent from my T-Mobile G2 using XDA App
i changed what i wanted and rezipped, changed the extension, tried to install it, says problem parsing the package?
adamtheindien said:
i changed what i wanted and rezipped, changed the extension, tried to install it, says problem parsing the package?
Click to expand...
Click to collapse
It can also depend on which APK (system vs non-system) and which images (.9 images can be tricky to replace if you don't know what you are doing). Sometimes, you also need to re-sign the APK, depending on what you modified (there are tools to re-sign in the SDK or you can use something like APK Manager).
You should try the opening the APK directly in WinRAR/7-zip and replacing the images method. In my experience, if you are just replacing simple images, you usually don't have to re-sign when doing this (it leaves the existing signature intact).
ok i mainly just replaced images and and edited a couple. i dont know how to use all that adbsdkwhatever stuff.... -_- i know i should but im too lazy. so i dunno how to re sign it...
all im trying to do is edit the quick search bar images. maybe i dont have to do this if there is somewhere to find themed search bars?
If you can then the best thing to do is use winRAR or 7zip to open/explore the apk just like with a .zip file.
Click to expand...
Click to collapse
If your using winRAR click and drag stuff works if its one or two files.
If its a lot of images or a large file like framework-res.apk (I'm thinking your search bar might be in there if I'm not mistaken) then you'll want to make a new ZIP archive with "store" compression (uncompressed pretty much).
(also you shouldn't need to resign the framework-res.apk)
I haven't tested 7zips click and drag but the same principals apply. If its bigger files being recompiled Winrar tends to compress it a bit and sometimes it causes bootloops.
That being said, don't forget to nandroid
82_Z28 said:
If your using winRAR click and drag stuff works if its one or two files.
If its a lot of images or a large file like framework-res.apk (I'm thinking your search bar might be in there if I'm not mistaken) then you'll want to make a new ZIP archive with "store" compression (uncompressed pretty much).
(also you shouldn't need to resign the framework-res.apk)
I haven't tested 7zips click and drag but the same principals apply. If its bigger files being recompiled Winrar tends to compress it a bit and sometimes it causes bootloops.
That being said, don't forget to nandroid
Click to expand...
Click to collapse
Well from my experience, 7zip handles the task like a champ. I've taken every image out and put others back in with no issues. The downside is that some apps set certain dependencies in the .xml files so if you delete the wrong things it won't install and if it does, all you get is a fc all day. In that case it helps to know how to convert the xml binary to something readable (unless you're a king a hex editing).

[Q][For Devs] png-out optimization on HTC_IME.apk [SOLVED]

I have a couple questions, really...
1) I ran pngout optimization on /system/app apks for a custom ROM that I have been working on and upon flashing HTC_IME does not work. I'm sure that this is because the .apk is unsigned, but I also know that it will fail if i resign with test keys. Question is: How do I disable signature verification in the ROM (as opposed to Recovery)?
2) Second question is along the same lines as the first. Are there any .apks that I should not optimize in any way?
Thanks!
grayn0de said:
I have a couple questions, really...
1) I ran pngout optimization on /system/app apks for a custom ROM that I have been working on and upon flashing HTC_IME does not work. I'm sure that this is because the .apk is unsigned, but I also know that it will fail if i resign with test keys. Question is: How do I disable signature verification in the ROM (as opposed to Recovery)?
2) Second question is along the same lines as the first. Are there any .apks that I should not optimize in any way?
Thanks!
Click to expand...
Click to collapse
Aye you need to make sure that you don't also have to make changes in framework. I'm right sure you need to and also Rosie. Think you can only disable it in recovery but I'm not sure.
Dicht yer neb and flee awea!
U can do one of two things...
1. U can sign with test keys and then resign the other apks with the sane test keys.
2. Make ur edits and then open up the original apk and replace the Res file with the one u edited.
Gotta make sure all the apks that u have in ur rom are all signed with the same keys or the apk that arnt will not work correctly.
Pretty much if ur just doing image edits then u can open the original and replace the Res folder but if doing if ur breaking it open with apk manager or something like that to edit XML or smali edits then u have to resign it and resign the rest of the apks as well...
Sent from my PC36100 using Tapatalk
Papa Smurf151 said:
U can do one of two things...
1. U can sign with test keys and then resign the other apks with the sane test keys.
2. Make ur edits and then open up the original apk and replace the Res file with the one u edited.
Gotta make sure all the apks that u have in ur rom are all signed with the same keys or the apk that arnt will not work correctly.
Pretty much if ur just doing image edits then u can open the original and replace the Res folder but if doing if ur breaking it open with apk manager or something like that to edit XML or smali edits then u have to resign it and resign the rest of the apks as well...
Sent from my PC36100 using Tapatalk
Click to expand...
Click to collapse
Perfecto. Thanks!

Categories

Resources