[Q] Issue decompiling apk with apk manager - HTC Sensation

I have apk manager 5.02 which I can de-compile framework and recompile with out any issues.
I downloaded the stock 2.08 sense 3.5 rom and used explore2fs to extract the contents of the system.img file. From there I then put htcdialer.apk file into apk manager to decompile it and I get the following errors:
See attached log file as it is too big to put into the forum.
Any ideas why the apk file is not decompiling?

I dont hink that apkmanager can correctly decompile sense 3.5 apks, I could be wrong but i could never get them to work properly

If APK Manager and Tool cant extract even GB ROM apks is there a way of extracting and editing xml files? I tried 7zip and I can edit images but XML's do not extract correctly

Really interested to see how to edit XML files if APK Manager and APK Tool cant decode the APK's.

Found out what I was doing wrong!! When decompiling the apk file I wasn't adding the dependancy. So for example when I was decompiling the systemui.apk, I was simply using option 9 to decompile which is not right!
What you need to do is copy the systemui.apk file in to place-apk-here-for-modding
Then find the dependency framework so for example the systemui.apk depends on com.htc.recources.apk. So pull this from your phone on to the desktop and then use option 10 to decompile. It will then prompt you for the dependancy apk file. Drag that on to the command window and press enter and it decompiles! It is easy when you know how

Also when you recompile you will probably get errors...You need to take the newly created classes.dex and drop it into the original apk then push to your phone

Where can I find the dependency file??
I got the same problem when I try to Decompile any system app, like "SystemUI.apk" or "Settings.apk" ...etc
Now I understand from you that I need a dependency file, Where can I get it??
I use Samsung Galaxy SL (I9003), Rooted and Deodxed

i use samsung galaxy mini. can i use apkmanager to decompile any apk for my device......by pressing 9 directly.....? i want to decompile settings.apk....thnx in advance......

Related

Odex and repacking

Hi there,
I has disassembled an odex file and changed something. As I understand I can't make it an odex again but I must make a dex file and put this with the filename classes.dex in the apk file.
Can I just put it in the apk file and just sign the package again or do I need first to convert the binary xml files from the apk to normal files and then pack the apk file back?
Thanks

Can't recompile settings.apk

Sorry if this is a duplicate or in the wrong place, but i cant find any solutions.
I am having trouble recompiling the settings.apk. I decompile it without problems but the apk can't recompile unless I paste in the .arsc file from the stock apk (by unziping). The problem is that when I edit the xml, it needs to make a new .arsc file since I edited xml within the layout folder.
I am using apktool and have had no problems with other apk files. This is on the Samsung galaxy player 5.0 USA.
Another note, if I decompile, put in the resources.arsc file, and recompile, the new apk file is smaller. In addition, if I unzip the recompiled apk I can edit the xml w/o a problem. This is weird because when I unzip the stock settings.apk the xml files are un-readable.
Any Ideas about what I am doing wrong?
Sorry for being a noob.
tchen510 said:
Sorry if this is a duplicate or in the wrong place, but i cant find any solutions.
I am having trouble recompiling the settings.apk. I decompile it without problems but the apk can't recompile unless I paste in the .arsc file from the stock apk (by unziping). The problem is that when I edit the xml, it needs to make a new .arsc file since I edited xml within the layout folder.
I am using apktool and have had no problems with other apk files. This is on the Samsung galaxy player 5.0 USA.
Another note, if I decompile, put in the resources.arsc file, and recompile, the new apk file is smaller. In addition, if I unzip the recompiled apk I can edit the xml w/o a problem. This is weird because when I unzip the stock settings.apk the xml files are un-readable.
Any Ideas about what I am doing wrong?
Sorry for being a noob.
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=2251719

Theming android...

I'm currently trying to make a theme for my motorola xoom. I could theme framework res without problems...i have decompiled it edited what i want recompiled and then put the edited res assign and resources.arsc with the manifest from original framework and then ziped it and renamed to apk...and it worked...but i cannot edit any non framework apk...my system say application not installed and im using the same method as for framework.....also what is classes.dex file? should i leave it untouched or change it to that one apktool made?

How to guide decompiling/compiling systemUI.apk

If you are not having problems compiling SystemUI.apk with no problems then this is not for you
WARNING:
You should not attempt to do this on a device that does not have a recovery, because if something goes wrong you may have to reinstall your rom (not very likely though). You should probably back up SystemUI.apk You should also have some experience modding and some experience using Apktool and Linux.
INTRO:
If your having problems modding SystemUI.apk on JB then this thread is just for you. I recently found out how to mod the Jelly Bean SystemUI. Jelly Bean has made it very difficult to mod. Yes it is still easy to replace images, but if you want to do some major changes to the UI such as a 100 percent battery mod or changing the status bar color then you will need to know exactly how to do it. For example, if you get the UI decompiled without errors and you recompile it without errors YOUR RECOMPILED SystemUI.apk WILL NOT WORK and your status bar will disappear etc... There is a special way to get everything working and I will show you how.
STEP 1:
LINUX>>
Before we start I recommend that you have File Roller: one of the most popular archive managers for Linux (Ubuntu comes with it). If your distribution uses a Debian package manager (most popular ones do) then all you have to do is go into the terminal and type:
Code:
sudo apt-get install file-roller
Now you will have File Roller. You also will need java installed. Check if you have java by typing:
Code:
java
in the terminal. If you dont have java and your using a Debian package manager then type:
Code:
sudo apt-get install openjdk-6-jre
or download from the java website and install it.
WINDOWS>>
Before we start, you will need 7zip and java. Just search and you will find the programs to install
STEP 2:
Now we will install APKTOOL. You may already have it installed BUT your version will probably not work. I have ran around the internet for a modified apktool that wont give you errors (If you follow my directions). I came across a great thread. check it out and download all the tools their (dont forget aapt) http://forum.xda-developers.com/show....php?t=1755243. If you are in Linux rename the jar file to apktool.jar and move the the jar plus aapt to /usr/local/bin. You will need root. If you are in Windows rename the jar to apktool.jar and move it and aapt to your WINDOWS directory. You also need zipalign http://powerpoint45.webs.com/android/zipalign(I think this one is only for linux so if ur on windows either test this one or get zipalign from android sdk)move it to your WINDOWS dir/bin dir. You need one more thing. It is from the apktool websitehttp://code.google.com/p/android-apktool/. According to your os download either apktool-install-linux-r04-brut1.tar.bz2 or apktool-install-windows-r04-brut1.tar.bz2. Extract the contents. You only need one file from the archive. In linux move apktool (not apktool.jar) to /usr/local/bin. In Windows move apktool.bat to your WINDOWS directory. Dont jump ahead and say "Now that I got apktool set up, I know what to do", because it gets a lot more difficult than you are used to using apktool.
STEP 3:
Now that you have apktool set up, you need to know how to mod SystemUI.apk. Get SystemUI.apk from /system/app within your device onto the computer. Now make a backup of SystemUI.apk on your computer because we will NEED it later. So you need two SystemUI.apk files on your computer. You could name one “backup” if you'd like. So now now we need to decompile the apk. Go into the terminal/cmd and cd/chdir into the directory you have SystemUI.apk. Now type
Code:
apktool if SystemUI.apk
It will then install frameworkneeded.Then type:
Code:
apktool d SystemUI.apk
It will decompile the apk. It will take a bit of time for it to fully decompile. The decompiled code will be in a folder in your current directory called SystemUI. If It had errors decompiling, (IT WILL FOR MOST NEXTUS 7 ROMS) you will need to install framework manually. Download framework here:http://db.tt/Rpc6zskQ and place the two APK files into apktool framework folder (replace the old framework files). In Linux it is located at /home/yourusername/apktool/framework and in windows it is something like C:\\Documents And Settings\yourusername\apktool\framework. After that delete the SystemUI folder that was made by the bad decompiling proccess and repeat the decompile command.
STEP 4:
This is the part where you start modding. You can make many customizations to the UI this way as you probably know. I will just show you how to make a 100 percent battery mod. You need to go into the decompile folder (SystemUI) using a file manager, Then from SystemUI, go delete res/drawable/stat_sys_battery.xml and replace it with http://powerpoint45.webs.com/android...ys_battery.xml (to download that file right click on link and click something like "save link as"). Now you need to move to a new directory: /res. In that folder you need to look through all the directories that start with the word drawable. For example drawable-mdpi. There is one directory that your device uses for images but you may not know which one. Your device might be MDPI but use drawable-sw600dp from the UI instead of drawable-mdpi. So if you dont know or you want to be safe then search through the drawable folders and if their are any battery icons then remember you will need to add 100 battery icons to each one of the folders with battery icons. The battery icons are the ones named something like stat_sys_battery_0.png. So if you need to add 100 icons they need to be named in numerical order from stat_sys_battery_0.png to stat_sys_battery_100.png. Dont worry though, you wont need to rename 100 icons. Their ar many battery mods online that you can get them from, but I have some images you can download: http://powerpoint45.webs.com/android...RY_BLUE.tar.gz. Download it, extract it and copy all the images into all the drawable folders that contain battery icons. Now your ready for compiling; The step that is different than how we have always done it before Jelly Bean existed. keep in mind that some images can not be changed or edited at all durring this step because it will result with many errors durring compiling. You would have to add images to the archive after its compiled
STEP 5:
Like I said at the end of step 4, this step will be different than you have seen before. This is also the step where you will be using File Roller/7zip. To build the apk make sure you are in the terminal in the directory where SystemUI exists and type:
Code:
apktool b SystemUI almostdone.apk
almostdone.apk is the output file. Once it is done building you need to open the backup apk you made at the beginning with File Roller /7zip. Also open almostdone.apk with File Roller/7zip. From inside the backup.apk drag meta-inf folder & androidmanifest.xml to allmostdone.apk. Now all you need to do is zipalign the apk. Lets say your backup apk is named backup.apk. Go into the terminal at the directory you are working
in and type
Code:
zipalign -v 4 allmostdone.apk done.apk
This will optimize the apk. The output is done.apk.
STEP6:
Now you install the apk. Their are many meathods of installing the apk, here are a couple. Transfer done.apk to your device and rename it to SystemUI.apk. Now use a root browser or terminal app to replace the other SystemUI.apk on your system at /system/app. And make sure you give it the same permissions as all the other apk's in the system/app directory. Then reboot. Or you could make a flashable zip to install it.

[Q] Edit SettingsProvider.apk to enable an option by default

Hi i want to enable "Unknown Sources" by default, when a ROM flashed.
I know that i need to modify the SettingsProvider.apk, and exactly the file settingsprovider.apk/res/values/bools.xml
Code:
<bool name="def_install_non_market_apps">true</bool>
when i edit this file, and repack, e resign the file, i flash the rom, and the phone not startup, freeze on loading bootanimation.
I use apktool 1.5.2
brunosso said:
Hi i want to enable "Unknown Sources" by default, when a ROM flashed.
I know that i need to modify the SettingsProvider.apk, and exactly the file settingsprovider.apk/res/values/bools.xml
Code:
<bool name="def_install_non_market_apps">true</bool>
when i edit this file, and repack, e resign the file, i flash the rom, and the phone not startup, freeze on loading bootanimation.
I use apktool 1.5.2
Click to expand...
Click to collapse
After you compile it open the modified settingsprovider.apk as an archive with 7zip or winrar and pull out the res folder and then take the original settingsprovider.apk and open that with 7zip or winrar and replace the res folder with the modified res folder you pulled out of your modified apk. You can use VTS to decompile and recompile and key old signature and that will work too.
mkinney88 said:
After you compile it open the modified settingsprovider.apk as an archive with 7zip or winrar and pull out the res folder and then take the original settingsprovider.apk and open that with 7zip or winrar and replace the res folder with the modified res folder you pulled out of your modified apk. You can use VTS to decompile and recompile and key old signature and that will work too.
Click to expand...
Click to collapse
didn't work
is there other solution ?
i want to edit settingsprovider for Android10

Categories

Resources