[Q] nuub question, can an .apk be lightly modified like this? - Galaxy S II Q&A, Help & Troubleshooting

I am sure this would be a WTF for some people thats why I'm asking in the Q&A section.
I've noticed that .apk files can be renamed to .rar and, once decompressed, we can find files in a normal-structure in their real format (images, sounds, xmls, etc).
So I wonder, let's say, we want to modify one of the images inside the .apk. We would change it for another with the same name/size so no probs with that.
Could we decompress the .apk as a .rar, change the file, recompress it to a .rar and rename it to .apk, or we would **** permissions or something in the way?
Otherwise it needs some compiler or something I guess right? But then I wouldn't understand why it can be plainly decompressed as a .rar..

This should get you started;
To unpack/repack etc .apk use Apk Manager 4.9 - Makes Modifying Ur Apk A Breeze (Windows/Linux)
To modify .xml files, use Notepad++

UpInTheAir said:
This should get you started;
To unpack/repack etc .apk use Apk Manager 4.9 - Makes Modifying Ur Apk A Breeze (Windows/Linux)
To modify .xml files, use Notepad++
Click to expand...
Click to collapse
Thanks a lot mate! Very appreciated

Related

Compile HTC.Resources

I am trying to add some .9 files and soem xml files to the drawable, drawable-hpdi folders respectivly, and i get compiles issues. What's the trick to this? I compile all day long with other apk's.
I get a ton of these:
ERROR: Failure processing PNG image D:\APK Manager 4.9\other\..\projects\com.htc.resources.apk\res\drawable-hdpi\appwidget_inner_focus_c.9.png
libpng error: Read Error
i believe you need to add the edited .9 files in after you compile. switch apk to zip and do it that way and then sign. atleast that is how i always have done it. compile with altered .9's always failed on me too.
RafficaX said:
i believe you need to add the edited .9 files in after you compile. switch apk to zip and do it that way and then sign. atleast that is how i always have done it. compile with altered .9's always failed on me too.
Click to expand...
Click to collapse
Thanx for answering.. But a bit fuzzy..
I actually have xml's to add to the drawable-hpdi and standard .png's not .9's to add to the drawable
I tried to just copy them over to the compiled version of the apk..
what do you mean switch apk to zip?
rename it to zip after you compile it, so this way you can open in winrar or 7zip and just drop those png's in the folders they need to be in. then rename name the zip to apk and sign it. the xml's can be in there when you compile it. they wont cause an issue.
like i said every time i made xml and png edits i had to do it this way to work right.
If you use 7zip there is no need to rename the file to .zip
Just right click on the file and choose 7zip - open archive.
Sent from my B.A.M.F. Thunderbolt
okay someone earlier in an email said never sign a htc.resources file.
Seems there could be several ways.
1. Open resources file with 7zip
2. copy png's to drawable folder
3. copy xml's to drawable-hdpi folder
then what?
thats it. bc its still an apk file through 7 zip. load it on your phone. i make sure it copies over the signature when it re compiles though. watch the output to make sure it did.
RafficaX said:
thats it. bc its still an apk file through 7 zip. load it on your phone. i make sure it copies over the signature when it re compiles though. watch the output to make sure it did.
Click to expand...
Click to collapse
Sorry being dense or just not getting it. You said re-compiles. If you are just opening the com.htc.resources with 7zip and copying files into it, how are you re-comiling?
The bits and pieces are confusing. PM me the exact steps to replacing png and xml in the resources file?
Dont you have to Zip align it? Or zip it? So it can be flashed from recovery?

[Q] Editing an APK, any APK.

EDIT: Figured it out.
Care to share?
Yeah, will be nice if you could share this information with others
aitorTheRed said:
Yeah, will be nice if you could share this information with others
Click to expand...
Click to collapse
Man, I hate it when people do that...
1. Search for APK Manager in XDA and install it on your PC
2. Download and Install the Android SDK kit on your PC
3. Follow the instructions for APK Manager and place the APK file in the modding folder
4. Open APK Manager and select Decompile APK (Your APK file will be placed in a separate folder for you to work on)
5. Change what you want to change in the APK
6. Recompile the APK and sign it (unless it's a system file like framework, those are not signed)
A lot more is involved in modding an APK file and you really should know something about how the files inside the APK work before you go changing things, but in a nutshell, that's the basics.
Hope that helps!
What I have learned.
I had a specific question, but here is what I can tell you.
1. Setup APK Manager, it saves a lot of command line typing.
2. Pretty much always use option 9 and 11, never 1 or 3.
3. If you are simply changing graphics and not smali or XML files, don't use this, open it in 7zip and drag the files. Decompiling changes the image darkness sometimes.
4. Unless you are working on your own apk file, always say yes to 'is it a system apk', when it asks you to keep existing files, say yes. Delete from the 'keep' folder what you edited.
5. If you edit XLM files, delete resources.arsc from the file, this is where they all get compiled to.
6. You can use this for jar files, just rename to apk then back to jar when finished.
7. If you get an error try using option 20 to increase the memory to 1024.
8. If you edit jar files, delete classes.dex in the 'keep' folder when compiling.
9. Treat all files as signed system files (as noted above) and you will be much safer. If the file has a signature on it, this will save it.
Thanks for the info
Is there anything that can install system files. They won't install with ap manager so does it have to be pushed?
Sent from my Desire HD using XDA Premium App

[Q] changing default music players look?!

hello, i wonder if someone would help me out a little bit, a few days ago i started to try modifying the default MusicPlayer.apk on my Galaxy 3.. i extracted the stuff from the .apk with winrar, edited the .png files inside the "res" folder and then repacked all the files to a .rar archive,after that renamed it to .apk and resigned it (i tried even without resigning) but the app wont start..due to this is a system app i know i cant install it from the file manager,but usually it has to begin the installation etc.. i only get something like a parsing package error..any help would be appreciated,and thanks in advance..
[sorry if my english is wrong]
Of course it won't start
In the apk there are also more folders than the res-folder, you only see them if you decompile the apk.
But you only have to decompile them if you want to edit ...9.png (eg with that) files, otherwise just extract them to edit and afterwards add them again with WinRAR or something like that
in fact i did extract all files and folders so i repacked all of them again im sure i didnt miss any files,the problem is that i dont know what else the problem could be
danke trozdem für die hilfe help is always welcome
Edit: I found out how to do it open the .apk as an archive (with winrar or something similar) extract the files you want to edit,edit them and put them into the original .apk you wanted to edit (youi open the .apk file with winrar,and drag the edited files and just drop them to the opened archive,and let them get replaced) and done!!
I edited the original MusicPlayer.apk of my Galaxy 3 so that it looks like the Xperia's one (just edited some .png files)
btw here are some screens of my work (till now), but i have so much more things to edit

Extracting Certain Files from APK's

hey all, i was just wondering if anyone knew how to extract some files from an apk?
specifically, i like riptide gp's background music and was wondering if anyone knew how to extract those music files from the apk or something. let me know! thanks!
I already tried opening the apk on both my computer and NT and couldn't find any music files anywhere... starting to think its not possible, but it can't be because in order for a game to have music its gotta have music files somewhere in the installation file just like any other game on any platform...
Just to get the most basic question out of the way, so sorry if I seem pedantic, but did you just change the extension of the .apk to .zip or did you use APKTool to unpack the .apk?
SG Pillar said:
Just to get the most basic question out of the way, so sorry if I seem pedantic, but did you just change the extension of the .apk to .zip or did you use APKTool to unpack the .apk?
Click to expand...
Click to collapse
i've already tried extracting the apk by conventional means, aka using winrar to extract the contents, but no luck in finding any files resembling that of a music file type. i've also tried apktool but after decompiling the apk, i couldn't find any music files either...
after decompiling through apktool i just saw a lot of .smali files. there was one files called base.apf but not sure how to decompile that....
Check out apktool to extract apks. I've used it on system files to open them up and edit what's inside.
https://code.google.com/p/android-apktool/

[Q] Edit apk with ODEX file

Hi,
I have an apk that I'd like to edit, just some simple icon and xml changes. I have decompiled, edited and signed with apktool so I'm confident everything there is ok. Only problem is, it won't install.
The apk does have a odex file with it. Is it possible to edit this apk or am I wasting my time?
syztemlord said:
Hi,
I have an apk that I'd like to edit, just some simple icon and xml changes. I have decompiled, edited and signed with apktool so I'm confident everything there is ok. Only problem is, it won't install.
The apk does have a odex file with it. Is it possible to edit this apk or am I wasting my time?
Click to expand...
Click to collapse
if it is system file than place it in system/app
and set permissions and reboot
Does that include the original odex file or should I just dump it after I've edited the apk?
syztemlord said:
Does that include the original odex file or should I just dump it after I've edited the apk?
Click to expand...
Click to collapse
it work only if you have deodex it
Hello, I am running into the same problem. I want to change a setting in an apk. But I'm confused with the odex file accompanied with it.
Can I unpack an apk, change it. Rebuild it and put it back?
Do I also have to unpack the odex file and rebuild it and put it back?
I can see a lot of information about apk editing. But I can't find tools to edit an Odex?
I think I'm also confused about the odex/deodex. I just googled everything about this subject and got the tools studioandroid, but it doesn't contain anything with editing odex files....
I hope someone can help me out!
Thanks!!

Categories

Resources