Remove All Ads from XDA
Honor 7x
Win an Honor 7X!

[DEV] How to add EDT Tweaks support in your odexed ROM/Themes

3,102 posts
Thanks Meter: 6,328
By LeoMar75, Retired Recognized Developer / Retired Forum Moderator on 8th August 2011, 12:03 PM
Post Reply Email Thread
Original Threads (deodexed ROM/Themes)
[MOD] [JVP] Statusbar Tweaks - EDT
[MODS][MORPH] Kahvitahra's mods - EDT TWEAK

How to get it working on an ODEXED ROM!
The only file we are going to modify is /system/app/SystemUI.apk

If you already got this apk deodexed skip to step#2 (you can check for it by opening SystemUI.apk and check if classes.dex is already present)

Step#1 (baksmali)
You need to baksmali SystemUI.apk, i suppose you already know how to do it, if not just use search button!!!

Step#2 (apk-manager)
I am using apk-manager, so before to continue make sure you already have this tool installed and working!
  1. Copy deodexed SystemUI.apk to place-apk-here-for-modding folder
  2. Start Script.bat (don't close this windows we will use it later on)
  3. Select option "19) Select compression level for apk's" and hit 0
  4. Set current project (option 22)
  5. Decompile apk (option 9)
  6. go to projects\SystemUI.apk\res\layout and overwrite status_bar.xml with the file attached
  7. go to projects\SystemUI.apk\smali\com\android\systemui\s tatusbar and copy the following files from the attached zip file: BatteryText$1.smali, BatteryText$SettingsObserver.smali, BatteryText.smali, Clock$1.smali, Clock.smali, DateView.smali
  8. go to projects\SystemUI.apk\smali\com\android\systemui\s tatusbar\policy and overwrite StatusBarPolicy.smali with the one inside the zip file attacched
  9. go back to the apk-manager windows (cmd.exe windows started with Script.bat) and select "Compile apk" (option 11)
  10. just answer "yes" to the two questions you will promt!
  11. Now before to go ahead, you will notice that a new folder "keep" has been created, open up that folder and delete "classes.dex" and "resources.arsc" then go to res/layout folder and delete status_bar.xml
  12. Go back to the apk-manager windows and press enter to continue!
  13. At the end you will see in place-apk-here-for-modding folder you modified unsignedSystemUI.apk

Step#3 (odex back)
-Download and copy "dexopt-wrapper" on /system/bin
-In adb just type:
adb shell echo $BOOTCLASSPATH
you should use the above string later on!
-copy "unsignedSystemUI.apk" from your pc to your /sdcard/mod folder (create this folder) and rename it to SystemUI.apk
-copy /sdcard/mod/SystemUI.apk to /sdcard/mod/done/SystemUI.apk, now open without extract it (use 7zip winrar..) and delete classes.dex.

> adb remount
> adb shell
# su
# cd /system/bin
# busybox chmod 755 dexopt-wrapper
Now you have right permission for dexopt-wrapper

Let's create a new .odex file from the SystemUI.apk file

# cd /sdcard/mod
# dexopt-wrapper SystemUI.apk new.odex [BOOTCLASSPATH]
fill in the value of BOOTCLASSPATH, without the []
do NOT continue until this command succeeds!

At this point your new.odex file won't work because dalvik virtual Machine store checksum for each packages which means that your new.odex file cannot pass this check on boot.
We will fix it:
Copy over the "signature" from the current(original one in your /system/app) .odex file into the new .odex file.

# busybox dd if=/system/app/SystemUI.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
now replace the old .odex file with the new .odex file. Also we will copy the apk without classes.dex to /system/app

# cd /system/app
# busybox cp /sdcard/mod/new.odex SystemUI.odex
# busybox chmod 644 SystemUI.odex
# busybox cp /sdcard/mod/done/SystemUI.apk SystemUI.apk
# busybox chmod 644 SystemUI.apk
# sync
# reboot
That's it!

Remember to backup your system before you start doing it, because some time your phone won't boot, maybe because you made some mistake in the smali code you have changed...
I usualy prepare a zip package with the original file i am going to replace, therefore if something goes wrong i can flash them back via CWM the original one!

Hope it can help!

Thanks to Kahvitahra for source code and every single one in this community.
The Following 10 Users Say Thank You to LeoMar75 For This Useful Post: [ View ] Gift LeoMar75 Ad-Free
8th August 2011, 12:25 PM |#2  
kahvitahra's Avatar
Senior Member
Thanks Meter: 1,159
Hi mate!

I also moded dateview.smali to show clock in pulldownbar
8th August 2011, 12:32 PM |#3  
LeoMar75's Avatar
OP Retired Recognized Developer / Retired Forum Moderator
Flag Pescara
Thanks Meter: 6,328
Donate to Me
Originally Posted by kahvitahra

Hi mate!

I also moded dateview.smali to show clock in pulldownbar

Thanks Bro!

OP has been updated!
8th August 2011, 01:24 PM |#4  
Senior Member
Flag Belo Horizonte
Thanks Meter: 16
Suggestion for thread title:

How to add EDT Tweaks support in your odexed ROM/Themes.
The Following User Says Thank You to JcMatos For This Useful Post: [ View ] Gift JcMatos Ad-Free
8th August 2011, 01:51 PM |#5  
Senior Member
Flag Belo Horizonte
Thanks Meter: 16
Another suggestion:

Put links for the original threads on first post:

[MOD] [JVP] Statusbar Tweaks - EDT

[MODS][MORPH] Kahvitahra's mods - EDT TWEAK
8th August 2011, 01:55 PM |#6  
ExilHh's Avatar
Senior Member
Flag Nuremberg
Thanks Meter: 136
OK, after the 1st quick overview i must say...i like my LeoMAR ROM as it is now! ;o)

