KDZ of Android 5.0.1 Captured for T-Mobile LG G3

T-Mobile US is yet to release the 20B Lollipop build for the LG G3. Luckily enough, you … more

Build Custom Stock Kernel with Linaro GCC 4.9.1

With this guide for Sony devices, you will learn how to build a kernel using the Linaro … more

What’s Your Biggest Reason for Not Owning an iPhone?

With XDA being a community of Android enthusiasts, it is not uncommon to see … more

“New Kernel” for OnePlus One

If you are hungry for a new kernel on your OnePlus One, XDA Senior Member jgcaap‘s … more
Post Reply Subscribe to Thread Email Thread

[HOW TO] Decompile and recompile SystemUI.apk JB 4.2.2

11th October 2013, 03:25 AM |#1  
OP Senior Member
Flag Jakarta
Thanks Meter: 80
 
117 posts
Join Date:Joined: Aug 2013
More
This tutorial i'll show you how to decompile and recompile systemui.apk windows only.
Why i made this, because i try to decompile systemui.apk and recompile it but it always failed when i recompile.

The problem when recompile is devide into 2 categories:
1. Style
2. No default translation


I dont know its is only mega systemui or all other devices too, but all device with 4.2.2 JB have almost same problem,

What tools do we need for this:
1. APKTool compatible with 4.2.2
2. AAPT
3. Zipalign
*) I already upload number 1-3 on the attatchment below
4. 7zip
5. Notepad++

Lets go to the tutorial:
1. Extract all tool (1-3) that we've dowload below and put all 4 files in c:\WINDOWS
2. Make folder in C:\ directory, in this tutorial i use APK TOOL
3. Put framework-res.apk and systemui.apk in this folder
4. Make another folder inside the APK TOOL called backup, and put another copy of systemui.apk there
5. Open CMD
6. CD the folder that you made, ex: cd apk tool
7. Than we start decompile by
PHP Code:
apktool if framework-res.apk
apktool 
if systemui.apk
apktool d systemui
.apk 
8. When its done we'll have a folder called systemui, we can make any change there

After you make a change on your SystemUI.apk its time to recompile back..

9. Now if we proceed to compile the apk and it will make 2 error that i already mention above, but its okay we need to know where the error come from
PHP Code:
apktool b systemui almostdone.apk 
After that command a lot of error will show up in your cmd window. Lets fix it one by one.

