SystemUI deodexing (Solved) - Nexus 5X Q&A, Help & Troubleshooting

Hey so I have noticed that Charles_l has made a Pixel home button animation for the Nexus 5X (found here : http://forum.xda-developers.com/nexus-5x/themes-apps/mod-pixel-navigation-bar-home-button-t3498614) and wanted to reverse engineer his work so I can port it to other devices. An important thing that I noticed was that he deodexed the SystemUI.odex file and build it back into the SystemUI.apk so he can add files found in the Pixel's odex files.
Now my first step to reverse engineer was to figure out how to deodex the odex files and build them into the apk. At the moment I have downloaded the baksmali.jar and smali.jar from JesusFreke ( https://bitbucket.org/JesusFreke/smali/downloads ) and shifted them to a folder to work in. I have extracted the odex files from the Nexus 5X
Code:
adb pull /system/priv-app/SystemUI.apk/oat/arm64/SystemUI.odex
and extracted the framework for baksmali to work with
Code:
adb pull /system/framework/arm64/
I then moved all the files to the folder containing the baksmali.jar file and ran the command to extra all the smali files
Code:
java -jar baksmali.jar x -c boot.oat SystemUI.odex -o SystemUI
Now I was wondering, How do you build them into the apk? I have tried a few things but they just cause the SystemUI to crash once booted.
If anyone can tell me how to fix this, then please tell me.

Jackio987 said:
Hey so I have noticed that Charles_l has made a Pixel home button animation for the Nexus 5X (found here : http://forum.xda-developers.com/nexus-5x/themes-apps/mod-pixel-navigation-bar-home-button-t3498614) and wanted to reverse engineer his work so I can port it to other devices. An important thing that I noticed was that he deodexed the SystemUI.odex file and build it back into the SystemUI.apk so he can add files found in the Pixel's odex files.
Now my first step to reverse engineer was to figure out how to deodex the odex files and build them into the apk. At the moment I have downloaded the baksmali.jar and smali.jar from JesusFreke ( https://bitbucket.org/JesusFreke/smali/downloads ) and shifted them to a folder to work in. I have extracted the odex files from the Nexus 5X
and extracted the framework for baksmali to work with
I then moved all the files to the folder containing the baksmali.jar file and ran the command to extra all the smali files
Now I was wondering, How do you build them into the apk? I have tried a few things but they just cause the SystemUI to crash once booted.
If anyone can tell me how to fix this, then please tell me.
Click to expand...
Click to collapse
I figured out how to do this so it doesn't matter anymore.
If anyone wants to know you just need to make a small folder in the apk and don't the files to it.

Related

[Q] create a transparant notification screen

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.

[fix] WIFI for JVU (useable on previous release to) 100% tested

I will be releasing the fix on my rom sometimes next week , and I will not compile this for every set up / theme / rom out there but if you know what you are doing this is pretty easy fix
Here is how the fix works :
Our present kernel source is 2.3.4 and we are running 2.3.6 base . So I looked at what was different in the wifi files from 2.3.4 to 2.3.6 and there you go .
Files attached at the end of the post are 2.3.4 JVQ (already modified for JVU)
(fyi these files come from apk manager just rename your jar files to apk to decompile them then copy the files attached at the end of the post in there respective places )
_framework.jar :
delete: \android\net\wifi\WifiStateTracker$1.smali
and copy paste the files attached and recompile
_services.jar :
copy paste the files attached and recompile
_'etc' folder copy paste into your /system folder in your rom/Phone
(not 100% sure its needed but better use them anyways)
IF you are not on JVU you need to change the ids manually , the names of the values are written in the smali so that will make it easier to port to other versions .
Tested on Belkin router (the worst of them all) and on public wifi with no dhcp assigned . after an hour no disconnect flawless victory
For beginers here is a guide by pantrif13 : http://forum.xda-developers.com/showpost.php?p=22032781&postcount=16
Credits to Shoman94 for pointing me in the right direction and providing files to help me diff(and being insistent about it )
suprstar for testing
and gtg465x who achieved this first on the SGS2
Will this fix the adhoc problem too ?
You are the master.
Sent from my GT-I9000 using xda premium
HSaber said:
Will this fix the adhoc problem too ?
Click to expand...
Click to collapse
well this fix the current wifi bug , rule of thumb if it was wokring back on JVQ for you , and it stopped after that , now it works .
try and tell us
I'm using it in my rom thank you!
Can some1 please explain me how to recompile...
Sent from my GT-I9000 using XDA App
burakgon said:
I'm using it in my rom thank you!
Click to expand...
Click to collapse
Pleasure.. Spam my thx button ?
Little mention on your credits maybe
To others if you don't know how to use apkmanager this mid is not for you
Tell your favorite rom dev about it it takes a few minutes to apply this
I could have kept this to my rom but I put it out there for all rom to use
This fix really works
DAGr8 said:
Pleasure.. Spam my thx button ?
Little mention on your credits maybe
To others if you don't know how to use apkmanager this mid is not for you
Tell your favorite rom dev about it it takes a few minutes to apply this
I could have kept this to my rom but I put it out there for all rom to use
This fix really works
Click to expand...
Click to collapse
Bootloop when I try it on odexed rom. (Deodexed applied odexed) JVU
burakgon said:
Bootloop when I try it on odexed rom. (Deodexed applied odexed) JVU
Click to expand...
Click to collapse
well use odex jvq ..
(fyi these files come from apk manager just rename your jar files to apk to decompile them then copy the files attached at the end of the post in there respective places )
_framework.jar :
delete: \android\net\wifi\WifiStateTracker$1.smali
and copy paste the files attached and recompile
_services.jar :
copy paste the files attached and recompile
_'etc' folder copy paste into your /system folder in your rom/Phone
(not 100% sure its needed but better use them anyways)
Click to expand...
Click to collapse
cant get the instrucstion newbie here..how can i use this one pls can u use much more clearer instructions for newbies..thank you very much in advance
Great work!
Thx for your time.
titaempoy said:
cant get the instrucstion newbie here..how can i use this one pls can u use much more clearer instructions for newbies..thank you very much in advance
Click to expand...
Click to collapse
As said in OP, until built for any ROM version: Be your own developer!
Adb pull the system .jar files, decompile with dependency, edit, compile, rename, adb push result.
are a beginner and I did not understand anything ,more clear PLEASE if you can, thanks!...I think your work is useful
I think many people could do with a step by step guide for this if anyone has the time to do it
Please note our desires about this topic...declared above..thanks!
romyo said:
Please note our desires about this topic...declared above..thanks!
Click to expand...
Click to collapse
I think that dagr8 explain very clear what needs to be done (but you need to have some experience with decompiling and compiling).
Here what you need to do in case you are on jvu:
1) First off all you need the latest JDK and JRE installed on your system.
2) Then go here to learn how to set up apktool.
3) After the setup of apktool pull the services.jar (services.odex if you have odex rom) and framework.jar (framework.odex in case of odex rom) and put it in your apktool folder
4)
a. If you are on deodex rom you only need to run these commands from the folder of apktool (go to apktool folder and press ctrl and shift -open command window here)
Code:
apktool d framework.jar
apktool d services.jar
You will find two new folders (servicesout and frameworkout)
Then do what dagr8 said in op.
b. if you are on odex rom: get the latest baksmali from here
then pull all your system/framework to your pc and put baksmali.jar there.
Open commant window and write:
for sevices:
Code:
java -jar baksmali.jar -c :core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar -xa 10 services.odex -o services.jar.out
for framework:
Code:
java -jar baksmali.jar -c :core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar -xa 10 framework.odex -o framework.jar.out
Then do what dagr8 said.
5)Both deodex odex: get the latest smali from here
Put it in the folder with out folders and write:
for services:
Code:
java -jar smali.jar sevices.jar.out -o classes.dex
you will find a new classes.dex file.Open services.jar with winrar and drag and drop (overwrite) there.
Then for framework:
Code:
java -jar smali.jar framework.jar.out -o classes.dex
Same here (open the jar with winrar and drag and drop)
5) if you are on deodex rom you finished just push the new services and framework to the system along with the files which provide dagr8 for etc folder.
6) if you are on odex...go here and follow the guide from the part odexing back...
I hope i helped!
Thanks a lot dagr8 for this!!
can dev provide the public.xml that this was made with for comparison of ids?
Thanks for your time and explanations given pantrif13 and dagr8, expecting something more simple ... you can install the CWM (example) ... so (who knows it's easy anyway)...expect other solutions!!!to solve the problem with wifi...
Great job. Thanks
i m on jw1 deodex jetpack custom rom 8.2 and i am using the jvt modem...
will you provide fix for jw1 rom next days? thank you !!!

[REQ] Volume rocker wake function request......

I am using XXLEF, is there anyone can help me on this please?
Any luck ?
bonglau0429 said:
I am using XXLEF, is there anyone can help me on this please?
Click to expand...
Click to collapse
Hey, if you upload the android.policy.jar (found in /system/framework) from the XXLEF ROM I can do this for you. If it's not deodexed I'll also need the android.policy.odex.
Alternatively you could DIY using the instructions on this thread: http://forum.xda-developers.com/showthread.php?t=1585309
Thanks Atarii!!:good:
but i have a problems on it,
I've extracted out a files from android.policy.odex and edit the KeyguardViewMediator.smali successfully, but how to compress it to a android.policy.odex............? Can you teach me?
:crying::crying:
Here is my odex and jar files
Thanks again Atarii!
bonglau0429 said:
:crying::crying:
Here is my odex and jar files
Thanks again Atarii!
Click to expand...
Click to collapse
Hey,
Good work getting the file editted. :good:
After you made the changes to the smali code, you need to compile it into a classes.dex file:
Code:
java -Xmx1024m -jar smali.jar out -o classes.dex
(Where out is the name of the folder with the smali code in)
Now drag that classes.dex file into the original android.policy.jar (keep a backup of the android.policy.jar somewhere else).
Then follow the steps from "ODEXING BACK" in this guide: http://forum.xda-developers.com/showthread.php?t=1208320 :fingers-crossed:
Let us know if you have any troubles

need help on framework.jar compile and dicompile

hii guys
i know there is steps to merge framework.jar but i cant find myself there
i know there are many users around knows how to do that
so maybe someone can give a hand on this and help us out !!
i want to merge 2 diffrent frameworks for miui jelly bean
any volinteer ??
sparxx4 said:
hii guys
i know there is steps to merge framework.jar but i cant find myself there
i know there are many users around knows how to do that
so maybe someone can give a hand on this and help us out !!
i want to merge 2 diffrent frameworks for miui jelly bean
any volinteer ??
Click to expand...
Click to collapse
1. Decompile
java -Xmx512M -jar baksmali.jar framework.jar
(creates folder "out" with de-compiled data)
2. Make changes
3. Recompile
java -Xmx512M -jar smali.jar out -o classes.dex
4. Open the framework.jar (not open in window, but open in zip manager) and drag the classes.dex into the open zip window and replace the existing classes.dex.
Download smali and baksmali from HERE

[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

Categories

Resources