Finished editing new APK help

TheSwaggeR

Member
Joined
Jan 11, 2011
Messages
745
Reaction score
0
Trying to speed this project up with some help and responses.

I've tested different programs to do this work but found out since I'm only editing PNG image files and no .9.png image files for the time being then I don't need to use xUltimate right now.

Here's what I've done with no success trying it out on Music.apk as practice:

1. Plug USB in Droid 2 and to PC
2. Make sure Debugging is on
3. Open Removable Disk Drive I: (my Droid 2) and go to /system/app (this is where Music.apk is)
4. Copy Music.apk and put it in my c:\android-sdk-windows\platform-tools\newAPKwork
5. Open Music.apk (in my newAPKwork folder) with 7-zip by right-clicking Music.apk and select Open Archive
6. Click on the res folder (on 7-zip)
7. Click on drawable-hdpi folder
8. Drag a .png image file onto GIMP program
9. Edit the colors on them
10. Save edited .png image file to drawable-hdpi folder (c:\android-sdk-windows\platform-tools\finishedpngs\drawable-hdpi)
11. Repeated editing to the rest of the .png image files in drawable-hdpi folder and save to same folder (drawable-hdpi folder)
12. Click on drawable-hdpi-finger folder
13. Repeat step 8
14. Repeat step 9
15. Save edited .png images file to drawable-hdpi-finger folder (c:\android-sdk-windows\platform-tools\finishedpngs\drawable-hdpi-finger)
16. Repeated editing to the rest of the .png images files in drawable-hdpi-finger folder and save to same folder (drawable-hdpi-finger folder)
17. Go back to drawable-hdpi folder on 7-zip
18. Open up the folder containing the newly edited .png image files on c:\android-sdk-windows\platform-tools\finishedpngs\drawable-hdpi
19. Select all the newly edited .png image files and drag them into the drawable-hdpi folder on 7-zip
20. Click OK to copy over original .png image files (this will replace the original .png image files with my newly edited .png image files)
21. Repeat step 17 but go to drawable-hdpi-finger folder on 7-zip
22. Open up the folder containing the newly edited .png image files on c:\android-sdk-windows\platform-tools\finishedpngs\drawable-hdpi-finger
23. Select all the newly edited .png image files and drag them into the drawable-hdpi-finger folder on 7-zip
24. Repeat step 20
25. Exit out of 7-zip
26. Open up the folder with the copy of Music.apk (c:\android-sdk-windows\platform-tools\newAPKwork)
27. Right-click Music.apk and click on Open Archive through 7-zip option
28. Go back through drawable-hdpi and drawable-hdpi-finger and see if the newly edited .png image files have change (success on this)
29. Open up Command Prompt
30. type adb push newAPKwork /system/app Music.apk
31. Hit enter (got a bunch of script just flash before my eyes)
32. I assume the newly edited Music.apk replaced the original Music.apk in /system/app folder on my Droid 2
33. Unplug USB
34. Reboot phone
35. Open up Music to see if changes were made
36. Project was a failure because no changes were made. None of my colors replaced the original colors

I'm really stumped and spent nearly my whole weekend trying to practice changing colors on a single APK file with no success.

Much help would be entirelly appreciated since I can't seem to have success with other methods as well.
 
Hit up es0tericcha0s, he's just finishing music.apk I believe

DroidForums Junkie!!
 
Just sent him a message. Really anxious and almost impatient to figuring out what is causing my work to not go through and change!
 
Did you repackage an existing theme? That happened to me once when I was replacing icons in a fission theme, even though I selected my new theme in clockwork for some reason because I had the old one on my sd card too, it kept flashing the old one. I had to remove it for the new one to take effect. I would imagine its the same for an apk, or I'm totally trippin....

Sent from my DROID2 using DroidForums App
 
Nope. Think I just figured out my problem. Although, this is my honest opinion, there are WAY too many mixed reviews based on what you can and can't do.

Here was my problem, adb push newAPKwork /system/app, while this command is in fact CORRECT, the result was failure do to my system NOT being mounted. Therefore it was in a read only mode. I knew this was the problem awhile back and thought I had corrected it but did not correct it.

My previous misake:

Going to Root Explorer, go to system/app, click on Mount button

Problem with that is it only works when I'm not plugged in via USB. If I'm plugged in via USB then my SDcard is not viewable because the PC has control over it.

My fix after reading 2 threads on droidforum.net lead me to conclude that the edited Music.apk is not being successful due to my system not being in Mount mode (read/write mode).

So, I took a turn at one suggestion... reboot into recovery via Clockwork, go to mount and storage, click on mount system, go to my Command Prompt on my PC re-enter adb push newAPKwork /system/app, result? SUCCESS! Rebooted phone, checked out the Music and it has finally made the changes!

Man am I glad!!!!!!!!! Almost the WHOLE weekend trying to figure this stuff out. My brain sure is beaten beyond oblivion now.
 
I don't know. I didn't see a command line like that anywhere. I took the command line from AndroidSamurai on the Droidoholics site and there wasn't any mention of that line.

