# Theming apps

Discussion in 'Android Themes' started by czerdrill, May 24, 2010.

1. Offline

### czerdrillNew Member

Joined:
Jan 2, 2010
Messages:
4,828
12
Trophy Points:
0
When you theme an app, and you move it from /data/app to /system/app how do you have it so that you're still notified of updates to the app? When I do this and I go to the market, I'm told that the app is no longer installed. Any workaround to this or do you have to manually check and then retheme everytime there's an update?
2. Offline

### czerdrillNew Member

Joined:
Jan 2, 2010
Messages:
4,828
12
Trophy Points:
0
anyone have any idea?
3. Offline

Joined:
Apr 15, 2010
Messages:
1,054
3
Trophy Points:
0
Location:
Denver, CO
when there is an update you will have to remove the one in system, install the update and then move it to system and theme away. It is a pain and this is why I have chosen to let my updates pile up..

The other way is just edit the APKs directly and then re sign them and they can stay in /data that way, and when there is an update you just have to edit them and re sign again.
4. Offline

Joined:
Feb 10, 2010
Messages:
2,539
0
Trophy Points:
0
Location:
The Moon
Much better to re-sign them, yes...
5. Offline

### czerdrillNew Member

Joined:
Jan 2, 2010
Messages:
4,828
12
Trophy Points:
0
Thanks, can you point me in the direction of how to resign an apk if you're using Ubuntu and not Windows?
6. Offline

Joined:
Apr 15, 2010
Messages:
1,054
3
Trophy Points:
0
Location:
Denver, CO
7. Offline

### czerdrillNew Member

Joined:
Jan 2, 2010
Messages:
4,828
12
Trophy Points:
0
Ok figured out how to edit and resign but then do I just overwrite the thing that's in /data/app or install the apk? When I tried to install the apk with the edited files it appeared to work but the changes I made didn't stick. I didn't get any errors in resigning or in installing.
8. Offline

### czerdrillNew Member

Joined:
Jan 2, 2010
Messages:
4,828
12
Trophy Points:
0
Tried overwriting as well, and still nothing. The app disappears from the app drawer, and the market shows as if it's not installed...
9. Offline

### czerdrillNew Member

Joined:
Jan 2, 2010
Messages:
4,828
12
Trophy Points:
0
man i don't get this at all haha...why is it that if i install something from the market it shows up in /data/app as com.something.something.apk, but the apk for example in the luna theme is just called Pandora.apk. Do you just rename the apk after it's signed or what is the deal? If I edit the file in the archive directly, then the archive asks me if I want to update after I save.. If I drag a file into to replace, the archive doesn't ask me this, and the apk doesn't install. Just totally confused about this.

Moving to /system/app never has a problem and always works for me, but I would like to learn how to edit the files within the apk and how they are named Pandora.apk, Facebook.apk etc when in /data/app they are not named that...
10. Offline

Joined:
Apr 15, 2010
Messages:
1,054
3
Trophy Points:
0
Location:
Denver, CO
you do not need to rename the APK's. just overwrite the apk in /data after they have been edited and re-signed. you will need to remove the old copy of the apk otherwise you will end up with two or things may break. only keep one copy of the apk on the device at once.
11. Offline

### czerdrillNew Member

Joined:
Jan 2, 2010
Messages:
4,828
12
Trophy Points:
0
hey thanks for your patience, i'm usually not this bad i promise haha :icon_eek:...but it's still not working, so here are the exact steps i'm doing...maybe you can figure out what i'm doing wrong...i'm trying to edit pandora

1] copy com.pandora.android.apk to my sdcard
2] copy com.pandora.android.apk from sdcard to computer
3] edit files, making sure i hit "update archive" when prompted after saving files
4] resigning the apk
5] move the new com.pandora.android.apk to my sdcard
6] navigate to /data/app and delete the existing com.pandora.android.apk
7] paste the newly resigned com.pandora.android.apk from sdcard root to /data/app
8] change permissions to rw-r-r and reboot