Never done something like that before and i don´t wanna challenge my luck too much...
10th August 2011, 05:22 PM |#7  
sicopat's Avatar
Senior Member
Thanks Meter: 960
Donate to Me
Just wonderfull Many thanks
8th October 2011, 12:47 PM |#8  
PFittech's Avatar
Senior Member
Flag Zilina
Thanks Meter: 1,040
Donate to Me
Lightbulb Second way
Edited post
13th October 2011, 06:05 PM |#9  
Flag Napoli
Thanks Meter: 1
Can i have an italian guide to apply this on my odexed rom? i never use this program...i know only how install a rom! now i have a tweaky rom v2 on my sgs
is it possible to do??? grazie infinite!!!
26th October 2011, 07:40 PM |#10  
ql4y3r's Avatar
Senior Member
Flag Sun City - Szeged
Thanks Meter: 27
Hy. Can anyone make me this for XWKJ1 odexed rom pls?
29th October 2011, 03:07 AM |#11  
battax's Avatar
Senior Member
Flag Odivelas
Thanks Meter: 14
.method private final updateClock()V
    .locals 5

    .line 78
    new-instance v0, Ljava/util/Date;

    invoke-direct {v0}, Ljava/util/Date;-><init>()V

    .line 85
    .local v0, now:Ljava/util/Date;
    const/4 v1, 0x2
    const/4 v2, 0x0

    invoke-static {v1, v2}, Ljava/text/DateFormat;->getDateTimeInstance(II)Ljava/text/DateFormat;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/DateView;->setText(Ljava/lang/CharSequence;)V

    .line 87
.end method
Sorry for reviving this thread but i have a question.

With this code in DateView.smali i got an am/pm clock and i use a 24h format.

Anyone knows how to edit DateView.smali or StatusBarPolicy.smali to get a 24H format on the clock in the notification pulldown?

I´ve been searching and found some references but it looks a little "grey" to me, because they only refer on removing the am/pm and not displaying 24h format.

Is there a way to get the correct time format from this line?

invoke-static {v1, v2}, Ljava/text/DateFormat;->getDateTimeInstance(II)Ljava/text/DateFormat;

Edit: If i change system language to Portuguese, the clock displays 24h format, but in english it only displays 12h. Still no go, i want to use english.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes