I am trying to modify the stock SecWallpaperChooser and i am facing a problem. Everytime i add the wallpaper, edit the xml files(array.xml) and copy it to the system phone. But the wallpaper dont get added. After editing the apk and recompiling the apk i transferred the META_INF and Androidmanifest.xml from original to modified apk. I deleted the public.xml before recompiling the apk since i had read that it gets created each time and it gives the id automatically.
Even after doing that all thing, the wallpaper is not showing up in the display option under settings. Can someone pls tell me how to modify that apk so that i can correct my mistake.
P.S:-I decompiled my modifed apk to see whether the wallpaper was added to the corresponding folders and it was present there. I used SysFileCopymaster app to copy that apk to the system folder.
Parameswaran Iyer said:
I am trying to modify the stock SecWallpaperChooser and i am facing a problem. Everytime i add the wallpaper, edit the xml files(array.xml) and copy it to the system phone. But the wallpaper dont get added. After editing the apk and recompiling the apk i transferred the META_INF and Androidmanifest.xml from original to modified apk. I deleted the public.xml before recompiling the apk since i had read that it gets created each time and it gives the id automatically.
Even after doing that all thing, the wallpaper is not showing up in the display option under settings. Can someone pls tell me how to modify that apk so that i can correct my mistake.
P.S:-I decompiled my modifed apk to see whether the wallpaper was added to the corresponding folders and it was present there. I used SysFileCopymaster app to copy that apk to the system folder.
Click to expand...
Click to collapse
You can try something like this: http://forum.xda-developers.com/showthread.php?t=1684472
shut_down said:
You can try something like this: http://forum.xda-developers.com/showthread.php?t=1684472
Click to expand...
Click to collapse
I did the same thing and its not working. There is a file named array.xml in values folder which has the following code. I did not edit it.
Code:
<?xml version="1.0" encoding="utf-8" ?>
- <resources>
<array name="extra_wallpapers" />
</resources>
I edited the array.xml file inside 'values-sw320dp-hdpi' and 'values-hdpi' folder. Do i need to edit the array file with above mentioned code? If no, then this is not working atleast for me. If yes, then can you pls tell me how. I had decompiled the SecWallpaperChooser apk inside the LightJB rom to see which all files the developer had edited and i found that it was only the two files which I have already mentioned
Thank You for your help
P.S:- Do i need to sign the apk? I had read somewhere that signing system apks might create a problem
Parameswaran Iyer said:
I did the same thing and its not working. There is a file named array.xml in values folder which has the following code. I did not edit it.
Code:
<?xml version="1.0" encoding="utf-8" ?>
- <resources>
<array name="extra_wallpapers" />
</resources>
I edited the array.xml file inside 'values-sw320dp-hdpi' and 'values-hdpi' folder. Do i need to edit the array file with above mentioned code? If no, then this is not working atleast for me. If yes, then can you pls tell me how. I had decompiled the SecWallpaperChooser apk inside the LightJB rom to see which all files the developer had edited and i found that it was only the two files which I have already mentioned
Thank You for your help
P.S:- Do i need to sign the apk? I had read somewhere that signing system apks might create a problem
Click to expand...
Click to collapse
For signing - you just get back META-INF folder from original apk. I am not sure about first thing you asked, I never tried to modify it.
I used Android Multitool for decompiling and recompiling and after recompiling it asked me to copy the META-INF and androidmanifest.xml files to new apk. I also tried to copy the apk without those files and it resulted in bootloop. Hence it is sure that i have to copy those files and as said i have already edited all necessary files.
Is there any developer or anyone who could confirm whether I have to edit the array.xml inside the values folder(The file with the above code)?
I would be glad if anyone could point out my mistake so that I can rectify it.
Parameswaran Iyer said:
I used Android Multitool for decompiling and recompiling and after recompiling it asked me to copy the META-INF and androidmanifest.xml files to new apk. I also tried to copy the apk without those files and it resulted in bootloop. Hence it is sure that i have to copy those files and as said i have already edited all necessary files.
Is there any developer or anyone who could confirm whether I have to edit the array.xml inside the values folder(The file with the above code)?
I would be glad if anyone could point out my mistake so that I can rectify it.
Click to expand...
Click to collapse
I know when you compile new apk - you must copy that META-INF folder. If you do not do it you will end up with a bootloop.
Why don't you try that app from the link I gave you? It is not guide for modification of TW app, it is separate app.
Here is some explanation for TW wallpaper chooser editing: http://technology-shettyprasad.blogspot.com/2013/01/adding-more-wallpapers-to.html?m=1
You must have wallpaper with exact resolution and its thumbnail. Also you need to add it to that array.xml
Ok. I just noticed that when i decompile the SecWallpaperChooser apk from LightJB rom, a build folder is created but that folder is not in the stock apk. Can someone one explain why? And do i need to make that folder while modifying?
Parameswaran Iyer said:
Ok. I just noticed that when i decompile the SecWallpaperChooser apk from LightJB rom, a build folder is created but that folder is not in the stock apk. Can someone one explain why? And do i need to make that folder while modifying?
Click to expand...
Click to collapse
I just tried to do it by that guide I sent you. This one: http://technology-shettyprasad.blogspot.com/2013/01/adding-more-wallpapers-to.html?m=1
So do this:
1.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2.
And you have apk that I made in attachemnt. I added some picture with some bottle on the beach. See if it works.
I am on CM11, so I think that I can't use TW wallpaper chooser on it to try if it works.
P.S. You have my folders path in those screenshots. For that last question.
And file was from Slim-JB ROM. But it should be the same you use.
Doesn't work buddy. Each time I copy META-INF folder and androidmanifest.xml file the apk's name changes to false which it shows in the installer screen. I know that system apks cant be installed through installer but just to check the apk is properly made I saw the name in installer and it shows false. Once i signed the apk and copied it to the system. It successfully replaced the default SecWallpaperChooser but faced FC.
Parameswaran Iyer said:
Doesn't work buddy. Each time I copy META-INF folder and androidmanifest.xml file the apk's name changes to false which it shows in the installer screen. I know that system apks cant be installed through installer but just to check the apk is properly made I saw the name in installer and it shows false. Once i signed the apk and copied it to the system. It successfully replaced the default SecWallpaperChooser but faced FC.
Click to expand...
Click to collapse
Have you tried mine apk?
shut_down said:
Have you tried mine apk?
Click to expand...
Click to collapse
Yes I tried your apk and it worked for that apk. I decompiled it, added and edited the required files and recompiled it and signed. And it worked very well. Thanks for that. But I want to modify the stock apk and this method is not working for some reasons or the other. I am still trying to modify it in some way but its not working.
Yes!!! Finally did it. My first apk modification. A small one but i think a decent start. Modified the public.xml instead of deleting it and copied the file to system using root explorer. The same apk did not work with it. Though I modified the SecWallpaperChooser from the LightJB(Sorry I did not take permission before editing) rom but i am sure that it will work with the stock one too. Will give that a try too.
P.S:-Worked with stock too. And SysFileCopymaster works for our device too.
Just one thing. Can you tell me how to make flashable zip for our phone? How do I make META_INF folder? Can i take it from some other rom? And just by creating zip file of folder will it become flashable?
Related
Here is a pack of 3 files that, if pushed to your rom will give you the white task bar. This will change status icons and is just a work in progress "fill in the the gap" type of thing until I can write a proper update script for an update.zip. Currently this has only been tested to work 100% with:
Evil Eris 2.0.1 (It will, however, break the Sense launcher. So if you want the white bar, use another launcher)
Ic3Rom 2.0
It DOES NOT work on
TaintedVanilla 1.3.1
Or any rom that has it's System/Framework apk's and jar's odexed.
Please let me know if it works with any others.
Also, please not that this will change the status bar highlights to green.
http://www.multiupload.com/4YV5D61YRX
Click to expand...
Click to collapse
Just push the three files and reboot. Reboot will take about 5 min, so don't freak out if it takes forever. If you get into a boot loop, however, it didn't work.
DISCLAIMER: I'm not responsible if this bricks your phone. Please don't yell at me if it does. Also, be smart: do a nandroid backup before you try this.
Click to expand...
Click to collapse
This tutorial is for a white menu bar. It's still kind of a work in progress, but it works for the most part. When done, it looks like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Ok. Here is the extremely long way to do this, but it should work with any rom and will give you a full (date/time/notifications) white/vanilla task bar.
(Seriously, this may take 30 minutes or more if you're unfamiliar with some of these commands)
DOWNLOAD: http://www.multiupload.com/VZWCE0A0FN
Unzip the files and there should be 4 folders and 1 file: framework-res, com.htc.resources, PCSCII, Tools, and StatusBarIcon.smali.
Also included are the tools needed to crack open the .dex file from services.jar, smali.jar and backsmali.jar
First you'll need to pull the proper files to modify from whatever rom you're using. Open up your command line program of choice and do this:
cd [your tools folder in the android sdk]
adb remount
adb pull /system/framework/framework-res.apk framework-res.apk
adb pull /system/framework/com.htc.resources.apk com.htc.resources.apk
adb pull /system/app/PCSCII.apk PCSCII.apk
adb pull /system/framework/services.jar services.jar
Click to expand...
Click to collapse
Copy all these files into a new folder.
Things can get messy so name them whatever you'd like to keep things organized.
After all this you can start copying files. First we need to open up services.jar. Easiest way is to change the .jar ending to .zip and expand it with whatever program you'd like. Copy the classes.dex into a new folder. Keep the original folder of the expanded services.jar, it makes things easier in a few minutes.
Here is where things get a little complicated. You'll need to open up the classes.dex file with backsmali.jar. First, make sure Backsmali.jar is in the same folder as classes.dex. Next enter this command into the terminal:
cd [the folder with backsmali and classes.dex file]
java -Xmx512M -jar baksmali.jar -o classes/ classes.dex
Click to expand...
Click to collapse
This will expand classes.dex into a folder. Click through this folder until you find a folder called Status. Now drag the StatusBarIcon.smali into the Status folder. Allow the replacement.
Now we need to close the classes.dex file back up. Make sure smali.jar is in the same folder as the classes folder (make a new folder just to avoid a conflict with your original files) and use these commands:
cd [the folder with smali and the classes folder]
java -Xmx512M -jar smali.jar -o classes.dex classes/
Click to expand...
Click to collapse
You should have a fresh classes.dex file now. Now put this new classes.dex file into the original services.jar folder (that you expanded from a zip) and rezip that file. Then change the name from a .zip to .jar.
Step 1: done.
The next few parts are a lot easier, so stick with me here.
Now we need to open up the Framework-res.apk and replace all of the image files needed for a sexy white menu bar. All of the needed files are in the folder named (you guessed it) framework-res. First, you'll need to expand this .apk, do so by changing it into a .zip. After you expand it, copy the files from my folder to the matching folders. Don't drag and drop the folders, it won't work. Select all inside them and paste/drag/whatever over to the one from your phone. There should be a folder of image files, and a folder with two xml files. Once done return to the top folder of the framework-res.zip you expanded and re-zip the contents. Make sure you select the contents and zip them.
**DO NOT ZIP THE FRAMEWORK-RES FOLDER ITSELF, SELECT THE FILES INSIDE THE FOLDER AND RE-ZIP THEM**
You should now how have a new archive. Rename it to framework-res.apk and set it aside for later use.
The last parts are essentially the same things, but with the other two folders I've included: PCSCII and com.htc.resources. Copy the files, and re-zip them into .apk files.
Ok. Almost done.
Now it's time to send the files back to your phone. Place the new versions of these files into your Tools folder in the Android SDK.
Now let's push them back to your phone:
cd [your tools folder... again]
adb remount
adb push PCSCII.apk /system/app/PCSCII.apk
adb push framework-res.apk /system/framework/framework-res.apk
adb push com.htc.resources.apk /system/framework/com.htc.resources.apk
adb push services.jar /system/framework/services.jar
adb reboot
Click to expand...
Click to collapse
Reboot can take a while, so be patient. I'm thinking rebooting into recovery and clearing your dalvik cache may help, but haven't tried it.
If everything worked correctly, you should have a brand spankin' new notification bar.
Just a note, I have tested this on Evil Eris 2.0 and IceRom 2.0 and it works perfectly. However, it should work with whatever rom you're using. Also, this will change some of your icons to Vanilla ones. If you don't want them changed, don't copy the files that will change them. Those should be apparent when copying the image files from the folders I've included.
If you have any questions, feel free to ask.
Also, if anyone knows how to wrap this all up into a nice little update.zip, please do it or let me know how to do it. It would be greatly appreciated.
Hello, I appreciate the tutorial! I'm attempting to get this set up for my Tainted Vanilla rom and ran into a snag at the beginning. Our services.jar file contains no classes.dex file. All it contains is MANIFEST.MF. Any ideas about how I should proceed?
Ok, I think I've figured it out.
The .odex file is basically the .dex file in an uncompressed format. To break it open you do the same thing you would do with a dex file. Plug it into baksmali and it should yield you a Classes folder. You do have to reassemble it though, which requires you to first deodex it... and it's kind of a pain in the ass. I've figured out the first portion of it, but deodexing the file is decently complicated for a n00b like me. I'll continue to work on it and will hopefully have a solution tomorrow.
Here's where I'm stuck if anyone wants to figure it out:
$ java -Xmx512m -jar baksmali.jar -x services.odex
Error while disassembling method Lcom/android/server/ConnectivityService;-><init>(Landroid/content/ContextV. Continuing.
org.jf.dexlib.Code.Analysis.ValidationException: class Lcom/htc/connectivity/DummyStateTracker; cannot be resolved.
at org.jf.dexlib.Code.Analysis.ClassPath$UnresolvedClassDef.unresolvedValidationException(ClassPath.java:535)
at org.jf.dexlib.Code.Analysis.ClassPath$UnresolvedClassDef.getClassDepth(ClassPath.java:543)
at org.jf.dexlib.Code.Analysis.ClassPath.getCommonSuperclass(ClassPath.java:383)
at org.jf.dexlib.Code.Analysis.RegisterType.merge(RegisterType.java:274)
at org.jf.dexlib.Code.Analysis.AnalyzedInstruction.mergeRegister(AnalyzedInstruction.java:199)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.propagateRegisterToSuccessors(MethodAnalyzer.java:479)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.setPostRegisterTypeAndPropagateChanges(MethodAnalyzer.java:459)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInvokeDirectCommon(MethodAnalyzer.java:2968)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInvokeDirectRange(MethodAnalyzer.java:2927)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:856)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:202)
at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:290)
at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:130)
at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:322)
at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:291)
at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:135)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:187)
at org.jf.baksmali.main.main(main.java:277)
opcode: invoke-direct/range
CodeAddress: 811
Method: Lcom/android/server/ConnectivityService;-><init>(Landroid/content/ContextV
Click to expand...
Click to collapse
I know that in order for successfully deodex, all the file paths have to be correct. I, however, do not have them yet.
More info here for anyone interested: http://code.google.com/p/smali/wiki/DeodexInstructions
Good work, this should be an update.zip once we have confirmed it working successfully.....
stopxstart said:
Ok, I think I've figured it out.
The .odex file is basically the .dex file in an uncompressed format. To break it open you do the same thing you would do with a dex file. Plug it into baksmali and it should yield you a Classes folder. You do have to reassemble it though, which requires you to first deodex it... and it's kind of a pain in the ass. I've figured out the first portion of it, but deodexing the file is decently complicated for a n00b like me. I'll continue to work on it and will hopefully have a solution tomorrow.
Here's where I'm stuck if anyone wants to figure it out:
I know that in order for successfully deodex, all the file paths have to be correct. I, however, do not have them yet.
More info here for anyone interested: http://code.google.com/p/smali/wiki/DeodexInstructions
Click to expand...
Click to collapse
I get the same error. I posted a issue about this on the project page.
EDIT: Figured it out. Add -c :com.htc.resources.jar
You will need to deodex it first thou.
Can we see screenshots of this notification bar
If you look at the IC3 rom screenshots, this should be the same.
Also, stopxstart, thanks for the hard work! Really appreciate it. Should the phone be connected this whole time? Thanks!
gritts said:
If you look at the ICQ rom screenshots, this should be the same.
Also, stopxstart, thanks for the hard work! Really appreciate it. Should the phone be connected this whole time? Thanks!
Click to expand...
Click to collapse
ICQ ROM do you mean IC3 ROM?
Yes, thanks, I corrected it.
gritts said:
If you look at the IC3 rom screenshots, this should be the same.
Also, stopxstart, thanks for the hard work! Really appreciate it. Should the phone be connected this whole time? Thanks!
Click to expand...
Click to collapse
It's easy just to keep it connected but it's not required. Just make sure you adb remount before pushing and pulling the files.
Going to try out a workaround for all of this, I'll report back sometime tonight.
Also, if this works it will allow me to write a sufficient update.script for a standalone zip.
For those following the progress of this, I am currently testing some standalone files to push that should make this whole process easier.
So far works on: Evil Eris 2.0 and Ic3Rom 2.0 (well, fixes it).
Testing others now.
I'm looking forward to your testing on Tainted Vanilla
hoban_eris said:
Hello, I appreciate the tutorial! I'm attempting to get this set up for my Tainted Vanilla rom and ran into a snag at the beginning. Our services.jar file contains no classes.dex file. All it contains is MANIFEST.MF. Any ideas about how I should proceed?
Click to expand...
Click to collapse
I second that.
ok so these are the things i can't get
the verizon wireless text is white
and the clear button is black with white text
how can i fix these
Re: [Tutorial] White Notification Bar
Did you follow the tut
-------------------------------------
Sent via the XDA Tapatalk App
gritts said:
Did you follow the tut
-------------------------------------
Sent via the XDA Tapatalk App
Click to expand...
Click to collapse
ok ive tried several times and failed every time could someone put up the final zip I could flash
iloveandroid said:
ok so these are the things i can't get
the verizon wireless text is white
and the clear button is black with white text
how can i fix these
Click to expand...
Click to collapse
Let me double check the XML files in the Framework-res.apk to make sure I put the right ones in. I literally have 60 folders filed with the same file from different testing so I could have easily posted the wrong one.
Also, there isn't a zip to flash because I haven't written the update script for it. If you would like to, please do.
stopxstart said:
Let me double check the XML files in the Framework-res.apk to make sure I put the right ones in. I literally have 60 folders filed with the same file from different testing so I could have easily posted the wrong one.
Also, there isn't a zip to flash because I haven't written the update script for it. If you would like to, please do.
Click to expand...
Click to collapse
I would make a flashable but i dont know how
Ok, I fixed the button problem.
You're using Ic3Rom right? Pretty sure the files I have will work with it straight up but let me test it.
Also, I added screenshots to first page.
Hi guys,
im currently using netdrg`s sense theme http://forum.xda-developers.com/showthread.php?t=1048792
Now i changed all the green elements of the framework-res.apk to blue. Ive done everything so far, but i have no clue how to edit the color of the progress bar. (the bar when u change the volume, download something and so on...)
Ive heard that u have to edit an xml file, but as i have no clue about editing these files, i want to ask for a little favour.
Ive attached the xml file, and the color which i will use is 1761ab (hex).
So ill thank the guy who will do this for me a thousand times and i can share the theme with you afterwards!
lg l
In order to edit this xml file you need to decompile framework-res.apk. You can use apk_manager. Once the framework has been decompiled you can easily change the hex color for the progress bar (remember that the first 2 digit are for alpha channel). After that you need to recompile the framework. Actually there is another way to do that, but it‘s a bit triky as you need to modify the xmls file by using an hex editor..
If you want i can modify and compile the xml attached for you! Let me know m8
hey, thanks for your answer.
I put the framework-res.apk in the "place here for modding" folder, opened the script and hit 9 to decompile.
Then i edited all the values in the xml file in the "projects" folder and saved it.
Now i compile it, delete the file i edited in the "keep" folder and that other file mentioned.
Now i tried to apply the compiled framework_res.apk back to the system which results in a bootloop, what am i doin wrong?
soulcrash said:
hey, thanks for your answer.
I put the framework-res.apk in the "place here for modding" folder, opened the script and hit 9 to decompile.
Then i edited all the values in the xml file in the "projects" folder and saved it.
Now i compile it, delete the file i edited in the "keep" folder and that other file mentioned.
Now i tried to apply the compiled framework_res.apk back to the system which results in a bootloop, what am i doin wrong?
Click to expand...
Click to collapse
Ok, you are getting close to the solution
Once you got the unsignedframework.zip inside the place-apk-here-for-modding folder, you have to do a little trick in order to get it working...
Unzip all the content of the "unsignedframework-res.apk". You should have 5 objects (3 folders, 2 files).
Zip these files with Winrar/Winzip (whatever) but you must choose "No compression (store)" method to zip it.
Rename this zip into "framework-res.apk".
Put it into an update.zip and it should be OK to flash trough the recovery mode.
keep me updated
This method is tested, and working for ICS 4.0.3 IML74K (stock) framework-res.apk
ICS 4.0.3 framework-res.apk rebuild is not working with apktool 1.4.3 and latest aapt from SDK R16
Because the 'string encoding' is not correct in the 'plurals.xml' with apktool 1.4.3, and if you tried to rebuild, you get some error...
Decompile
1. Download these files:
apktool1.4.2.31e6dc5.jar
md5: 38db374a2f733000b1b0309b2b99f74b
aapt.exe (from the latest R16 SDK)
md5: 26a35ee028ed08d7ad0d18ffb6bb587a
apktool.bat
md5: 2bf3b895011fc4b1801edcfbabfdc295
2. Copy all files to your 'Windows' directory and rename apktool1.4.2.31e6dc5.jar to apktool.jar
3. Open command prompt, and install framework (apktool if framework-res.apk)
4. Decompile with apktool1.4.2.31e6dc5.jar (everytime use this to decompile framework-res.apk)
apktool d framework-res.apk
Rebuild
1. Download apktool1.4.3.tar.bz2 and copy to your windows directory (overwrite the old apktool.jar)
md5: 3d0478c4d23c7829edc024266697fef9
2. apktool b framework-res
3. extract all files from 'dist\apktool-res.apk' and create new archive with winrar or 7zip (archive type: zip | compression method: store)
4. resign
5. zipalign
6. Rename to famework-res.apk
wow,was looking for that..really thanks! it works fine..and now i can finally start my ics theme
Sent from my Nexus S
it's sounds great
Its working fine for me on decompile and recompile just with the latest apktool...
CdTDroiD said:
Its working fine for me on decompile and recompile just with the latest apktool...
Click to expand...
Click to collapse
are you sure? ICS framework doesn't give you any errors if you decompile --> recompile it with apktool 1.4.3?
i tested on my pc with 3 framework-res.apk (stock, cm9 and peter alfonso)..
Stock IML74K
apktool 1.4.3 : error (when re-compiling)
apktool 1.4.2 : no problem..
CM9 Alfa 18
apktool 1.4.2 : no problem.
(so didn't have to test with apktool 1.4.3..)
Peter Alfonso's nightly 01-02-12
apktool 1.4.2 : no problem too.....
...
your results may vary...
i modified the main script of apk manager, now it uses 1.4.2 for decompile and 1.4.3 for recompile.. no errors too
I am trying to do the same work with the HTC Sensation on InsetCoin ICS ROM framework-res.
I decopmpiled it and recompiled without modification the same stuff just to test the solution.
No way to solve it. I have got the attached error log.
Any idea?
stars2 said:
This method is tested, and working for ICS 4.0.3 IML74K (stock) framework-res.apk
ICS 4.0.3 framework-res.apk rebuild is not working with apktool 1.4.3 and latest aapt from SDK R16
Because the 'string encoding' is not correct in the 'plurals.xml' with apktool 1.4.3, and if you tried to rebuild, you get some error...
Decompile
1. Download these files:
apktool1.4.2.31e6dc5.jar
md5: 38db374a2f733000b1b0309b2b99f74b
aapt.exe (from the latest R16 SDK)
md5: 26a35ee028ed08d7ad0d18ffb6bb587a
apktool.bat
md5: 2bf3b895011fc4b1801edcfbabfdc295
2. Copy all files to your 'Windows' directory and rename apktool1.4.2.31e6dc5.jar to apktool.jar
3. Open command prompt, and install framework (apktool if framework-res.apk)
4. Decompile with apktool1.4.2.31e6dc5.jar (everytime use this to decompile framework-res.apk)
apktool d framework-res.apk
Rebuild
1. Download apktool1.4.3.tar.bz2 and copy to your windows directory (overwrite the old apktool.jar)
md5: 3d0478c4d23c7829edc024266697fef9
2. apktool b framework-res
3. extract all files from 'dist\apktool-res.apk' and create new archive with winrar or 7zip (archive type: zip | compression method: store)
4. resign
5. zipalign
6. Rename to famework-res.apk
Click to expand...
Click to collapse
Are you sure you need to sign the framework-res which is a system apk? A lot of people on the forum just write some crappy guide like this. If you don't want to write then just take a break. No one wants any sh*t like this.
ljwnow said:
Are you sure you need to sign the framework-res which is a system apk? A lot of people on the forum just write some crappy guide like this. If you don't want to write then just take a break. No one wants any sh*t like this.
Click to expand...
Click to collapse
look stars2 just posted this for those who need it, he did it with his free time and effort, I see the only sh*t is your usless post, if you have nothing to contibute please delete your post ( so you don't loose what respect you might have left) and just move on
stars2 files made in two separate folders on my computer also video of decompiling and compiling frameworks.res.apk. NOTE: I have androids apk and jdk installed with windows enviromental path set for both
APKTOOLKIT 6 MEG
capturefoxapktoolkit.zip 142 MEG video of decompiling and compiling frameworks.res.apk
capturefoxZeroCompression.zip 48 MEG How to Zero compress files
Just to report the problems I had:
- Needed to remove Android SDK from path.
- Needed to delete C:\Users\USERNAME\apktool between decompilations / recompilations.
hello
apk I do not want to settle
tHANKS
Its working fine for me on decompile and recompile just with the latest apktool...
Although decompiling and recompiling worked, the apk is not running on my phone
I tried decompiling and recompiling the apk without making any changes, and it does not run either. I noticed that my recompiled apk is slightly larger than the original apk (I followed the instructions about zipping with 7zip with store). What <align> parameter should I use for zipalign?
bluebird11 said:
Although decompiling and recompiling worked, the apk is not running on my phone
I tried decompiling and recompiling the apk without making any changes, and it does not run either. I noticed that my recompiled apk is slightly larger than the original apk (I followed the instructions about zipping with 7zip with store). What <align> parameter should I use for zipalign?
Click to expand...
Click to collapse
did you sign it? you have to open modified apk (not unzip) and open oridinal apk and copy the META-INF ( that signs it) to the modified one accually I always copy META-INF, AndroidManifest.xml
carl1961 said:
did you sign it? you have to open modified apk (not unzip) and open oridinal apk and copy the META-INF ( that signs it) to the modified one accually I always copy META-INF, AndroidManifest.xml
Click to expand...
Click to collapse
Thank you, that was the problem! I thought system apks don't need to be signed
i have problem when recompile apk file
first of all i did some mod , recompile report back with errors , second time i just decompile and then recompile it without any change , still shows error ...
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Did you make sure:
1. You have the right versions of the files and you have removed your android-sdk from your path (need to restart cmd if under Windows)?
2. You delete C:\Users\USERNAME\apktool before each decompilation/recompilation?
Hope this helps.
bluebird11 said:
Did you make sure:
1. You have the right versions of the files and you have removed your android-sdk from your path (need to restart cmd if under Windows)?
2. You delete C:\Users\USERNAME\apktool before each decompilation/recompilation?
Hope this helps.
Click to expand...
Click to collapse
i have done 100% exact as he instructed
seems less errors then last time after everytime de/re-compilation with delete c:\users\name\apktool.
but still not work ...
The remaining errors you are getting are not related to apktool.
I think it means that you are using some undefined things.
After few days surfing, asking & testing. I decide to make a easily tutorial for theming in Windows, I think as long you know to use computer, they is nothing much difficult to theming/modifying the .apk yourself.
My guide only cover:
De-compile & compile of .apk
changing the .png file inside .apk
Modifying tricky .9.png file.
Modifying .xml file.
Zip Align the .apk
What you need:
Your phone must be ROOT and DEODEXED.
CWM pre-install recommended, you can simply get this function by installing superatmos / Lucifr kernel.
7-zip - for replacing file inside .apk
JRE (Java Runtime Environment) - required to run the APKtool
Android-SDK - must install before APKtool & Zipalign work.
APKTool Download the apktool & also apktool-install-windows.
Before Start:
Always remember make a backup for any .apk file you plan to change or amend.
Recommended make a flash-able version of origin not amend .apk in-case something went wrong, you can always flash back the original file via CWM. Example if you did something wrong in your systemUI.apk (for statusbar) it will probably make your phone nearly impossible access any part due to unstop FC.
I also like to take this opportunity to THANKS the following user help, without them, all this is not possible.
ronhoover88
superatmos
tarunagg
Vertumus
De-compile & Compile of .apk
Why this step is required:
You need to de-compile the .apk before you can correctly modified the tricky .9.png and also to see a readable .xml for amending.
Step:
Install JRE (Java Runtime Environment) & Android-SDK.
Download the apktool & also apktool-install-windows, extract the file and put inside your Windows Folder.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Open command prompt (Start - Run - CMD)
Before de-compile the .apk, make sure you copy out your current phone framework-res.apk & twframework-res.apk, lidroid-res.apk only required if you using lidroid-res.apk in your framework.
Code:
[B]apktool if [location of .apk][/B]
Example:
apktool if D:\APK\framework-res.apk
apktool if D:\APK\twframework-res.apk
apktool if D:\APK\lidroid-res.apk
Now, De-compile the .apk
Code:
[B]apktool d [filename.apk] [directory][/B]
Example: apktool d D:\framework-res.apk D:\De-compile
If sucess, you will seen the following line in your CMD.
The De-compile folder will be generate as seen below.
Now you can amend whatever you like to amend, after done, proceed to following step.
Compile back:
Code:
[B]apktool b [directory][/B]
Example: apktool b D:\De-compile
Extra build folder will appear inside your De-compile folder, all file inside here already compile and can use later in your Android phone.
Changing/Replacing the .png file inside .apk
Amending normal .png no need to de-compile, just extract the file and modified using any photoshop tools or simply replace the .png
Just right click any .apk file and select 7-zip extract to, as seen below:
Now go to the extracted folder and amend / replace any .png file you like to replace. (Remember .9.png file cannot just simply replace, check following post for instruction.)
Modifying tricky .9.png file.
The .9.png cannot just simply amend using any photoshop and put back, because by doing so, either the amend .9.png won't appear or just simply give you FC in your phone when running it.
What to do:
De-compile the .apk.
Below showing the different between before and after de-compile of .9.png, as you can seen on right image,they is extra 4 black dot + 1 black bar and surrouding with transparent bar, all this area must be keep and not amend during photoshop. The de-compile image will auto increase 1 x pixel + 1 y Pixel.
Just amend without touching those area, save it and then put back to correct folder and compile back.
Modifying .xml file
After you have de-compile the .apk, now all inside .xml is readable where you can make some changes on the color selection, clock position and etc. by just simply open with notepad and modified.
Before de-compile, the .xml look like below which is not readable and understand by human.
After de-compile, now the .xml is readable and understand by human.
Now you can amend what ever you like, Google/Search XDA forum for which .XML to amend.
Use this color code checker site for getting your desire color code.
After done, don't forget, you must compile back the .xml before it is understandable by Android OS.
Screenshot below showing modifying the sub text .xml to ICS blue color.
Change all
Code:
from android:color="#ffffffff to [B]android:color="#ff3f9bbf[/B]
at zzz_tw_secondary_text_sub.xml
Zipalign the .apk
Why this step is required:
You need to align the .apk to let the Android phone run the modified .apk perform much smoother and better, if you have more not align .apk file in your phone, it will eventually drag down your entire phone performance.
This step is not necessary but recommended.
Step:
Open command prompt at your Android-SDK Tools folder
Type following command and run
Code:
[B]zipalign -fv 4 [filename.apk] [filename-new.apk][/B]
Example: zipalign -fv 4 framework-res.apk framework-res-new.apk
A new Zipalign .apk will be generate as seen below, highlight in blue.
Zipalign in batch, save following code in .bat and put in your folder that contains .apk file. It will batch running zipalign all .apk inside, this guide I found from user Grumpy Old Man post at RootWiki. Thanks for this easier method.
Code:
@echo off
REM Batch file to recursively zip align *.apk files in a directory
REM and its sub-directories. This is significantly easier and faster
REM than manually zip aligning them.
@echo Zip aligning now...
for /R %%X in (*.apk) do zipalign 4 "%%X" "%%~dpX%%~nX.new"
@echo Replacing non-aligned files with zip aligned files...
for /R %%X in (*.new) do move /Y "%%X" "%%~dpX%%~nX.apk"
@echo Zip aligning done, press any key to exit
pause
Final Step
OK, done everything? now you need to put back to your phone with 2 method
Flash via CWM - highly recommended
Root Explorer - not recommended as it may not properly change for Statusbar theming.
Using CWM
Make a flash-able .zip to flash at CWM
Not sure how to do, let use a easier way, take any flash-able .zip, use 7-zip and choose open archive as seen below:
Now just drag and drop all your modified .apk inside the .zip file, choose YES when ask "Confirm File Copy" as seen below:
Copy the modified .zip to your root SDCARD and restart to CWM and install. Done!
Using Root Explorer
Temporary copy your modified .apk to your /system/csc
Right click choose permission and set as below:
Move your current .apk to correct directory /system/app
Done! This method is not recommended for framework-res.apk & systemUI.apk, better way still flashing via CWM.
ENJOY HAPPY THEMES!
My Achievement
Below is what you can get after themes. Enjoy!
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FROM BELOW, NOT RELATED TO S II - i9100G
CENTER CLOCK for SONY XPERIA Z phone.
De-compile the SystemUI.apk, then change some code at status_bar.xml in /res/layout
Step 1 - Find
Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock"
android:gravity="left|center" android:id="@id/clock" android:paddingLeft="6.0dip"
android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
Step 2 - Replace Step 1 code with
Code:
<com.android.systemui.statusbar.policy.Clock android:id="@id/clock" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:gravity="center_horizontal|center"
android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:singleLine="true" />
Step 3 - Then search for
Code:
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
and now cut Step 2 code and paste in bottom Step 3 code.
Step 4 - Lastly find
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/ticker"
and past following code beside it.
Code:
android:background="@drawable/status_bar_background"
Save the edited status_bar.xml
Sony Xperia Z Center Clock Screenshot.
Very nice tutorial!i'm too lazy to type/make a tutorial..lol its good for sharing the idea..:thumbup:
Sent from my GT-I9100G using Tapatalk 2
fauzi_91 said:
Very nice tutorial!i'm too lazy to type/make a tutorial..lol its good for sharing the idea..:thumbup:
Sent from my GT-I9100G using Tapatalk 2
Click to expand...
Click to collapse
Thanks, I am still learning.
u forget to mention the deleting of edited xmls file and resources.arsc
samyam2002000 said:
u forget to mention the deleting of edited xmls file and resources.arsc
Click to expand...
Click to collapse
My final step is drag back and save using 7-zip, the file will automatic replace, no need manual delete.
By the way, thanks for highlighting removing of resources.arsc, add-in this step at final step now.
i dont know if i am doing it right what what exactly does a build folder contain a folder or .apk file
samyam2002000 said:
i dont know if i am doing it right what what exactly does a build folder contain a folder or .apk file
Click to expand...
Click to collapse
The build folder contain all the files you had de-compile just before but in compile format back.
Andrewtst said:
The build folder contain all the files you had de-compile just before but in compile format back.
Click to expand...
Click to collapse
so i just replace them or what on the original .apk
definnately apkmanager is easier
samyam2002000 said:
so i just replace them or what on the original .apk
definnately apkmanager is easier
Click to expand...
Click to collapse
Correct. Just replace to your origin .apk and remember always do a backup for any .apk you want to amend.
thanks for ur tutorial bro..
Mybe u can add a lil bit intro/tutor about uot kithen too if u want..can introduce to people out there who never used it b4..they also can get so many icons in there..
Sent from my GT-I9100G using Tapatalk 2
fauzi_91 said:
Mybe u can add a lil bit intro/tutor about uot kithen too if u want..can introduce to people out there who never used it b4..they also can get so many icons in there..
Sent from my GT-I9100G using Tapatalk 2
Click to expand...
Click to collapse
Oh, I never try before that, wait I try first, before I can add-in.
Andrewtst said:
Oh, I never try before that, wait I try first, before I can add-in.
Click to expand...
Click to collapse
Uot kitchen is the easier way to make a theme as long as we know how to use it..there are a lot of option there..n we juz need to upload the systemui.apk n framework-res.apk..but for contact,phone etc will remain stock..that one we can use ur tutor to modify..
Sent from my GT-I9100G using Tapatalk 2
Anyway its always on "ON" state all the time.. I dont want it to waste place for that..
Any idea how to hide it?
mcjordan92 said:
Anyway its always on "ON" state all the time.. I dont want it to waste place for that..
Any idea how to hide it?
Click to expand...
Click to collapse
Open a buildprop editior and change the value of ro.nfc.icon.enable to false. You need root for that
You need to be rooted and edit your build.prop. An easy way to do this is with Build Prop Editor.
You need to find the entry -
ro.nfc.icon.enable
Change the value from true to false, then reboot.
Edit - Beaten to it. ?
Sent from my C6603 using Tapatalk
Nice idea! but some what it didn't work for me.
It was already on false when I first saw it.
I tried to 'true' it and re'false', tried to change every one there except the first but nothing worked (I restarted each time ofc, I've played with build.prop many times before)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I was sure that the Gravity Xposed tool is related to that but disabling it didn't help.. any idea?
mcjordan92 said:
Nice idea! but some what it didn't work for me.
It was already on false when I first saw it.
I tried to 'true' it and re'false', tried to change every one there except the first but nothing worked (I restarted each time ofc, I've played with build.prop many times before)
View attachment 2835790
I was sure that the Gravity Xposed tool is related to that but disabling it didn't help.. any idea?
Click to expand...
Click to collapse
hmm i have a bit HARD way for that but im sure you can do it!
take systemUI.apk from system/priv-app or system/app
then rename it to SystemUI.zip then extract it in empty folder
then open folder called "res"
you will find alot of folders! open them ONE BY ONE and delete every NFC icon you find!
after you finish deleting all NFC icons go back to the place you extracted SystemUI.zip
select all the files and folders and compress them (put them in zip file) and select store compressing mode
after you finish rename the zip to SystemUI.apk ( the upper case letters keep them upper case!!)
download zipsigner app
install it and open it!
click CHOOSE IN/OUT button! and select the place the you put the new SystemUI.apk and select it
click the sign the file button
when finish open your file manager and go to the same folder you have SystemUI.apk
you will find apk file with the same name with extra SIGNED text!
rename it to SystemUI.apk and move to system/app or system/priv-app and REPLACE the old one then set the permissions to rw-r-r
reboot and enjoy it!
ps. i didnt tried it for sure but i found the icons inside the apk
BACKUP THE ORIGINAL SYSTEMUI.APK BEFORE TRY!!!!!!!
Xperia™ Z (C6602) with tapatalk
androidfreak70 said:
hmm i have a bit HARD way for that but im sure you can do it!
take systemUI.apk from system/priv-app or system/app
then rename it to SystemUI.zip then extract it in empty folder
then open folder called "res"
you will find alot of folders! open them ONE BY ONE and delete every NFC icon you find!
after you finish deleting all NFC icons go back to the place you extracted SystemUI.zip
select all the files and folders and compress them (put them in zip file) and select store compressing mode
after you finish rename the zip to SystemUI.apk ( the upper case letters keep them upper case!!)
download zipsigner app
install it and open it!
click CHOOSE IN/OUT button! and select the place the you put the new SystemUI.apk and select it
click the sign the file button
when finish open your file manager and go to the same folder you have SystemUI.apk
you will find apk file with the same name with extra SIGNED text!
rename it to SystemUI.apk and move to system/app or system/priv-app and REPLACE the old one then set the permissions to rw-r-r
reboot and enjoy it!
ps. i didnt tried it for sure but i found the icons inside the apk
BACKUP THE ORIGINAL SYSTEMUI.APK BEFORE TRY!!!!!!!
Xperia™ Z (C6602) with tapatalk
Click to expand...
Click to collapse
Well done my friend !
I feel like an hero after proccessing this and succussing.
I didn't completely followed your guide because the saying of "search every NFC icon and delete it" gave me a red light that this might be bad..
after done I can say that the only needed files for deleting are
stat_sys_nfc_forum.png and they are in 3 places:
SystemUI\res\drawable-hdpi
SystemUI\res\drawable-xhdpi
SystemUI\res\drawable-xxhdpi
Trying to zip it / unzip it apk it and sign it didn't work.
After renaming it once the file is ruined and can't use it anymore no matter signing or not.. (I probably didn't do it right but I couldn't do it that way..)
So what I did was copying the apk file to PC, opening it with winrar and deleting the files through it without changing the apk extension.
After that I sent back to phone and went to system/priv-apk folder, renamed the original systemUI.apk to .BAK (so I won't lose it)
and copied the edited 1 to there.
set permission to:
owner: read+write
Group: read+wrote
others: read
only this way it works, don't know what rw-r-r means but putting owner: r,w and others only read didn't work.
(I simply watched the premission on the original and did the same for the modified)
reboot and bam! it works!
Huge thanks for your guide !
mcjordan92 said:
Well done my friend !
I feel like an hero after proccessing this and succussing.
I didn't completely followed your guide because the saying of "search every NFC icon and delete it" gave me a red light that this might be bad..
after done I can say that the only needed files for deleting are
stat_sys_nfc_forum.png and they are in 3 places:
SystemUI\res\drawable-hdpi
SystemUI\res\drawable-xhdpi
SystemUI\res\drawable-xxhdpi
Trying to zip it / unzip it apk it and sign it didn't work.
After renaming it once the file is ruined and can't use it anymore no matter signing or not.. (I probably didn't do it right but I couldn't do it that way..)
So what I did was copying the apk file to PC, opening it with winrar and deleting the files through it without changing the apk extension.
After that I sent back to phone and went to system/priv-apk folder, renamed the original systemUI.apk to .BAK (so I won't lose it)
and copied the edited 1 to there.
set permission to:
owner: read+write
Group: read+wrote
others: read
only this way it works, don't know what rw-r-r means but putting owner: r,w and others only read didn't work.
(I simply watched the premission on the original and did the same for the modified)
reboot and bam! it works!
Huge thanks for your guide !
Click to expand...
Click to collapse
wow great!
any time to help
Xperia™ Z (C6602) with tapatalk