I guess I'm suppose to enter it like this in Command Prompt:

adb shell sysrw

hit Enter?
 
What I've done (if basic steps with Apk Manager don't work) is:
-Open archive with 7zip
-Copy what I want to change into a separate folder
-Right click the image
-Open with paint.net
-Edit how I want
-Save
-Copy all images back to 7zip
Most of the apks I've done have worked with just decompiling, editing, compiling, and signing though.

DroidForums Junkie!!
 
I've never used APK Manager. I did download it an hour ago, though. I've got several tools on this laptop now and no longer know which tools are even worthy to keep to use in what I'm doing and going to be doing.
 
I don't know. I didn't see a command line like that anywhere. I took the command line from AndroidSamurai on the Droidoholics site and there wasn't any mention of that line.

I guess I'm suppose to enter it like this in Command Prompt:

adb shell sysrw

hit Enter?

That's what I do, adb shell goes into the superuser/terminal commands on your phone, its like typing in sysrw in terminal emulator...after I push I always adb shell sync, then adb shell reboot

Sent from my DROID2 using DroidForums App

Wow, ok. Thank you for that info. Don't know why I didn't see that anywhere else. I will try that on my next APK push.
 
Its a pretty good tool. Most of the time, its best to use to just edit xmls and .9 images but, I've used it to edit images in drawable too.
I've never done an adb push so I'm not familiar with it.

I've never used APK Manager. I did download it an hour ago, though. I've got several tools on this laptop now and no longer know which tools are even worthy to keep to use in what I'm doing and going to be doing.



DroidForums Junkie!!
 
Guess I was a little late to the party to help. Good job at figuring it out though! Might I suggest a couple of things to make your life easier? 1) Use Apk Manager. Awesome tool, especially helpful if you ever want to edit .9.pngs. Has a built in adb push/pull function that will automatically do adb remount for you. Apk Manager 4.9 - Makes Modifying Ur Apk A Breeze (Windows/Linux) - xda-developers 2) Update.zips. These are great things, and sometimes you NEED them. Pushing via adb stuff like framework-res.apk is a bad idea and you'll probably cause problems. Use 7zip to throw a system apk in there with the right folder structure, and you're good to go. Let me know if you have some more questions, I'll be around most of the day probably.
 
Ok, I'll be following instructions for the APK Manager and try it out when I get some time in a bit.

My question is, if I'm just editing APK files in /system/app then there is no need to Sign the APK and use APK Manager for that? These png image files are typically found in the res/drawable-hdpi folders. What if I were to take out an image in the drawable-hdpi folder and swap it out with a completely different image (not replacing colors, but replacing the entire image with a different image somewhere else) and then save it with the same original png image file name?

Just trying to get a better understanding when it's imperative to use APK Manager or just using 7-zip, GIMP, then adb push it. And when it's imperative to sign an APK.

From my understanding of what you said, it seems like if I were to work on any framework-res.apk files then it's imperative to not push with adb but use the APK Manager for that?
 
It really just depends on what you are editing, to be honest. If you are just changing regular PNGs like the status bar icons, battery icons, etc, then there is no need to Apk Manager. If, by chance, you get interested in changing more, like anything called .9.png or an xml (a lot of colors for backgrounds, text, etc are found in various ones) then that is when Apk Manager comes in handy. You can do adb push for MOST system apps. The main one I know it does not work on is framework-res. I still think update zips do the job better, but it is an extra step or 2 to reboot into recovery each time to test something. So, long story short, you have the gist of what I was saying down, but you don't NEED Apk Manager, just that I find it pretty helpful in a lot of things that I do...
 
It really just depends on what you are editing, to be honest. If you are just changing regular PNGs like the status bar icons, battery icons, etc, then there is no need to Apk Manager. If, by chance, you get interested in changing more, like anything called .9.png or an xml (a lot of colors for backgrounds, text, etc are found in various ones) then that is when Apk Manager comes in handy. You can do adb push for MOST system apps. The main one I know it does not work on is framework-res. I still think update zips do the job better, but it is an extra step or 2 to reboot into recovery each time to test something. So, long story short, you have the gist of what I was saying down, but you don't NEED Apk Manager, just that I find it pretty helpful in a lot of things that I do...

Yeah, I'm starting to understand a lot of this stuff better now. What .9.png's are, XML, and most of those terms. What's appropriate for these files, optimizing, adb push or not, apk sign or not, etc. It is stated that /system/app APKs should not be signed. And I understand the reason behind that because it is stock APKs and signing it would turn it over to me and possibly cause update issues and such.

I was looking into the decompiling/compiling/recompiling stuff and trying to get a better sense of that, also.

But, unfortunately, I had to stop my projects and everything I'm doing or trying to do because my folders and everything are a complete mess and not all tools are functioning properly due to the adb.exe issue.

If you look at this link in the XDA forum, you'll see my thread stating almost all issues. I chose that forum due to more devs being there and a more suitable place to find response in the folder and program(s) issues.

Here's my link if you just want to take a quick peek:

Need help with editing APKs using various tools URGENT!!! - xda-developers
 
Back
Top