Hi guys,
Can you tell me how to decode and Encode file AndroidManifest.xml in folder Original after decompiled a apk by apk easy tool ?
Tks!
Link file : drive.google.com/file/d/1IhfDhrEBTTlQA7NzvRBLiDrR3MR8usVT/view?usp=sharing
MinhFtuer said:
Hi guys,
Can you tell me how to decode and Encode file AndroidManifest.xml in folder Original after decompiled a apk by apk easy tool ?
Tks!
Link file : drive.google.com/file/d/1IhfDhrEBTTlQA7NzvRBLiDrR3MR8usVT/view?usp=sharing
Click to expand...
Click to collapse
Weird, AndroidManifest.xml is supposed to be decoded. The fact that it remains in the original folder is weird, did you try doing it with apktool only ? (With apk easy tool)
Super simple, just install apktool (if not already installed and working without apk easy tool)
To test if it's working without APK easy tool open a command prompt and enter "apktool --version", if it returns something, then it's good, if not, you're good to set it up yourself in a separate folder, here is the guide from the apktool website: https://ibotpeaches.github.io/Apktool/
Enter the command "apktool d [name of the apk].apk" to decompile your apk, you should have everything.
And if you don't want to bother your with all of that, I can decompile the APK for you and send you the AndroidManifest.xml file decompiled.
Have a good day
Raiz said:
Weird, AndroidManifest.xml is supposed to be decoded. The fact that it remains in the original folder is weird, did you try doing it with apktool only ? (With apk easy tool)
Super simple, just install apktool (if not already installed and working without apk easy tool)
To test if it's working without APK easy tool open a command prompt and enter "apktool --version", if it returns something, then it's good, if not, you're good to set it up yourself in a separate folder, here is the guide from the apktool website: //ibotpeaches.github.io/Apktool
Enter the command "apktool d [name of the apk].apk" to decompile your apk, you should have everything.
And if you don't want to bother your with all of that, I can decompile the APK for you and send you the AndroidManifest.xml file decompiled.
Have a good day
Click to expand...
Click to collapse
Thanks for your reply, I have tried to decompile that apk by your way but file AndroidManifest.xml in folder ...original\AndroidManifest still be encoded. Can you help me decode it as you said that ?
Link down this apk :drive.google.com/file/d/18HjRivgkNjixCdO823CJD2mxLxr6QuEQ/view?usp=sharing .Remember that I need to decode file AndroidManifest.xml in folder original which contains both of folder META-INF
MinhFtuer said:
Thanks for your reply, I have tried to decompile that apk by your way but file AndroidManifest.xml in folder ...original\AndroidManifest still be encoded. Can you help me decode it as you said that ?
Link down this apk :drive.google.com/file/d/18HjRivgkNjixCdO823CJD2mxLxr6QuEQ/view?usp=sharing .Remember that I need to decode file AndroidManifest.xml in folder original which contains both of folder META-INF
Click to expand...
Click to collapse
That's a huge apk, what is it? 1,2 Gb I've never seen that before. I'll just send you here the AndroidManifest.xml text. You'll then have to copy/past it into a text editor, and rename the file "AndroidManifest.xml".
Edit #1: I can't even decode the APK, can you tell me what is this file and where you got it from ? The apk file size limit is 100MB , what is this file ?
Edit #2 : Usually the AndroidManifest.xml isn't encoded at all, you just have to browse the APK with a zip explorer to find this file and read it. I personally won't do that as this file is very suspicious... 1,3 Gb for an APK... Apktool doesn't recognize it... This is really weird, I recommend you just to trash it.
@MinhFtuer
To decode a binary AndroidManifest.xml file you use axmldec: Android Binary XML Decoder.
jwoegerbauer said:
@MinhFtuer
To decode a binary AndroidManifest.xml file you use [github.com/ytsutano/axmldec"] axmldec: Android Binary XML Decoder[/url].
Click to expand...
Click to collapse
Great, I can do it by your way, can you teach me how to encode back it tks ?
Related
things you'll need
APK MANAGER
7zip
DESCRIPTION :
Q : Basic
A : The icons are stored in the Drawable-mdpi folder in the framework.
these icons are linked to XML's in Drawable folder
if you just add the icons and don't change the xml, you'll get nothing.
Q : Why Cant we just Edit the XML files?
A : The XML files are encrypted. if you try to edit it you will get weird characters.
Q : No XML No Edits, Are we Done?
A : Yes, No XML No Edits. But we've a walkaround. The APK MANAGER
it decompiles the apk and unencrypts the xml file.
BASIC :
Extract the contents of APK MANAGER to any folder
you'll have few folders
place your apk in the place-apk-here-for-modding folder
open Script.bat
and chose option to decompile and minimize
it will create a folder namely PROJECTS
now you can edit the xml files
after your done, maximize the apkmanager window and choose comiple apk
HOW TO ADD MORE PNGS :
if you want to add pngs like the battery percentage you'll need to link the png to the xml file
this can be done by two ways
1. assigning resource_id
&
2. directly putting in the names
the 1st method is easy but complex so forget it
the second method is simpler.
just find the xml file corresponding to the png and than simply add the name.
for eg.
stat_sys_battery.xml is the battery status xml.
<item android:drawable="@drawable/stat_sys_battery_0" android:maxLevel="0" />
Click to expand...
Click to collapse
here the
android:drawable is the android code
and
@drawable/stat_sys_battery_* is the file location
check the attachment for better understanding
Click to expand...
Click to collapse
THE PROBLEM & THE SOLUTION :
if you try to edit any modded framework file you'll get error while compiling.
and your phone will hang if you use that file.
SOLUTION
instead of using modded file. use the STOCK framework. Edit your files and compile your apk
now when you compile it, it will give you few options
1. is it a system file [y/n]
choose yes
2. (...blah blah.. do you wish to keep files)
choose yes
now it will extract the stock (unedited) framework in a KEEP folder
minimize the window
open the folder and delete all the files you modified.
if you had modified xml file you'll also need to delete resources.asrc
now maximize the apkmanager window and press any key.
your modded apk will be compiled in the place-apk-here-for-modding folder
PS : IT WOULD BE UNSIGNED
LAST STEP :
open the compiled unsigned apk and extract all the files you edited (including resources.asrc)
simply replace these files in the framework-res.apk you wanted to mod
only part to take care is the resources.asrc file you don't have to replace it directly
do this steps for replacing resources.asrc
1. right click the resources.asrc
2. select add to archive
3. archive format zip
4. compression method Store
5. select the path of your framework-res.apk
I know this all seems way to complex but if you read carefully and do it step by step, its all easy as a PIE
I'm trying to decompile a few apks for modifying the dialer on an ICS rom. When I go to decompile I get an empty folder and this error:
I: Baksmaling...
Exception in thread "main" java.lang.RuntimeException: bad magic value: 64 65 78 0a 30 33 36 00
at org.jf.dexlib.DexFile.<init>(DexFile.java:377)
at org.jf.dexlib.DexFile.<init>(DexFile.java:274)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:44)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)
at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
I'm using this ver: http://forum.xda-developers.com/showthread.php?p=22845681
All I would like to do is edit a few xml files to change the color on text. Anyone have any idea on what the issue is? Could I just rename the apk to .zip and extract the files to be edited?
There's another you can edit APK's.
- Extract the apk
- Modify the files in the folder you get after extracting
- Right click on the original APK and open it with 7zip ( click on "open archive " )
- Drag the edited file from the folder to the original APK and overwrite it.
With this method you don't need to decompile and then recompile !
Sent from my GT-I9003 using xda premium
Use the proper one, not an auto tool. download the latest apktool and make sure you add the framework files needed
thanks! it turned out I needed to use a different jar file from here http://forum.xda-developers.com/showthread.php?p=23483528 for the new ICS roms. So far so good but I'll definitely try the ways you mentioned. seems abit easier. appreciate the feedback.
New issue: when I try and compile it, all I get is a classes.dex file so I tried copying the files to the original apk with 7zip and whenever I flash the zip and try and access the dialer/phone app, i get an acore.process error and it force closes. All I did was edit some pngs and change some color values in a few xml's.
killerb777 said:
New issue: when I try and compile it, all I get is a classes.dex file so I tried copying the files to the original apk with 7zip and whenever I flash the zip and try and access the dialer/phone app, i get an acore.process error and it force closes. All I did was edit some pngs and change some color values in a few xml's.
Click to expand...
Click to collapse
I never had a problem doing this method!
What I did was :
After changing the files and putting them on the original APK
I just replaced it with the original one by going in System/App
And rebooted!
It worked everytime!
Don't flash, just replace it!
But take a backup of the original one before you replace!
I don't want to use APK Multi-Tools or APK_Manager or whatever. I want to know exactly what those tools are doing in order to recompile the system apk while keeping the original signature.
What I initially did...
Code:
apktool d "%~dpnx1.apk" "%~dpnx1"
...modify files here...
apktool b "%~dpnx1" "%~dpnx1.apk"
But obviously that's unsigned. I need to sign it, but I want to use the original signature, which I'm guessing is the META-INF stuff, right?
So I attempted this...
Code:
apktool d "%~dpnx1.apk" "%~dpnx1"
7za x -o"%~dpnx1-signature" "%~dpnx1.apk" META-INF -r
...modify files here...
apktool b "%~dpnx1" "%~dpnx1.apk"
7za a -tzip "%~dpnx1.apk" "%~dpnx1-signature/*" -mx9
You'll notice I now use 7-Zip to pull out META-INF from the original APK and then insert it back into the recompiled one afterwards.
The only other thing I can think of would be to go with my first method, but then use 7-zip to pull out the compiled files from the unsigned apk and insert them into the signed apk. I haven't tried that yet, but it will be the next one I go with. Every time this fails, though, I have to do a nandroid restore, and it's getting a little frustrating, which is why I'm asking you folks.
--
edit: I got it all figured out.
For those interested, after running "apktool b" (to build/compile), ignore the output zip. Instead go into the source directory and there is now a build directory. In that is an apk directory. Simply add your changed files to the original untouched APK (if you modified any XML files, then replace resources.arsc; if you added anything to smali, then replace classes.dex; if you added any XML files, then you need to include those as well; for me, i copied resources.arsc, classes.dex, and one new XML file). I used the following command:
Code:
zip -9 ..\SystemUI.apk res\layout\status_bar.xml classes.dex resources.arsc
I use zip instead of 7za for cosmetic reasons. You can also use "7za a -tzip etc..." if you want.
hello i know how you feel well....i never did.
you keep a backup and a copy of your system apk and once you did your changes look in your copy and go to /res and delete the destinations you modded and putted them in the modded apk now look into your modded apk file in /res and take the files you deleted from the copy apk and move them to the copy apk and your all set.
if this didnt understand ill show you an awesome thread that will help you
sorry i didnt see your edited section
So i have this Deskclock.apk and i want to add this.
No Problem with the ".xml" Files. I can edit them easily after i decompile the apk with the "apkTool". But where will i find the ".java" Files? After decompiling the apk i only see ".smali".
So i found out that the ".java" files are in "classes.dex" from the apk.
I use "dex2jar" to get a ".jar" File.
Then i use "jd-gui" to get ".java" Files.
So i can edit it and put the needed Strings in the .java files.
But how to put them back to a "classes.dex" File which i can put back to the apk??
I hope i get a bit help here.
You can use APKTool. It will automaticly extract all the classes (.dex), resources (.asrc), then it will convert binary XML to human-readable XML, and it will also dissassemble the classes for you.
Just tell APKTool to decode the APK into a directory, then modify what you want, and finally encode it back to an APK. That's all.
Important: APKTool dissassembles. It doesn't decompile. The generated code won't be Java source. But you should be able to read it, and even edit it if you're familiar with jasmin. If you want Java source, please go over the Manual way.
Sent from my VS910 4G using XDA
Thx...I know how to use APKTool but i need to put the ".java" Files back into the "classes.dex". Thats my Problem.
There's info on the process here: http://stackoverflow.com/questions/10261147/converting-java-back-to-classes-dex
Essentially it looks like you need to compile the .java to .class files with javac and then create classes.dex with dx. Hope this link is helpful.
Hello everyone,
I hope I'm posting this to the right forum.
Up until Android 4.4 KitKat we were able to use apktool for decompiling an apk, making modifications and then recompiling it.
In case we were dealing with an ODEXed ROM, we could also use backsmali and various other tools to deodex before using apktool.
Now, in Lollipop, which uses ART, we get an APK file, but also a .odex file in a '/arm' subfolder.
From what I've read so far, that's not really an odex file, but rather an Android runtime .OAT file.
My question is - how does this affect our abilities to edit APKs?
Is it possible to "deodex" the OAT file to get an all-inclusive APK to use with apktool? If so, how?
After we rebuild the APK, can we just run it 'deodexed' or do we need to recreate an OAT file?
Any insight would be appreciated
purpleman2k said:
Hello everyone,
I hope I'm posting this to the right forum.
Up until Android 4.4 KitKat we were able to use apktool for decompiling an apk, making modifications and then recompiling it.
In case we were dealing with an ODEXed ROM, we could also use backsmali and various other tools to deodex before using apktool.
Now, in Lollipop, which uses ART, we get an APK file, but also a .odex file in a '/arm' subfolder.
From what I've read so far, that's not really an odex file, but rather an Android runtime .OAT file.
My question is - how does this affect our abilities to edit APKs?
Is it possible to "deodex" the OAT file to get an all-inclusive APK to use with apktool? If so, how?
After we rebuild the APK, can we just run it 'deodexed' or do we need to recreate an OAT file?
Any insight would be appreciated
Click to expand...
Click to collapse
Files needed:
1. bootoat2dex.jar
2. Cygwin
3. APKTOOL
4. Java will need to be installed also
Install Cygwin and run it once so your userfolder is created, will be in c:/cygwin/home/<User Name>
Copy bootoat2dex.jar into this folder
Go to priv/app/SystemUI/arm/ and use 7zip to extract SystemUI.odex from the SystemUI.odex.xz file
Copy SystemUI.odex to your cygwin folder c:/cygwin/home/<User Name>/
Open cygwin and run the following command:
java -jar bootoat2dex.jar SystemUI.odex
This will output 2 folders dex and odex, if you look in the odex folder you should see SystemUI.odex.
Rename this file to classes.dex and drop it into the SystemUI.apk file
Follow the same instructions for the twframework-res.odex file also.
now copy the files SystemUI.apk, framework-res.apk and twframework-res.apk into you apktool folder and install framework ex. apktool if framework-res.apk, apktool if SystemUI.apk, apktool if twframework-res.apk
After the framework install you should be able to decompile SystemUI.apk, you should be able to do this with all the apk files.
C13v3r0n3 said:
Files needed:
1. bootoat2dex.jar
2. Cygwin
3. APKTOOL
4. Java will need to be installed also
Install Cygwin and run it once so your userfolder is created, will be in c:/cygwin/home/<User Name>
Copy bootoat2dex.jar into this folder
Go to priv/app/SystemUI/arm/ and use 7zip to extract SystemUI.odex from the SystemUI.odex.xz file
Copy SystemUI.odex to your cygwin folder c:/cygwin/home/<User Name>/
Open cygwin and run the following command:
java -jar bootoat2dex.jar SystemUI.odex
This will output 2 folders dex and odex, if you look in the odex folder you should see SystemUI.odex.
Rename this file to classes.dex and drop it into the SystemUI.apk file
Follow the same instructions for the twframework-res.odex file also.
now copy the files SystemUI.apk, framework-res.apk and twframework-res.apk into you apktool folder and install framework ex. apktool if framework-res.apk, apktool if SystemUI.apk, apktool if twframework-res.apk
After the framework install you should be able to decompile SystemUI.apk, you should be able to do this with all the apk files.
Click to expand...
Click to collapse
Great info! Thanks! I have used oat2dex.py to extract the OAT file, baksmali'd, modified smali code, recompiled it but that's where I'm stuck. How do I get it back into the original OAT format for inclusion in an Odexed rom? Any help would be greatly appreciated.
P.S. I'm working with SystemUI.odex.
jermaine151 said:
Great info! Thanks! I have used oat2dex.py to extract the OAT file, baksmali'd, modified smali code, recompiled it but that's where I'm stuck. How do I get it back into the original OAT format for inclusion in an Odexed rom? Any help would be greatly appreciated.
P.S. I'm working with SystemUI.odex.
Click to expand...
Click to collapse
I haven't been able to find anything that will take the files the other direction.