Find the first problem:
C:\APK Tool\systemui\res\layout\system_bar_notification_p anel_title.xml:14: error: Error: No resource found that matches the given name (at 'style' with value @style/SystemBarNotificationText').

Its mean the first problem is style in C:\APK Tool\systemui\res\layout\system_bar_notification_p anel_title.xml, and the error in line 14
Now open the xml file with notepad++ and find line 14, please add + in front of @style/SystemBarNotificationText.
Old: @style/SystemBarNotificationText
New: @style/SystemBarNotificationText

And continue another style problem with same treat as above

After all style finish please try recompile again to know if all the style problem already gone
PHP Code:
apktool b systemui almostdone.apk 
If there is no style error again proceed to 2nd problem

2nd Problem
aapt: warning: string 'day_of_week_long_sunday' has no default translation in C:
\APK Tool\systemui\res; found: mk
aapt: warning: string 'day_of_week_long_thursday' has no default translation in
C:\APK Tool\systemui\res; found: mk


For no translation problem:
1. Open your systemui decompile folder and go to build/apk and delete androidmanifest.xml there
2. Open as archive your systemui.apk from backup folder above
3. Copy folder META-INF and AndroidManifest.xml
4. Paste both in build/apk
5. Done

When you try to recompile again
PHP Code:
apktool b systemui almostdone.apk 
everything should ok now and almostdone.apk already created in your folder.


10. Open as archive almostdone.apk and original systemui.apk from backup folder side by side with 7zip
11. Delete META-INF and AndroidManifest.xml from almostdone.apk and replace it with META-INF and AndroidManifest.xml from original SystemUI.apk
12. Close the 7zip folder and open cmd again and now put command
PHP Code:
zipalign -v 4 almostdone.apk done.apk 
13. Now the done.apk is already created, copy to your phone and rename it with SystemUI.apk
14. Put in /System/App and it should work.

Credit to:
@powerpoint45 for the amazing thread about compilation systemui.apk original thread
@devabhishek for the tips in no translation original post

Hope this help guys, please press thanks below if this information is useful for you
Happy theming guys..
Attached Files
File Type: 7z APK Tool 4.2.2.7z - [Click for QR Code] (2.71 MB, 2027 views)
The Following 16 Users Say Thank You to jusho For This Useful Post: [ View ]
11th October 2013, 03:45 AM |#2  
powerpoint45's Avatar
Senior Member
Flag Dallas
Thanks Meter: 2,049
 
2,223 posts
Join Date:Joined: Jan 2012
Donate to Me
More
Thanks for credits

Sent from my Amazon Kindle Fire2 using Tapatalk 2
The Following 2 Users Say Thank You to powerpoint45 For This Useful Post: [ View ]
19th January 2014, 01:07 AM |#3  
feizhel_vandrago's Avatar
Senior Member
Flag South Kalimantan
Thanks Meter: 45
 
144 posts
Join Date:Joined: Dec 2012
More
how about framework-res.apk? is it same?
15th August 2014, 02:35 AM |#4  
ArshArora's Avatar
Senior Member
Flag In ur Heart ♥
Thanks Meter: 72
 
129 posts
Join Date:Joined: Jan 2014
More
Awesome Bro ,,, I was really need this Thanks and made a thread for framework-res.apk also ... Thanks
15th March 2015, 02:03 PM |#5  
Junior Member
Flag Noida
Thanks Meter: 0
 
4 posts
Join Date:Joined: Dec 2014
More
plz help me i am not able to decompile it (systemui.apk)
C:\Users\Aman Kumar\Desktop\New folder>apktool if framework-res.apk
W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: drawable-nodpi-v8-ERR0
W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: drawable-v8-ERR1
W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: drawable-hdpi-v8-ERR2
I: Framework installed to: C:\Users\Aman Kumar\apktool\framework\1.apk

C:\Users\Aman Kumar\Desktop\New folder>apktool if systemui.apk
I: Framework installed to: C:\Users\Aman Kumar\apktool\framework\127.apk

C:\Users\Aman Kumar\Desktop\New folder>apktool d systemui.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Aman Kumar\apktool\framework\1.apk

W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: drawable-nodpi-v8-ERR0
W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: drawable-v8-ERR1
W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: drawable-hdpi-v8-ERR2
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x01080956
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x010806c8
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x010806c8
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x010806c8
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x01080b03
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x01080754
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x010806c4
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x010806c8
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x01080b03
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x01080b04
I: Decoding values */* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec:
0x010406a3
at brut.androlib.res.data.ResPackage.getResSpec(ResPa ckage.java:61)
at brut.androlib.res.data.ResTable.getResSpec(ResTabl e.java:58)
at brut.androlib.res.data.ResTable.getResSpec(ResTabl e.java:54)
at brut.androlib.res.data.value.ResReferenceValue.get Referent(ResReferen
ceValue.java:62)
at brut.androlib.res.data.value.ResReferenceValue.enc odeAsResXml(ResRefe
renceValue.java:46)
at brut.androlib.res.data.value.ResScalarValue.encode AsResXmlValueExt(Re
sScalarValue.java:86)
at brut.androlib.res.data.value.ResScalarValue.encode AsResXmlValue(ResSc
alarValue.java:55)
at brut.androlib.res.data.value.ResScalarValue.encode AsResXmlItemValue(R
esScalarValue.java:48)
at brut.androlib.res.data.value.ResArrayValue.seriali zeToResValuesXml(Re
sArrayValue.java:61)
at brut.androlib.res.AndrolibResources.generateValues File(AndrolibResour
ces.java:440)
at brut.androlib.res.AndrolibResources.decode(Androli bResources.java:243
)
at brut.androlib.Androlib.decodeResourcesFull(Androli b.java:115)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:11 4)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)

C:\Users\Aman Kumar\Desktop\New folder>
21st March 2015, 01:56 AM |#6  
Junior Member
Flag Magnolia, Texas
Thanks Meter: 0
 
11 posts
Join Date:Joined: Mar 2014
More
Screenshot?
Can you post a screenshot showing what can be done with this?
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes