[Q] Reverse Enginner and edit Manifest problem! - Android Software/Hacking General [Developers Only]

Hello wazzup!
Ive try this but still dont acomplish this:
Ive got a APK which i want to edit the manifest(like package, label name, such stuff)
if i open the APK with WINRAR the manifest is decoded so ive moved on:
Ive downloaded the APKTool to reverse the application to smali or what it is called and get the real AndroidManifest.XML
I open the reversed Manifest.XML with notepad and have edit the things i want.
Now i am not sure how to decode the manifest. Because it wont work if i put the manifest.XML and use the AUTOSign tool because it expect the manifest to be decoded.
So what do i do? or is there another way to edit the manifest?
Thank you!
Your Mate!

Idon't think it's that simple, I tried and it doesn't work, you need something like apktool to do this for you
http://code.google.com/p/android-apktool/ (with or without the easier to use shell apkmanager)

@wixi909
You have to build XML file back to binary format using apktool or similar tool.

Brut.all said:
@wixi909
You have to build XML file back to binary format using apktool or similar tool.
Click to expand...
Click to collapse
hmm...ihave apktool. but could you explain more please

wixi909 said:
hmm...ihave apktool. but could you explain more please
Click to expand...
Click to collapse
I don't understand: you know, how to decode apk using apktool, but you don't know, how to build it back? This is almost the same, but "apktool b" instead of "apktool d". Everything is in apktool's usage help.

Brut.all said:
I don't understand: you know, how to decode apk using apktool, but you don't know, how to build it back? This is almost the same, but "apktool b" instead of "apktool d". Everything is in apktool's usage help.
Click to expand...
Click to collapse
I know but how do i edit the manifest. im just able do edit the drawables.
Do you understand now?

wixi909 said:
Do you understand now?
Click to expand...
Click to collapse
No, I don't.
wixi909 said:
I open the reversed Manifest.XML with notepad and have edit the things i want.
Click to expand...
Click to collapse
wixi909 said:
I know but how do i edit the manifest. im just able do edit the drawables.
Click to expand...
Click to collapse
You have written in your first post that you have edited manifest, but don't know, how to put it back to apk file. Now you say you can't edit manifest.
Whole process is:
Decode apk using apktool.
Edit AndroidManifest.xml using any text editor.
Build apk using apktool.
Nothing less, nothing more.

I'm having a related issue..
I'm using apktool to decode my apk. I then edit my AndroidManifest.xml, and repack it using
apktool b name_of_folder
For some reason though, the Manifest isn't being saved with my edits. I'm using Text Editor on Windows to edit the Manifest.
I know that it is saved before running "apktool b" so it seems to be reverting to the original during the repacking script.
Any ideas?

phiredrop said:
I'm having a related issue..
I'm using apktool to decode my apk. I then edit my AndroidManifest.xml, and repack it using
apktool b name_of_folder
For some reason though, the Manifest isn't being saved with my edits. I'm using Text Editor on Windows to edit the Manifest.
I know that it is saved before running "apktool b" so it seems to be reverting to the original during the repacking script.
Any ideas?
Click to expand...
Click to collapse
How do you know your modifications aren't saved to manifest? Did you tried to decode new apk back and see whether your changes are really there? Or you just don't see changes on a device? What did you changed?

Brut.all said:
How do you know your modifications aren't saved to manifest? Did you tried to decode new apk back and see whether your changes are really there? Or you just don't see changes on a device? What did you changed?
Click to expand...
Click to collapse
Yes, I decode the modified apk and can see my changes aren't there.
Its worked for me before, so it's strange that it's not working now. Primarily I'm adding version:Code and version:Name so I can upload to the market. Would changing the package name and/or label cause this issue?
Sent from my SGH-T959 using XDA App

Related

styles.xml

I have created a custom styles.xml I got from decompiling framework-res in CM6rc3, but am unable to recompile it. Apktool is unable to do this, from what I've heard. Anyone here able to do it? I'd appreciate any help.
xvenom89 said:
I have created a custom styles.xml I got from decompiling framework-res in CM6rc3, but am unable to recompile it. Apktool is unable to do this, from what I've heard. Anyone here able to do it? I'd appreciate any help.
Click to expand...
Click to collapse
Yeah sure I do!
-deleted post-
you may end up having to hex edit the file, using the decompiled version as a guide. unless there is some way to compile it separately from the entire apk
this is what had i do to modify progress_horizontal.xml to change the progress bar color
EDIT: or from what ive seen, start with a non-themed framework-res.apk, or one that has been properly recompiled, make sure to decompile it and recompile when you are done
invisiblek said:
you may end up having to hex edit the file, using the decompiled version as a guide. unless there is some way to compile it separately from the entire apk
this is what had i do to modify progress_horizontal.xml to change the progress bar color
EDIT: or from what ive seen, start with a non-themed framework-res.apk, or one that has been properly recompiled, make sure to decompile it and recompile when you are done
Click to expand...
Click to collapse
You see, the ONLY way to access this xml IS to decompile, as it's hidden in /res/values/styles.xml, which is invisible until you decompile the apk. Hex editing isn't necessary, as it is decompiled into plain english. I already edited it- I just need someone to compile the two for me, since apktool gives me errors.
xvenom89 said:
You see, the ONLY way to access this xml IS to decompile, as it's hidden in /res/values/styles.xml, which is invisible until you decompile the apk. Hex editing isn't necessary, as it is decompiled into plain english. I already edited it- I just need someone to compile the two for me, since apktool gives me errors.
Click to expand...
Click to collapse
which is why you need to hex edit it, because you cannot compile it when you get errors like that.
one thing you could try, is to decompile the ORIGINAL framework-res.apk from the rom you are running, replace the styles.xml with yours, then recompile it. after it is recompiled, grab the compiled styles.xml out of it and put it into the framework-res that you are building
a modified framework-res cant be decompiled unless it was properly recompiled to begin with. which most themers do not do, or probably dont know about
just a thought, may or may not work. but you are kinda stuck with this because i dont think its possible to just compile one or two files out of the apk, i think its all or nothing
invisiblek said:
which is why you need to hex edit it, because you cannot compile it when you get errors like that.
one thing you could try, is to decompile the ORIGINAL framework-res.apk from the rom you are running, replace the styles.xml with yours, then recompile it. after it is recompiled, grab the compiled styles.xml out of it and put it into the framework-res that you are building
a modified framework-res cant be decompiled unless it was properly recompiled to begin with. which most themers do not do, or probably dont know about
just a thought, may or may not work. but you are kinda stuck with this because i dont think its possible to just compile one or two files out of the apk, i think its all or nothing
Click to expand...
Click to collapse
I wasn't saying to compile one file from the apk- that's why I posted the entire thing, so you can decompile it, add my modified styles.xml to /res/values/ and then recompile.
Anyway, Thanks for the tip about recompiling an improperly compiled, themed apk. I'll test it on the original one shipped with rc3 and report back.
dam im looking to compile my styles.xml too, any tips?
SiL3nTKiLL said:
dam im looking to compile my styles.xml too, any tips?
Click to expand...
Click to collapse
doesn't anyone read a thread before posting anymore? especially one that is less than one page long?
</rant>
invisiblek said:
doesn't anyone read a thread before posting anymore? especially one that is less than one page long?
</rant>
Click to expand...
Click to collapse
Unnecessary rant. He probably just phrased it wrong; like me, he wanted to add a customized styles.xml into framework-res by means of compiling.
invisiblek said:
...decompile the ORIGINAL framework-res.apk from the rom you are running, replace the styles.xml with yours, then recompile it. after it is recompiled, grab the compiled styles.xml out of it and put it into the framework-res that you are building
a modified framework-res cant be decompiled unless it was properly recompiled to begin with. which most themers do not do, or probably dont know about
Click to expand...
Click to collapse
i can verify my theory here, it worked fine with progress_horizontal.xml, which means it should work with any xml

Themeing and CWM FLashable File

Hey guys/girls. I'm creating a theme for Andromeda 3 and one thing I cannot fifure out is how to make my theme CWM flashable to test it.
I opened the zip from a different flashable theme, replaced the framework-res.apk and twframework-res.apk with the modified ones from Andromeda and repackaged them using Winrar. I have followed the guides to resign the APK's and ZIP but no mater what I do, after a reboot I get a solid black screen and the phone vibrates.
Im not sure what I am doing wrong because I thought that was all that went into creating a CWM file.
Thanks in advance......
7 posts under this one
http://forum.xda-developers.com/showthread.php?t=1037842
the meta info is alot more specific than just swap any other files...
Thanks, I found that one about 5 mins ago but couldn't seem to find it when I searched the forum before posting. Must have missed it
Should also point out that if you're decompiling the framework apks with apktool, modifying any of the xml's or code, and recompiling, you'll need to sign the resulting apk or you'll end up with a boot loop.
modest_mandroid said:
Should also point out that if you're decompiling the framework apks with apktool, modifying any of the xml's or code, and recompiling, you'll need to sign the resulting apk or you'll end up with a boot loop.
Click to expand...
Click to collapse
Actually, I'm just opening the apk's with winrar. I make the changes to the folders/files and rezip them with Winrar with Store mode (no compression?) Then I resign them with testsign.jar.
I have read the themeing guides but they are really lacking in the small details dept.
modest_mandroid said:
Should also point out that if you're decompiling the framework apks with apktool, modifying any of the xml's or code, and recompiling, you'll need to sign the resulting apk or you'll end up with a boot loop.
Click to expand...
Click to collapse
Wrong.
Never resign system apks such as framework-res or twframework-res. His problem has nothing to do with the signature.
If you are simply copying over files inside the apk and getting this error, then you are adding more files than was originally inside the apk. I repeat, DO NOT ADD FILES THAT ARE NOT ALREADY INSIDE UNLESS YOU KNOW HOW TO RE-COMPILE THE RESOURCES.ASRC!
Also, use 7-zip to edit apks when you just want to overwrite files. Never unzip, or re-zip. Just right-click > 7-zip > Open Archive > Drag and drop files > close the window > you're done
Edit: Also, this goes in Q&A not General.
ryude said:
Wrong.
Never resign system apks such as framework-res or twframework-res. His problem has nothing to do with the signature.
If you are simply copying over files inside the apk and getting this error, then you are adding more files than was originally inside the apk. I repeat, DO NOT ADD FILES THAT ARE NOT ALREADY INSIDE UNLESS YOU KNOW HOW TO RE-COMPILE THE RESOURCES.ASRC!
Also, use 7-zip to edit apks when you just want to overwrite files. Never unzip, or re-zip. Just right-click > 7-zip > Open Archive > Drag and drop files > close the window > you're done
Edit: Also, this goes in Q&A not General.
Click to expand...
Click to collapse
Ok, thanks man.
Will I need to resign the final theme.zip before flashing it?
Also, can't I just grab the updater-script from another theme.zip and us it in my mine?
ryude said:
Wrong.
Never resign system apks such as framework-res or twframework-res. His problem has nothing to do with the signature.
Click to expand...
Click to collapse
I didn't say anything about resigning? Apktool creates an entirely new, unsigned apk, which unless I'm extremely mistaken you'll need to use if you intend to modify certain resources.
modest_mandroid said:
I didn't say anything about resigning? Apktool creates an entirely new, unsigned apk, which unless I'm extremely mistaken you'll need to use if you intend to modify certain resources.
Click to expand...
Click to collapse
He doesn't need to use apktool, because he isn't edited any code.
timbrendelaz said:
Ok, thanks man.
Will I need to resign the final theme.zip before flashing it?
Also, can't I just grab the updater-script from another theme.zip and us it in my mine?
Click to expand...
Click to collapse
No, you don't have to sign CWM zips because Clockwork doesn't check for a signature.
You could use another updater-script, but the problem with that is if it tries to perform an action on a file or folder that isn't inside your zip it will crash while flashing. You'll be left with a bricked phone and have to ODIN back to restore.
ryude said:
He doesn't need to use apktool, because he isn't edited any code.
Click to expand...
Click to collapse
But what if he is lol? Cause that's what im trying to do and having some issues. Know of a good thread on this? Editing xml that is
Sent from my SGH-T959 using XDA Premium App
TXLunchbox said:
But what if he is lol? Cause that's what im trying to do and having some issues. Know of a good thread on this? Editing xml that is
Sent from my SGH-T959 using XDA Premium App
Click to expand...
Click to collapse
If you're editing code, I recommend using apk manager since it will automatically recompile the resources.asrc for you. Just make sure to downgrade the apktool that comes with it to 1.3.1, 1.3.2 is known to cause problems with xml edits.
1. Set new project apk.
2. Decompile apk, if it's a system apk use the option for dependency apk and use twframework-res.apk as the dependency apk.
3. Edit your xml files.
4. Recompile, when asked use yes twice. It will tell you to delete files in the Keep folder.
5. Delete the resources.asrc if you edited any xml/added new files. Delete the files that you added/edited.
6. Once you're done it will automatically copy over the signature and use the compression that you set (default level 9, I recommend level 0).
Don't worry that it says "unsignedFramework-res.apk", it will work since it's a system apk because system apk signatures get copied over to the new file. Just rename it to Framework-res.apk or whatever you need it to be called.
ryude said:
He doesn't need to use apktool, because he isn't edited any code.
Click to expand...
Click to collapse
Hence the 'if' in my original statement, you know, 'if' he ever chose to in the future.

theme help

can someone please help me I have edited the files I want edited and have used draw9 to set patches...but when I run the xultimate 9 patch compiler I get this error>>> C:\Documents and Settings\H\Local Settings\Application Data\7z.exe is not a valid Win 32 application and I don't know how to fix it...any help would be GREATLY appreciated!!
filthy1 said:
can someone please help me I have edited the files I want edited and have used draw9 to set patches...but when I run the xultimate 9 patch compiler I get this error>>> C:\Documents and Settings\H\Local Settings\Application Data\7z.exe is not a valid Win 32 application and I don't know how to fix it...any help would be GREATLY appreciated!!
Click to expand...
Click to collapse
not sure what going on there. but try this. instead of using ultimatex, decompile with apk manager, make your edits, then recompile the apk. when you use ultimatex to recompile a .9 it wont decompile properly when you want to make future edits.
apk manager
I was able to do this for tge framework but now I am trying to edit my message bubbles in the mms.apk and am honestly a little,confused on how to decompile and recompile apps....
filthy1 said:
I was able to do this for tge framework but now I am trying to edit my message bubbles in the mms.apk and am honestly a little,confused on how to decompile and recompile apps....
Click to expand...
Click to collapse
do you have apk manager??
gunnermike said:
do you have apk manager??
Click to expand...
Click to collapse
Yes sir sure do! Btw thanks for trying to help.
I answered your q&a thread too. Just re/install 7Zip.
Sent from my Droid Charge running GummyCharged 2.0
kvswim said:
I answered your q&a thread too. Just re/install 7Zip.
Sent from my Droid Charge running GummyCharged 2.0
Click to expand...
Click to collapse
I still had it installed while it was giving me an error but I will try.
no go
So I just reinstalled 7zip but it did the same error tried to use apk manager and it won't decompile cause it says I have to extract it first so I extracted it and tried to recompile it and I got error 21 with a bunch of missing images but there is nothing that I changed other than the .9.png's I am so confused that I may just live with a theme I dislike ....
filthy1 said:
So I just reinstalled 7zip but it did the same error tried to use apk manager and it won't decompile cause it says I have to extract it first so I extracted it and tried to recompile it and I got error 21 with a bunch of missing images but there is nothing that I changed other than the .9.png's I am so confused that I may just live with a theme I dislike ....
Click to expand...
Click to collapse
make sure you have the proper frameworks installed. 7z wont do you any good. put in "place here for mods" or something like that, the select option 9 to decompile. now, you cant have any extras. it theres one extra icon it wont recompile. so make sure you account for every icon that goesn in there.
gunnermike said:
make sure you have the proper frameworks installed. 7z wont do you any good. put in "place here for mods" or something like that, the select option 9 to decompile. now, you cant have any extras. it theres one extra icon it wont recompile. so make sure you account for every icon that goesn in there.
Click to expand...
Click to collapse
I don't have a framework....I am just trying to edit the bubbles in the mms.apk to start....and I keep getting an error that tells me check the log if I try to decompile or recompile the mms.apk
filthy1 said:
I don't have a framework....I am just trying to edit the bubbles in the mms.apk to start....and I keep getting an error that tells me check the log if I try to decompile or recompile the mms.apk
Click to expand...
Click to collapse
ok, you need to get some basics. head over to freenode channel #teamsbrissenmod. thats the best place to go to learn how to do this stuff. i will be on for a little bit.
I think i'm going to go there I would like to learn some basics!....*looks forward to some boot camp*
4G LTE Tapatalked
gunnermike said:
not sure what going on there. but try this. instead of using ultimatex, decompile with apk manager, make your edits, then recompile the apk. when you use ultimatex to recompile a .9 it wont decompile properly when you want to make future edits.
Click to expand...
Click to collapse
thats not really true...xultimate does the exact same thing when compiling .9s as if they were compiled with apktool or eclipse
a lot of the .9s i compile in windows (unfortunate byproduct of work) are with xultimate and the decompile fine later
same with android utility in linux
generally its fine to just use apktool to decompile, edit and recompile but this doesnt always work with some apks that just cant be decompiled without errors
nitsuj17 said:
thats not really true...xultimate does the exact same thing when compiling .9s as if they were compiled with apktool or eclipse
a lot of the .9s i compile in windows (unfortunate byproduct of work) are with xultimate and the decompile fine later
same with android utility in linux
generally its fine to just use apktool to decompile, edit and recompile but this doesnt always work with some apks that just cant be decompiled without errors
Click to expand...
Click to collapse
not doubting you, however i have never had a .9 that compiled with apkmanager or tool seperate during decompile, and where as not all .9's compiled with ultimate x seperate, many do. so...i just dont bother with ultimate x. when your apks decompile and recompile properly, it makes future edits much easier.

