[Q] create a transparant notification screen - Desire Q&A, Help & Troubleshooting

like the title sort of say's, i would love a transparent notification menu.
However, when i make the png for the background transparent, it just turns black. *see attachment*
is there any way to make it transparent or is it a no-go?

You have to change a line of code in services.jar
Decompile it using baksmali
Then in the folder services open up com/android/server/status/StatusBarService.smali
Then use find to find 'const/4 v5, 0x2'
And simply replace with 'const/4 v5, -0x3'
Then compile with smali
http://code.google.com/p/smali/ link to smali/baksmali

shoey-n said:
You have to change a line of code in services.jar
Decompile it using baksmali
Then in the folder services open up com/android/server/status/StatusBarService.smali
Then use find to find 'const/4 v5, 0x2'
And simply replace with 'const/4 v5, -0x3'
Then compile with smali
http://code.google.com/p/smali/ link to smali/baksmali
Click to expand...
Click to collapse
that doesn't seem so hard =)
i'll give it a try, thanks
EDIT: ehmm, how do i use baksmali and smali?

maybe someone can post a more detailed tutorial ?
I want a transparent service-popup, too

If your using Linux or Mac, I suggest using ThemePro to make this easier
There's a windows release but I don't know how well it works
Sent from my HTC Desire using XDA App

m8 we need an explanation on how to use these things, theres not much of an explanation in theme pro either. if you could kindly provide a step by step guide to get a transparent notification status background it would be much appreciate.

I'll post it up in the morning. Midnight here so I'm not on the computer
Sent from my HTC Desire using XDA App

thanks m8 looking forward to it

lincore said:
Transparent notification pull down (moded service.jar):
http://www.multiupload.com/V5FGAPJ42P
Click to expand...
Click to collapse
this is taken from lincore's expresso mod, the bottom zip will give transparent notification pull down only. wonder if its possible to make translucent

djtosh said:
this is taken from lincore's expresso mod, the bottom zip will give transparent notification pull down only. wonder if its possible to make translucent
Click to expand...
Click to collapse
i'll give that file a try =)
EDIT:
That file works great!!!!! Thank you so much =) =) =)

djtosh said:
this is taken from lincore's expresso mod, the bottom zip will give transparent notification pull down only. wonder if its possible to make translucent
Click to expand...
Click to collapse
Is this taken from or for, droid 2.1 or 2.2?

djtosh said:
this is taken from lincore's expresso mod, the bottom zip will give transparent notification pull down only. wonder if its possible to make translucent
Click to expand...
Click to collapse
Thanks for the link mate. will def try it out!
p.s. i think translucency depends on the png file you put in the framework.

This is only for 2.2 roms .
Could you make one for 2.1 modaco?
Thanks!!

Where do I push the jar file to, to have this on my droid?
edit: can I just flash the zip using recovery?
sorry, I am unsure.

patachon33 said:
This is only for 2.2 roms .
Could you make one for 2.1 modaco?
Thanks!!
Click to expand...
Click to collapse
you can extract the service.jar and the background png from customized 2.1 roms such as pays's bravesoul or Amer's v4 and push them to your device. hvn't tried it out but should work=)

qwertylesh said:
Where do I push the jar file to, to have this on my droid?
edit: can I just flash the zip using recovery?
sorry, I am unsure.
Click to expand...
Click to collapse
yes you can juz flash the zip=)
i still hvn't done so thou.. coz i'm using 2.06 based rom and lincore made it for the official 2.09.

It's not really hard to do it on your own:
First download smali.jar and baksmali.jar from here http://code.google.com/p/smali/
Open the services.jar file for example with winzip, 7z, winRar, or whatever.
Unzip the classes.dex file to your sdk/tools/ folder and place the baksmali and smali file there too. After that open a new commandbox an run following line:
java -jar baksmali.jar -o out/ classes.dex
You'll have a new folder now called "out". Browse to "out/com/android/server/status" and open the file called StatusBarService.smali with a text editor like notepad.
Search for ".line 1773" and you'll find also "const/4 v5, 0x2"
Just change this to "const/4 v5, -0x3" and save the file.
Open again a new commandbox and run this:
java -Xmx512M -jar smali.jar out/ -o edited-classes.dex
Now you'll have a new dex file called "edited-classes.dex".
Delete the old file an rename the new in "classes.dex".
Open again the services.jar file with any zip tool and overwrite the classes.dex file with the one just created.
Now search the status_bar_background.png file in the framework-res.apk and make it transparent.
You're done!
THIS WILL ONLY WORK ON DEODEXED ROMS!
Otherwise you won't find a classes.dex file in the services.jar!
You'd have to deodex all files before!

Sturmtief said:
It's not really hard to do it on your own:
First download smali.jar and baksmali.jar from here <snip to allow newbie posting>
Open the services.jar file for example with winzip, 7z, winRar, or whatever.
Unzip the classes.dex file to your sdk/tools/ folder and place the baksmali and smali file there too. After that open a new commandbox an run following line:
java -jar baksmali.jar -o out/ classes.dex
You'll have a new folder now called "out". Browse to "out/com/android/server/status" and open the file called StatusBarService.smali with a text editor like notepad.
Search for ".line 1773" and you'll find also "const/4 v5, 0x2"
Just change this to "const/4 v5, -0x3" and save the file.
Open again a new commandbox and run this:
java -Xmx512M -jar smali.jar out/ -o edited-classes.dex
Now you'll have a new dex file called "edited-classes.dex".
Delete the old file an rename the new in "classes.dex".
Open again the services.jar file with any zip tool and overwrite the classes.dex file with the one just created.
Now search the status_bar_background.png file in the framework-res.apk and make it transparent.
You're done!
THIS WILL ONLY WORK ON DEODEXED ROMS!
Otherwise you won't find a classes.dex file in the services.jar!
You'd have to deodex all files before!
Click to expand...
Click to collapse
Right, I'll be the token slow chap. I followed you right up to where you say "Open the services.jar file for example with winzip". Where do we find this file?

Open your ROM with a zip file manager, browse to /system/framework/ and there you'll find the services.jar file!
If you want to edit the file from the rom you are using, type this in a commandbox:
adb pull /system/framework/services.jar services.jar
Don't forget to make a backup of the file or a nandroid backup!

Thanks for that - found services.jar. However when I do a search on StatusBarService. smali I can't find a .line 1773 (or the string 1773 at all come to that). I'm using OpenDesire. There are lots of other files called things like StatusBarService$1.smali and similar.

Related

[How To]: Decompile / Compile .APK