The app disappears from the app drawer, and in the market it shows that it isn't installed. I can't figure out what i'm doing wrong here...do i have to uninstall pandora? do i have to install the new apk?
12. Offline

Joined:
Apr 15, 2010
Messages:
1,054
3
Trophy Points:
0
Location:
Denver, CO
Here is what I would do:

get the apk onto my PC: adb pull /data/app/Pandora.apk
decompile the apk: apktool d Pandora.apk Pandora
(make my edits)
recompile the apk: apktool b Pandora
(sign the out.apk)
put the edited apk back onto the phone: adb push c:\path\to\your_signed_app.apk /data/app/pandora.apk

my method requires the android sdk, well at least adb from it.
You don;t need to decompile and recompile unless yuo plan to make xml or smali edits. make sure you use 7zip to do the apk editing and saving.
13. Offline

### czerdrillNew Member

Joined:
Jan 2, 2010
Messages:
4,828
12
Trophy Points:
0
still no go...tried it with adb as well...same deal...everything seems to work fine with no errors but then it disappears from the app drawer and the market shows that its not installed...just don't get it
14. Offline

### czerdrillNew Member

Joined:
Jan 2, 2010
Messages:
4,828
12
Trophy Points:
0
easily one of the most frustrating things ever haha...tried everyhting imagineable..adb, root explorer, windows, ubuntu, and nothing works. I know I can take the easy way out and just put it in /system/app but I hate not being able to figure out why it's not working. I've gotta assume it's some issue with resigning because the pushing and pulling work fine and obviously work since moving the apks to /system/app never gives me any problems.

anyone else have any idea what i could be doing wrong here?
15. Offline

### czerdrillNew Member

Joined:
Jan 2, 2010
Messages:
4,828
12
Trophy Points:
0
ok some progress(if you want to call it that...i wouldn't haha)...

I installed Pandora from the market, copied the apk to my sdcard and then uninstalled Pandora through the market

I then adb installed the apk that I had copied and all was well. The app installed, it shows up in my app drawer, and shows in the market as installed

soooo....

the error is happening after I edit the files. I've tried not resigning, I've tried resigning, I've tried adb, I've tried root explorer. I've tried it all, and whenever I edit a file I get the Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION] or parse error. Anyone can give me any tips on how to resign this apk correctly? I have ubuntu, but i can also use Windows if necessary. I know it can be done, just gotta figure out how haha
16. Offline

Joined:
Apr 15, 2010
Messages:
1,054
3
Trophy Points:
0
Location:
Denver, CO
the autosign tool is just java so it SHOULD be platform independent, grab it from xda and then do this in the directory you extract it to :

Code:
java -jar signapk.jar testkey.x509.pem testkey.pk8 apk_to_be_signed.apk your_app_signed.apk
17. Offline

Joined:
Apr 15, 2010
Messages:
1,054
3
Trophy Points:
0
Location:
Denver, CO
I just confirmed that you can sign apks in linux using the command I posted. I just tried it in slackware 13 and it worked fine
18. Offline

### czerdrillNew Member

Joined:
Jan 2, 2010
Messages:
4,828
12
Trophy Points:
0
Man...you have the patient of a saint haha so I want to thank you for that...but still no go. Again, the apk seems to sign correctly and the new apk is created. But when I go to adb install I get the parse error...

The signing appears to work, yeah but are you able to install the slackware through adb or root explorer? That's where I get the parse error. All I'm doing is editing one file. Saving it. Resigning. And trying to install. No go....I just can't figure it out and my frustration level is through the roof haha
19. Offline

Joined:
Apr 15, 2010
Messages:
1,054
3
Trophy Points:
0
Location:
Denver, CO

dont do adb install, just push the apk to its destination, it does not need to be formally installed. try that

edit: I have never tried adb install. I just use adb push
20. Offline

Joined:
Jan 2, 2010
Messages:
4,828