[Q] What is the best way to change name and icon of android app?

I have been reading about this for awhile and found a lot of different apps out there but looking for the simplest way I can change the app name and app icon. I tried APK editor but it didn't work during save process. Just stated error happened during save process.
maddog75 said:
I have been reading about this for awhile and found a lot of different apps out there but looking for the simplest way I can change the app name and app icon. I tried APK editor but it didn't work during save process. Just stated error happened during save process.
Click to expand...
Click to collapse
Not sure about how to change name, but to change icons all you need is to replace the icons found in res/drawable folder. Anyways the icon's/image's names should be same though. You can do this by simply opening the apk using 7zip or any other zip based software, navigate to the folder and start replacing the files.
coolsandie said:
Not sure about how to change name, but to change icons all you need is to replace the icons found in res/drawable folder. Anyways the icon's/image's names should be same though. You can do this by simply opening the apk using 7zip or any other zip based software, navigate to the folder and start replacing the files.
Click to expand...
Click to collapse
So I am using the GUI based APK TOOK program to decompile it, then changed with notepad plus. Now I recompile it and they are in folder format how to turn back into apk format that is readable by the droid os or by using APK editor to verify the file.
maddog75 said:
So I am using the GUI based APK TOOK program to decompile it, then changed with notepad plus. Now I recompile it and they are in folder format how to turn back into apk format that is readable by the droid os or by using APK editor to verify the file.
Click to expand...
Click to collapse
To change icons, you don't need to decompile and recompile I'm afraid. Like I said before, just change the respective files by opening the apk using 7zip.
coolsandie said:
To change icons, you don't need to decompile and recompile I'm afraid. Like I said before, just change the respective files by opening the apk using 7zip.
Click to expand...
Click to collapse
Well What I am having trouble doing is changing the name, trying to use apktook gui edition but when put back together as a compressed zip file, then put on my phone. I use astro file manager to change the name to .apk keeps telling me having trouble parsing file not sure what I am doing wrong.
maddog75 said:
Well What I am having trouble doing is changing the name, trying to use apktook gui edition but when put back together as a compressed zip file, then put on my phone. I use astro file manager to change the name to .apk keeps telling me having trouble parsing file not sure what I am doing wrong.
Click to expand...
Click to collapse
Maybe the problem is with the signing issues, which you are getting "Error parsing file" error. Try referring this thread:
http://forum.xda-developers.com/showthread.php?t=2213985
And make sure you've done exactly the same way, as mentioned there.
maddog75 said:
...... .apk keeps telling me having trouble parsing file not sure what I am doing wrong.
Click to expand...
Click to collapse
A changed APK needs tot be signed.
Send from N7
NLBeev said:
A changed APK needs tot be signed.
Send from N7
Click to expand...
Click to collapse
What should I use to sign the apk?, is this correct after using apktool and recompiling then compressing folders to zip file, transfer to phone and use astro file manager to rename to apk. What program then should I use to resign it before installing.
maddog75 said:
What should I use to sign the apk?, is this correct after using apktool and recompiling then compressing folders to zip file, transfer to phone and use astro file manager to rename to apk. What program then should I use to resign it before installing.
Click to expand...
Click to collapse
So I will have to try it again didn't work even after signing still gave parsing error. I don't think the gui verision of apktool I used worked right.
maddog75 said:
So I will have to try it again didn't work even after signing still gave parsing error. I don't think the gui verision of apktool I used worked right.
Click to expand...
Click to collapse
are you compiling the .apk or just zipping it?? after decompiling the apk do your edits then recompile.
maddog75 said:
What should I use to sign the apk?, is this correct after using apktool and recompiling then compressing folders to zip file, transfer to phone and use astro file manager to rename to apk. What program then should I use to resign it before installing.
Click to expand...
Click to collapse
http://www.londatiga.net/general/how-to-sign-apk-zip-files/