Source Found
Brut.all of XDA has released the program APKtool which make the process of editing any APK file much easier, especially XML editing. Before you had to use a few different programs (Smali, hex editor, etc) to do the same thing. A future release is going to have the decompiler dump into an easy to import into Javabeans/Eclipse format.. so nice
Program and Usage link;
APKTool 1.2
Setup;
Before you start, download from the link above both the apktool-1.2.0.tar.bz2 and apktool-install-windows-2.2_r01-1.tar.bz2 and extract them to your windows folder.
Usage;
Decoding APKs;
Code:
apktool d <file.apk> <directory to output to>
Compiling APKs*;
Code:
apktool b <directory of decoded apk>
*The compiled apk will be saved to the sub directory "dist", which is in what ever directory you choose to compile.
Output structure;
Smali directory - The output of classes.dex, the code to the apk
Res directory - Your resources, the images and layout/structure xmls
Lib directory - Shared library files
Dist directory - The apk output of the "apktool b" command, if you didn't run it you won't have it.
Build directory - The compiled output of the "apktool b" command, like what you would see if you just extracted an apk file with 7zip. If you didn't run it you won't have it.
General info;
Once you have your edited apk from the Dist directory you'll need to sign it. I use Dave Da illest 1 of XDA's modified script for signing. Just place your apk, this should be the only apk in this folder, in the same folder that you extracted the auto-signer to and execute sign.bat. The script will output your_app_signed.apk, which is your signed and ready to load on your phone apk.
If you'd like to decompile/compile an apk file that doesn't have a classes.dex, like framework-res.apk, just place any classes.dex into the apk and it will decompile. If you don't do this apktool will through up an error. Just remember to pull the classes.dex out before you sign it.
Videos;
Editing an Apk file with APKTool;
http://www.youtube.com/watch?v=XXgYVHTcl6c
Editing a Jar file with APKtool;
http://www.youtube.com/watch?v=VAekeWiqHcY
Why?;
Localization / Translation
Themeing
Adding in features or taking them out
Impressing friends and family, lol
etc..
Issues;
I noticed that while the new version 1.2 works great on the framework-res.apk file, it seems to have issues with other System/app files like Settings.apk,Phone.apk, etc. For these files use version 1.1.1.
Hopefully this is helpful, I tend to ramble.
-Ften @ sdx-developers.com
http://forum.xda-developers.com/forumdisplay.php?f=613
Post it here too, mate.
shokkapic said:
http://forum.xda-developers.com/forumdisplay.php?f=613
Post it here too, mate.
Click to expand...
Click to collapse
Will do, not having a good time at the moment as I can't seem to edit launcher.apk with this tool. Not sure why. basically I decompile, edit then compile but having issues when transferring it back to the phone.
EDIT: I just get a black screen when trying the new modified .apk file.
Why to create new threads, if apktool has its official thread here
http://forum.xda-developers.com/showthread.php?t=640592
andrewb84uk said:
Will do, not having a good time at the moment as I can't seem to edit launcher.apk with this tool. Not sure why. basically I decompile, edit then compile but having issues when transferring it back to the phone.
EDIT: I just get a black screen when trying the new modified .apk file.
Click to expand...
Click to collapse
Do you get any errors in logcat?
Brut.all said:
Why to create new threads, if apktool has its official thread here
http://forum.xda-developers.com/showthread.php?t=640592
Do you get any errors in logcat?
Click to expand...
Click to collapse
I could not find it anywhere else and I did do searches for hours Brilliant tool!
See Attachment, I think it's this line
Code:
E/PackageManager( 138): Package com.android.launcher signatures do not match the previously installed version; ignoring!
However, not sure how to fix it.
andrewb84uk said:
I could not find it anywhere else and I did do searches for hours Brilliant tool!
See Attachment, I think it's this line
Code:
E/PackageManager( 138): Package com.android.launcher signatures do not match the previously installed version; ignoring!
However, not sure how to fix it.
Click to expand...
Click to collapse
Not an expert. But try to uninstall the previous launcher, before installing that one.
shokkapic said:
Not an expert. But try to uninstall the previous launcher, before installing that one.
Click to expand...
Click to collapse
Will try it.
EDIT: Nope, uninstalled re-installed, still black screen.
andrewb84uk said:
I could not find it anywhere else and I did do searches for hours Brilliant tool!
See Attachment, I think it's this line
Code:
E/PackageManager( 138): Package com.android.launcher signatures do not match the previously installed version; ignoring!
However, not sure how to fix it.
Click to expand...
Click to collapse
I think you can't install Launcher just like that, because it's system app. You should do it through update.zip file.
Try to not use apktool, but just unpack Launcher.apk, remove META-INF dir, zip it back, sign and install. If you will get similar problems, then they can't be related to apktool (because you didn't even use it), but to something else.
Brut.all said:
I think you can't install Launcher just like that, because it's system app. You should do it through update.zip file.
Try to not use apktool, but just unpack Launcher.apk, remove META-INF dir, zip it back, sign and install. If you will get similar problems, then they can't be related to apktool (because you didn't even use it), but to something else.
Click to expand...
Click to collapse
If I unzip it, remove META-INF dir, zip it back, sign + install and it works fine. It doesn't work when I edit 1 file by decompiling and compiling, sign, upload it fails but it also fails using APKManager.
EDIT: I have also tried using notepad++ / notepad to edit the xml both to the same issue.
Err... you know, your problem is for sure related to signing/installation and not to apktool. Key error line is here:
E/PackageManager( 138): Package com.android.launcher signatures do not match the previously installed version; ignoring!
Click to expand...
Click to collapse
andrewb84uk said:
If I unzip it, remove META-INF dir, zip it back, sign + install and it works fine. It doesn't work when I edit 1 file by decompiling and compiling, sign, upload it fails but it also fails using APKManager.
Click to expand...
Click to collapse
Could you explain, how is it possible, that you can properly sign rezipped apk, but you can't reapktoold' one? If you get signing issues, then this is totally irrelevant what apktool does. All files could be random binary strings as well cause they aren't even read.
This thread can be deleted or moved to the bin or where ever it needs to go!
idroid84 said:
Usage;
Decoding APKs;
Code:
apktool d <file.apk> <directory to output to>
Compiling APKs*;
Code:
apktool b <directory of decoded apk>
*The compiled apk will be saved to the sub directory "dist", which is in what ever directory you choose to compile.
Click to expand...
Click to collapse
Thank you soooo much!!! It took me hours of searching to find this post and once I did, I had my apk decompressed in under a minute!!! You da man
If your running windows XP here's a right click reg edit I made for making decompiling/compiling quicker-
forum.xda-developers.com/showthread.php?t=935967
Hey guys... really trying to theme for the first time with xml files.
I have done modifying of png which are easy, but just lenghty and detailed.
So now that Gingerbread is out, some of the items have been moved to the xml files.
indeterminate was from 4 and now down to 3. but I want to increase to 8 to mimic honeycomb. Also the progress horizontal was once a png reference file now its in the systemui.apk xml too.
Anyhow short version.... anytime i edit more then 1 line at a time after decompiling, when trying to say it will ask to save as text.
Whats the best file editor for xml? or recommendations.
I use notepad++ on windows, you can also import your decompiled apk into eclipse and use that, it'll also report any errors or mistakes you might make.
Hope this helps.
Yeah I have been using that do and any time I compile and flash it just gives me boot loop.
Question about proper importing to eclips.
Whenever I just flat out decompile ... do my modification, go to recompile, it get errors. In apktool and apkmanager.
Should I extract the resource file and class dex out and then decompile. Cus when I have the resource file in the same directory....at least last nights attempt, apktool finale didn't give me an error and compiled.
I've done a decompile just from apk and imported to eclips and when I try to run, gives error.... "no style availiable" or something like that
Sent from my Droid using XDA App
Thank you!!!
Greetings.
fixing a broken abondon market apk
Could someone fix this app VirginmobileMinuitechecker . I think i found the problem . Virgin Mobile updated there site from logon www1 to www2 . I edited it from the open source and zipped it back up but i cannot get this compile program to run at all . here is the zip master . I made several attempts emailing jay goel but he his MIA .. the app will no longer log in because of the VM website recent changes . TIA
EDIT ,, NEVER MIND . i got it working and fixed that app . works like a charm now pretty good being i don't code for a living.. if you don't mind i posted the fixed app . you may move or delete if it is not proper . thank you for the tutorial .

*{HOW TO}{TEAM REJECTS}{Windows} Quick DECOMPILE/COMPILE - Jelly Bean updated 7/1/13

TEAM REJECTZ QUICK JB FIX
If anyone was having a problem with adding the 15 toggles, now just pull the classes.dex file out and quick baksmali/smali to fix it. Even though it
compiled correct it still didn't lol if you get that, but now its fixed
Since i did this for the E4GT i figured i would do the same. Well since the bean is here​
1. You need to make sure you have the latest java
2. Download Notepad++ (google it) lol
3. Download the Team Rejectz Quick JB Fix (the latest one) which is linked below
Instructions Decompile/Recompile​
1. UNzip and place the JB Quick Fix Folder on your c: drive and name it apktool
2. Since this is TW/CM10 you should drag your framework-res.apk, twframework-res.apk, and systemUI.apk onto the apktool-if cmd file
3. Now time to decompile. You can actually drag your apk from where ever its located but i suggest you place them in the Quick Fix folder.
and drag and drop it on top of the Quick-Deompile cmd file
4. To get an error less decompile i prefer you to use the stock apk
5. Once the decompile process is done. you can go into the apks folder that was created and make your edits with notepad++
warning if you create to many edits that would cause and error. then begin the process over but do them one by one​
6. Now its time to recompile ^^^^^^^^^remember the warning^^^^^^^ drag and drop the apks folder on top of the Quick-Recompile cmd file
7. Now once your done go into the apks folder you should see dist folder. Your new compiled apk is located there. I prefer to just use the build folder and drag the things I need into the apk. Much easier. Also remember if any images has been added you need to make sure you drag the new arsc file because the public.xml may have been changed
8. Don't worry about signing the apk. All of your edits besides the ones in drawable folder will be in the resource.arsc file
9. Drag that file into the apk thats in the rom your editing
10. If you decide to edit the decompressed .9 images you can check my Team Rejectz Theme Cheat Sheet located >>>Here
Baksmali/Smali​
1. Grab the apk/jar file you want to edit
2. Drag the classes.dex file out of the apk/jar file
3. Drag and drop the classes.dex file onto the Quick-Baksmali cmd file
4. A smali folder will be created
5. Now you can make your smali edit inside of the smali folder and close and save them.
6. After the edits and save, drag and drop the smali folder on top of the Quick-Smali cmd file
7. You should now see a new file called new-classes.dex. rename it to classes.dex
8. Finally drag the classes.dex file into the original apk/jar you pulled it from
If this helped you in anyway just hit that thanks button thanks!!!!!!!!!!
Download:
Team Rejectz Quick JB Fix 2.5
Change Log
Quick Fix 2.5
Faster Compile times and Less errors
Updated to apktool 1.5.2, left the older ones in
Updated aapt to most recent
Updated baksmali/smali to 2.0
Thanks for sharing man.
dazednconfused said:
Thanks for sharing man.
Click to expand...
Click to collapse
No prob. Besides I know a lot of people like simple and it couldnt get any simpler than this lol
Sent from my SPH-L710 using xda premium
Thanks for sharing the knowledge!! this should be stickied!!
im going to try this i would like to contribute to the community thanks for the (tut)
Thanks fpr sharing... unfortunately i cant get it to work...
not sure what I am doing wrong.
i grabbed the 3 files from the zip, moved them to a folder on my desktop, then dropped them in the apktool-if cmd.
then grabbed the systemui, and dropped on the quickdecompile cmd, and nothing is happening.
what else do I need to do?
Thanks again for the tool, hope I can get it working...
joshbeach said:
Thanks fpr sharing... unfortunately i cant get it to work...
not sure what I am doing wrong.
i grabbed the 3 files from the zip, moved them to a folder on my desktop, then dropped them in the apktool-if cmd.
then grabbed the systemui, and dropped on the quickdecompile cmd, and nothing is happening.
what else do I need to do?
Thanks again for the tool, hope I can get it working...
Click to expand...
Click to collapse
Put the folder on the root of your c: drive and name it apktool.
Sent from my SPH-L710 using xda premium
lorjay589 said:
Put the folder on the root of your c: drive and name it apktool.
Sent from my SPH-L710 using xda premium
Click to expand...
Click to collapse
got systemui decompile, but with errors, brut.something. tried recompiling, but still errored, even without making any changes.
joshbeach said:
got systemui decompile, but with errors, brut.something. tried recompiling, but still errored, even without making any changes.
Click to expand...
Click to collapse
If you worked on a ics rom and you did the apk-tool if then you need to do the jelly bean frame. But if thats not the case post a pic of your error so I can tell you whats wrong
Sent from my SPH-L710 using xda premium
good share of tools
thanks
15 toggle classes.dex figured out and updated. now just pull the classes.dex out and use the quick smali and baksmali
lorjay589 said:
15 toggle classes.dex figured out and updated. now just pull the classes.dex out and use the quick smali and baksmali
Click to expand...
Click to collapse
Nice. Where are all the Rejectz threads here? We got mijjah representing? whats going on up in the S3 section.. Do I really have to go out and buy another phone just to put some awesome stuff here?
I keep getting this error when trying to decompile SystemUI.apk
Code:
[*] SystemUI.apk
decompiling SystemUI.apk...
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.(DexFile.java:377)
at org.jf.dexlib.DexFile.(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)
is there anything I can do to fix this?
Nevermind, I don't think I need it. Pretty sure I can do it in 7.zip
Stryke_the_Orc said:
I keep getting this error when trying to decompile SystemUI.apk
Code:
[*] SystemUI.apk
decompiling SystemUI.apk...
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.(DexFile.java:377)
at org.jf.dexlib.DexFile.(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)
is there anything I can do to fix this?
Nevermind, I don't think I need it. Pretty sure I can do it in 7.zip
Click to expand...
Click to collapse
did you do the apktool-if instructions. and also, if this problem continues. drag out the classes.dex file and it will decompile. and use baksmali to decompile the classes.dex file
lorjay589 said:
did you do the apktool-if instructions. and also, if this problem continues. drag out the classes.dex file and it will decompile. and use baksmali to decompile the classes.dex file
Click to expand...
Click to collapse
Found my error. In the install process I went A.D.D. and added an extra directory so nothing wanted to work properly. Fixed the directory and now the SystemUI.apk decompiled correctly, thank you for this tool :good:
Stryke_the_Orc said:
Found my error. In the install process I went A.D.D. and added an extra directory so nothing wanted to work properly. Fixed the directory and now the SystemUI.apk decompiled correctly, thank you for this tool :good:
Click to expand...
Click to collapse
ok cool no problem, and remember its best to make changes 1 by 1, and compile. so you could no each and every error. it also tell u what went wrong so read it carefully. it would also tell you which line in a xml is causing problems
updated
lorjay589 said:
updated
Click to expand...
Click to collapse
Damn got to wait til i get off work to flash
mighty S3
---------- Post added at 05:02 PM ---------- Previous post was at 05:00 PM ----------
kilawayne said:
Damn
mighty S3
Click to expand...
Click to collapse
mighty S3
I love how noob friendly everyone is here..... Not a noob to rooting/flashing etc.... But actually changing stuff myself...... Total noob
Sent from my SPH-D710 using xda premium
Since this thread was dug up I just want to say that's an awesome little guide for decompiling lol. Just what I have been looking for.
Sent from my SPH-L710 using xda app-developers app

Please help me in this problem

Pleas Help..
When I work Combile and Decombile APKTOOL for File framwork-res.apk
Of Version Jelly Bean 4.1.2 XXLSJ All OK
But When Add My Rom BootLoop
Are you signing the apk after you recompile it??
Sent from my GT-I9300 using Tapatalk 2
AuSSiELaMbChOpS said:
Are you signing the apk after you recompile it??
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
no signing apk
whats this broplem
help
heeeeeeeeeeeeeeeeeeeeeeelp
amro habib said:
help
heeeeeeeeeeeeeeeeeeeeeeelp
Click to expand...
Click to collapse
The problem is with the signing. (The framework-res.apk has to be signed with the platform key)
Try to sign the apk (use apkmultitool), but I think it won't work, because you wont have the platform key.
I suggest you to do the following:
If you use apktool or apk-multi-tool apkmultitool.com:
1) if you want to change drawables, just push the new png-s into the original framework-res.apk (open the original framework-res.apk with 7zip, and drag and drop the new png in the corresponding drawable folder).
2) if you want to change xml-s, decompile framework-res.apk, change xml-s, recompile framework-res.apk, then extract the "resources.arsc" from the new apk, and push it to the original framework-res.apk (again with 7zip or any compatible file manager)
3) if you change some smali code, then you need to the same as in step 2, but with the classes.dex file.
Basically you should use the original framework-res.apk as a starting point, and (without extracting it) push all your mods into it!
OR try the UOT kitchen: http://uot.dakra.lt/
Cheers!
Gyebro said:
The problem is with the signing. (The framework-res.apk has to be signed with the platform key)
Try to sign the apk (use apkmultitool), but I think it won't work, because you wont have the platform key.
I suggest you to do the following:
If you use apktool or apk-multi-tool apkmultitool.com:
1) if you want to change drawables, just push the new png-s into the original framework-res.apk (open the original framework-res.apk with 7zip, and drag and drop the new png in the corresponding drawable folder).
2) if you want to change xml-s, decompile framework-res.apk, change xml-s, recompile framework-res.apk, then extract the "resources.arsc" from the new apk, and push it to the original framework-res.apk (again with 7zip or any compatible file manager)
3) if you change some smali code, then you need to the same as in step 2, but with the classes.dex file.
Basically you should use the original framework-res.apk as a starting point, and (without extracting it) push all your mods into it!
OR try the UOT kitchen: http://uot.dakra.lt/
Cheers!
Click to expand...
Click to collapse
all this work bootloop..

[Q] Decompiling android.policy.jar not working

Whenever I decompile my android.policy.jar with apktool all I get is a folder called android.policy.jar.out with the file apktool.yml in it. Whenever I decompile any other jar or apk it decompiles all the xmls and resources just fine. I got my android.policy.jar from the /system/framework/ directory. The jar was only 303 bytes so maybe I am missing the files or something. Anyone have any clue why this is happening?
If it helps, I did the if framework-res.apk command and it mounted it just fine and I can decompile other jars and apks just fine. I am on sgs-i747 4.1.2 TW stock.
Thanks
I am trying to get the aosp lock screen as seen in this guide http://forum.xda-developers.com/showthread.php?t=2125330
aeppacher said:
Whenever I decompile my android.policy.jar with apktool all I get is a folder called android.policy.jar.out with the file apktool.yml in it. Whenever I decompile any other jar or apk it decompiles all the xmls and resources just fine. I got my android.policy.jar from the /system/framework/ directory. The jar was only 303 bytes so maybe I am missing the files or something. Anyone have any clue why this is happening?
If it helps, I did the if framework-res.apk command and it mounted it just fine and I can decompile other jars and apks just fine. I am on sgs-i747 4.1.2 TW stock.
Thanks
I am trying to get the aosp lock screen as seen in this guide http://forum.xda-developers.com/showthread.php?t=2125330
Click to expand...
Click to collapse
I use 7zip and remove the classes.dex
The decompile the classes.dex
java -jar baksmali.jar -x C:sdk/path_to/your/classes.dex -o C:sdk/destination/folder
evil1art said:
I use 7zip and remove the classes.dex
The decompile the classes.dex
java -jar baksmali.jar -x C:sdk/path_to/your/classes.dex -o C:sdk/destination/folder
Click to expand...
Click to collapse
Can I just use apktool to decompile it like "apktool d classes.dex classes" in the command prompt?
After I make modifications how would I pack it back into a jar? Would I recompile the classes folder and then insert this into the original jar or what? Thank you for the help
After its recompiled open the android.policy with 7zip and add the new classes.dex to it, it will overwrite the old one
evil1art said:
I use 7zip and remove the classes.dex
The decompile the classes.dex
java -jar baksmali.jar -x C:sdk/path_to/your/classes.dex -o C:sdk/destination/folder
Click to expand...
Click to collapse
I have checked the archive in the android.policy.jar with 7zip and the only thing in it was a folder named META-INF filled with a MANIFEST.ML file no classes.dex
EDIT: this may help, but all my jar files in the /system/framework folder are 313bytes exactly. Is this normal or a sign of something wrong
aeppacher said:
I have checked the archive in the android.policy.jar with 7zip and the only thing in it was a folder named META-INF filled with a MANIFEST.ML file no classes.dex
EDIT: this may help, but all my jar files in the /system/framework folder are 313bytes exactly. Is this normal or a sign of something wrong
Click to expand...
Click to collapse
If you dont have a dex file in there you have a problem
evil1art said:
If you dont have a dex file in there you have a problem
Click to expand...
Click to collapse
The problem with that is I just reflashed rooted stock rom with odin and the jars are all empty (just the meta-inf with the manifest.ml file in them). What is going on here?
aeppacher said:
The problem with that is I just reflashed rooted stock rom with odin and the jars are all empty (just the meta-inf with the manifest.ml file in them). What is going on here?
Click to expand...
Click to collapse
Deodexed?
evil1art said:
Deodexed?
Click to expand...
Click to collapse
no, like flashing stock rooted rom with odexes and all, all the jars are empty. I even downloaded the md5 sum from the root tab of the at&t gs3 xda page
aeppacher said:
no, like flashing stock rooted rom with odexes and all, all the jars are empty. I even downloaded the md5 sum from the root tab of the at&t gs3 xda page
Click to expand...
Click to collapse
There's your problem. It needs to be deodexed to do any modifications
iXanza said:
There's your problem. It needs to be deodexed to do any modifications
Click to expand...
Click to collapse
im having similar problem on the galaxy nexus !
Code:
C:\mod\Apktool-4.2.2\Apktool-4.2.2>apktool d classes.dex
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.Direc
toryException: java.util.zip.ZipException: error in opening zip file
at brut.androlib.ApkDecoder.hasSources(ApkDecoder.java:184)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:79)
at brut.apktool.Main.cmdDecode(Main.java:141)
at brut.apktool.Main.main(Main.java:72)
Caused by: brut.directory.DirectoryException: java.util.zip.ZipException: error
in opening zip file
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:55)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:38)
at brut.androlib.res.util.ExtFile.getDirectory(ExtFile.java:55)
at brut.androlib.ApkDecoder.hasSources(ApkDecoder.java:182)
... 3 more
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:53)
... 6 more
C:\mod\Apktool-4.2.2\Apktool-4.2.2>
evil1art said:
After its recompiled open the android.policy with 7zip and add the new classes.dex to it, it will overwrite the old one
Click to expand...
Click to collapse
hi @evil1art -- how to recompile android.policy jar ...tks

[Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Jar

How to Decompile, Recompile & Sign apk
This Guide/Tutorial for Windows user
Requirement :
1. Android SDK, you can download from here (this including Java)
2. Download Latest Apktool 4.2.2 (Including Sign & baksmali) from here (this Support All apk from GB/ICS/JB 4.1.2/4.2.2)
3. Notepad++ for your tool editing xml/smali you can download from here
If you already download/Installed Android sdk/java & Notepadd++ you just download Latest Apktool 4.2.2
Download Latest Apktool, extract to :
Windows XP : C:\Document and setting\folder your computer name
Windows 7 : C:\user\folder your computer name
copy your apk & framework-res.apk/SemcGenericUxpRes.apk/framework 2 to same folder with apktool
Now you can start Editing apk
Example Editing Walkman
Open Command Prompt (CMD)
to decompile :
Code:
apktool if framework-res.apk
apktool d semcmusic.apk ( can be whatever name you give to your apk )
Some Original system apps need installed framework 2 like on stock ROM (SemcGenericUxpRes.apk)
Example
Code:
apktool if framework-res.apk
apktool if semcgenericuxpres.apk
apktool d semcmusic.apk ( can be whatever name you give to your apk )
You can start editing as you want
to recompile :
Code:
apktool b -f -d semcmusic.apk ( can be whatever name you give to your apk )
If done, you can exit CMD
open original SemcMusic.apk using Winrar or 7zip go to folder semcmusic>dist, open semcmusic.apk using Winrar or 7zip
Drag & drop folder META-INF & Lib in original apk to Modified apk, set compression to store and click ok
to sign :
Move apk modified from folder semcmusic>dist to same folder with apktool
Open Command Prompt (CMD)
Example
Code:
java -jar SignApk.jar testkey.x509.pem testkey.pk8 semcmusic.apk semcmusic_signed.apk ( can be whatever name you give to your apk )
NOTE : Sign apk only for apps 3rd Party but you can use for system>app but not all apps
to zipalign :
Open Command Prompt (CMD)
Example
Code:
zipalign -fv 4 semcmusic_signed.apk semcmusic_signed_zipaligned.apk
How to Decompile/Recompile Jar/Editing classes.dex
Copy Jar file to same folder Apktool
Example
framework.jar
to decompile :
Open framework.jar using Winrar or 7zip and extract classes.dex
Drag & drop classes.dex to Quick-Baksmali (CMD)
if done, you can find folder classes-out
now you can start editing smali file using Notepad++
to recompile :
Drag & drop folder classes-out to Quick-Smali (CMD)
if done, you can find New file "new-classes.dex"
rename file to classes.dex
Open framework.jar using Winrar or 7zip
Drag & drop file classes.dex modified to framework.jar using Winrar or 7zip set compression to normal
Credits :
Thanks to Brut.all for apktool
Thanks to Yorzua for Sign apk tool/file
Thanks to Team Reject for Quick baksmali/smali file
NOTE : If you get error when compiling, don't blame me lolz it's your mistake when editing apk
Great Guide Rizal. I am sure many were asking for it.
great tut but can you add some screens/screenshots
auni said:
Great Guide Rizal. I am sure many were asking for it.
Click to expand...
Click to collapse
Thanks, yeah some user confusing editing apk, so i share latest apktool with easy guide
Mtakween said:
great tut but can you add some screens/screenshots
Click to expand...
Click to collapse
Later i will add screenshot for this tutorial
thx nice guide
Sent from my LT26i using xda app-developers app
No doubt.. Its a great guide for some one like me.... Will sit today night and going to learn.... Thanks a lot..
From My Xperia S With XTX7 ROM
now bookmark it!! thanks dude!! :good:
thanks
Thanks for the credits, buddy
nice share there
Great guide Rizal. Decent English too. Lol. Proud to be Sundanese..
In my opinion, there are other more simplified tools that utilized apktool better (I use apkmultitools and vts (virtuous ten studios)) but people needs to know the basic right..
And I think, you need to put the java\bin directory in Path in windows system variables (or Java_home in win8). And it's better (I think) to put sdk directory (adb, fastboot), apktool and the smali jars files in the Path too, so that users can access from any folders/directory.
Sent from my LT26i using Tapatalk 2
WahyuAndri said:
now bookmark it!! thanks dude!! :good:
Click to expand...
Click to collapse
:thumbup:
Yorzua said:
Thanks for the credits, buddy
nice share there
Click to expand...
Click to collapse
Thanks for your support my friend
m1st3r1 said:
Great guide Rizal. Decent English too. Lol. Proud to be Sundanese..
In my opinion, there are other more simplified tools that utilized apktool better (I use apkmultitools and vts (virtuous ten studios)) but people needs to know the basic right..
And I think, you need to put the java\bin directory in Path in windows system variables (or Java_home in win8). And it's better (I think) to put sdk directory (adb, fastboot), apktool and the smali jars files in the Path too, so that users can access from any folders/directory.
Sent from my LT26i using Tapatalk 2
Click to expand...
Click to collapse
Yeah I know, but some user will confusing lolz, this apktool is latest version so will work for apk 4.2.2, old version doesn't work
:thumbup:
Sent from my Xperia V using Tapatalk 2
I've seen other guides say that resources.arsc should be copied from the old apk and stored in the new one.... is that necessary?
thanks =)
THANKS:good::laugh:
Why So Serious? said:
I've seen other guides say that resources.arsc should be copied from the old apk and stored in the new one.... is that necessary?
Click to expand...
Click to collapse
Can anybody shed any light on this?
Hey rizal, following your decmpile/recompile method, the apk wont install, signature problem.
zhuhang said:
Hey rizal, following your decmpile/recompile method, the apk wont install, signature problem.
Click to expand...
Click to collapse
There are some problems when signing the apk. The workaround for this: use some tools (ticklemyandroid does good jobs) to completely signing the apk (I've done this when modifying systemui.apk), you can also learn from it (learn some of its codes). Or just move files that u've modified from the modified (recompiled) apk to original apk (7zip is your friend)
Why So Serious? said:
I've seen other guides say that resources.arsc should be copied from the old apk and stored in the new one.... is that necessary?
Click to expand...
Click to collapse
I don't think it's necessary. But keep in my mind my post above. So it's like u keep the old resource but put the modified (and compiled) files to the original.
Sent from my LT26i using Tapatalk 2
m1st3r1 said:
There are some problems when signing the apk. The workaround for this: use some tools (ticklemyandroid does good jobs) to completely signing the apk (I've done this when modifying systemui.apk), you can also learn from it (learn some of its codes). Or just move files that u've modified from the modified (recompiled) apk to original apk (7zip is your friend)
Click to expand...
Click to collapse
Just moving with normal compression?
zhuhang said:
Just moving with normal compression?
Click to expand...
Click to collapse
Yes. Just move it to one 7zip window to another one...
Sent from my LT26i using Tapatalk 2

Categories

Resources