Gboard size

Hello,
I find the google keyboard size too small , is there anyway to increase its size beyond the highest setting without root? via ADB perhaps?
Thank you
j1978 said:
Hello,
I find the google keyboard size too small , is there anyway to increase its size beyond the highest setting without root? via ADB perhaps?
Thank you
Click to expand...
Click to collapse
You can use Apktool to unsign and decompile your Gboard apk file then edit the size parameters then recompile and re-sign the apk file then install your newly modified apk.
Droidriven said:
You can use Apktool to unsign and decompile your Gboard apk file then edit the size parameters then recompile and re-sign the apk file then install your newly modified apk.
Click to expand...
Click to collapse
Hello,
Thank you for the reply. I have downloaded APKtool and the Gboard APK file.
Could you by any chance point me to a guide on how to do this?
Thank you very much
j1978 said:
Hello,
Thank you for the reply. I have downloaded APKtool and the Gboard APK file.
Could you by any chance point me to a guide on how to do this?
Thank you very much
Click to expand...
Click to collapse
Apktool for PC, not the APKtool app for android.
Open APKtool, select your apk file, find the option to un-sign the apk by removing its signature, then fimd the option to decompile/extract the apk file inside Apktool.
Then you are looking for the lines of code that set the parameters for the size of the keyboard. I don't have a clue which lines of code you're looking for or what to edit, you'll have to figure that out for yourself. I'm just giving you a general overview of what you need to do, you'll have to do some research on your own to understand each step I've described and which lines/values to edit.
After you've edited the parameters for its size, recompile the apk and re-sign the apk then install your new app.
You'll have to use trial and error until you figure it out and get it edited/installed correctly.
Droidriven said:
Apktool for PC, not the APKtool app for android.
Open APKtool, select your apk file, find the option to un-sign the apk by removing its signature, then fimd the option to decompile/extract the apk file inside Apktool.
Then you are looking for the lines of code that set the parameters for the size of the keyboard. I don't have a clue which lines of code you're looking for or what to edit, you'll have to figure that out for yourself. I'm just giving you a general overview of what you need to do, you'll have to do some research on your own to understand each step I've described and which lines/values to edit.
After you've edited the parameters for its size, recompile the apk and re-sign the apk then install your new app.
You'll have to use trail and error until you figure it out and get it edited/installed correctly.
Click to expand...
Click to collapse
Ok! thank you very much for all the info i will give it a try.

Categories

Resources