Edit the SystemUI_ZTE.apk? - ZTE Axon 7 Questions & Answers

Hi,
I want to edit the SystemUI_ZKE.apk, but when I use "APK Editor Pro" for instance the apk crashes after a reboot.
What would be the right way to do this? My goal is to delete the charging.ogg file that wakes my wife as I plugin a charger when I go to bed
Any other solution to *that* problem is welcome too.
I'm on a A2017G B06 btw.
Thanks in advance,
Cheers,
/Cacti
Edit: Sorry, wrong forum, should be posted in the Questions & Answers. @mods: please move it, thanks.

le_cactus said:
Hi,
I want to edit the SystemUI_ZKE.apk, but when I use "APK Editor Pro" for instance the apk crashes after a reboot.
What would be the right way to do this? My goal is to delete the charging.ogg file that wakes my wife as I plugin a charger when I go to bed
Any other solution to *that* problem is welcome too.
I'm on a A2017G B06 btw.
Thanks in advance,
Cheers,
/Cacti
Edit: Sorry, wrong forum, should be posted in the Questions & Answers. @mods: please move it, thanks.
Click to expand...
Click to collapse
You need to use apktool on Windows or Linux instead: https://ibotpeaches.github.io/Apktool/. You'll need Java already installed.
Your device also needs to be rooted and have TWRP recovery installed.
Put the apktool.jar and wrapper script in the system directory (C:\Windows on Windows)
Pull frameworks and SystemUI from your device with
Code:
adb pull /system/framework/framework-res.apk
adb pull /system/framework/framework-zte-res.apk
adb pull /system/priv-app/SystemUI_ZTE/SystemUI_ZTE.apk
Install frameworks to your computer:
Code:
apktool if framework-res.apk
apktool if framework-zte-res.apk
Decompile SystemUI_ZTE.apk:
Code:
apktool d SystemUI_ZTE.apk
Make whatever changes you want to make then recompile with:
Code:
apktool b SystemUI_ZTE
Use signapk.jar to sign the apk then put the apk into a flashable zip and flash to your device in TWRP.
If you want to make changes to smali you'll need to pull the SystemUI_ZTE odex file and deodex the apk with oat2dex and then use 7-zip or WinRAR to paste the classes.dex file into the apk before decompiling.

Gr8 tutorial. I'll try that tomorrow, hope I get it fixed. Thank you!
Cheers,
/Cacti
Sent from my ZTE A2017G using XDA-Developers Legacy app

Hi,
*
Earlier I tried with APK Editor Pro (https://play.google.com/store/apps/details?id=com.gmail.heagoo.apkeditor.pro)
What happened was (after replacing the SystemUI_ZTE.apk with the modified APK) after a reboot the system booted with parts of the UI nog working. Navigationkeys didn't work except for the home button, and I had no status bar at all. After rebooting again it only showed my wallpaper, and no matter what I did it wouldn't show me anything else. So I had to restore.
*
Modifying the APK with the APKTool gave me the exact same result. Only thing i did differently as to bkores guide was I signed it using ZipSigner (but that never failed me before) and I just replaced the file using TWRP, instead of flashing it through an installer zip. But I can't imagine that being the problem?
*
Anyways, anybody able to modify the SystemUI_ZTE.apk? All I need is the B06 (A2017G) with a replaced charging.ogg (with only silence).*Any tips are welcome.
*
TIA,
*
Cheers,
/Cacti
Sent from my ZTE A2017G using XDA-Developers Legacy app

le_cactus said:
Hi,
*
Earlier I tried with APK Editor Pro (https://play.google.com/store/apps/details?id=com.gmail.heagoo.apkeditor.pro)
What happened was (after replacing the SystemUI_ZTE.apk with the modified APK) after a reboot the system booted with parts of the UI nog working. Navigationkeys didn't work except for the home button, and I had no status bar at all. After rebooting again it only showed my wallpaper, and no matter what I did it wouldn't show me anything else. So I had to restore.
*
Modifying the APK with the APKTool gave me the exact same result. Only thing i did differently as to bkores guide was I signed it using ZipSigner (but that never failed me before) and I just replaced the file using TWRP, instead of flashing it through an installer zip. But I can't imagine that being the problem?
*
Anyways, anybody able to modify the SystemUI_ZTE.apk? All I need is the B06 (A2017G) with a replaced charging.ogg (with only silence).*Any tips are welcome.
*
TIA,
*
Cheers,
/Cacti
Click to expand...
Click to collapse
Try copying META-INF folder from old apk to new apk. If that doesn't work try copying resources.arsc from new apk to old apk and flash the old apk. Don't sign

Can it have anything to do with the .odex file?
I'll try the meta-inf thingy and see if that works
Cheers,
/Cacti
Sent from my ZTE A2017G using XDA-Developers Legacy app

Actually try this instead. I think the apk needs to be deodexed before it can be modified like you said.
Pull the odex file
Code:
adb pull /system/priv-app/SystemUI_ZTE/oat/arm64/SystemUI.odex
Get smali folder from the odex file with oat2dex.jar here: https://github.com/testwhat/SmaliEx/releases/tag/snapshot
Open command window in directory of odex file
Code:
java -jar oat2dex.jar smali SystemUI.odex
Decompile the apk and then copy and paste the smali folder into the directory of the decompiled apk.
Make your charging.ogg change and then recompile the apk. Copy and paste the META-INF from original apk to new apk.
Push apk to your device and delete the "oat" folder in the SystemUI_ZTE folder on your device.

Hi,
Thank you for your support so far, but that didn't work out eighter....
bkores said:
Code:
adb pull /system/priv-app/SystemUI_ZTE/oat/arm64/SystemUI.odex
Click to expand...
Click to collapse
Assuming you made a typo (since there is no SystemUI.odex) I used this instead:
Code:
adb pull /system/priv-app/SystemUI_ZTE/oat/arm64/SystemUI_ZTE.odex
bkores said:
Get smali folder from the odex file with oat2dex.jar
Click to expand...
Click to collapse
After the oat2dex command I don't have a smali folder, just 5434 smali files scattered over serveral folders, so I don't know how to proceed from there.
Cheers,
/Cacti

le_cactus said:
Hi,
Thank you for your support so far, but that didn't work out eighter....
Assuming you made a typo (since there is no SystemUI.odex) I used this instead:
After the oat2dex command I don't have a smali folder, just 5434 smali files scattered over serveral folders, so I don't know how to proceed from there.
Cheers,
/Cacti
Click to expand...
Click to collapse
Well then create a folder called smali in the directory of decompiled apk and paste the folders into smali

Can someone help me, i want to change framework.jar but there is no classes.dex in jar nor framework.odex in /system/framework/oat/arm64 (also arm). Because of it i can't decompile it with smali/baksmali tool. I want to change volume steps in AudioService exactly what VolumeSteps+ do but without Xposed. Any help? I'm on Nougat B10 Rom.

SkaboXD said:
Can someone help me, i want to change framework.jar but there is no classes.dex in jar nor framework.odex in /system/framework/oat/arm64 (also arm). Because of it i can't decompile it with smali/baksmali tool. I want to change volume steps in AudioService exactly what VolumeSteps+ do but without Xposed. Any help? I'm on Nougat B10 Rom.
Click to expand...
Click to collapse
Perhaps this can help a bit : https://forum.xda-developers.com/axon-7/themes/a2017-volume-steps-enabler-call-media-t3745747
If you want a decompiled framework, I can send you. Just pm me.
If you want I'll implement your mods and recompile again. Up to you to test

raystef66 said:
Perhaps this can help a bit : https://forum.xda-developers.com/axon-7/themes/a2017-volume-steps-enabler-call-media-t3745747
If you want a decompiled framework, I can send you. Just pm me.
If you want I'll implement your mods and recompile again. Up to you to test
Click to expand...
Click to collapse
I solved a problem, AudioService is not in framework.jar anymore, it's on services.jar. Check my post on your mentioned thread.

Related

how do i deoxed single apks?

iv been looking but cant figure it out, no one gives instructions on how to use there deodex tools
Download AvaboxV2 Here
Unzip the download somewhere, open up the 'De-odexer' and view the readme.
I think you just put the apk and odex file inside the "de-odexer" folder and double-click the ''deodexall.bat" or "deall.bat", something along those lines.
Can't check right now since I'm on my phone
i down loaded an used but its not creating a Classes.dex
DubsideWICKED said:
i down loaded an used but its not creating a Classes.dex
Click to expand...
Click to collapse
AvaboxV2 won't do that, it will take both the APPNAME.apk & APPNAME.odex files and make it into a single de-odexed APPNAME.apk
If you want the classes.dex file check out smali tools I believe that should do it for you. It may decompile as out.dex, if it does just rename it back to classes.dex
Edit: instructions for it are HERE
I think apk manager will let you deodex files as well.... I think....
theimpaler747 said:
I think apk manager will let you deodex files as well.... I think....
Click to expand...
Click to collapse
if it does i have never seen it
i thought when u de-odexed a file that it created a classes dex. im still having problemswith all methods mentioned
attach the apk and the odex files in a zip so I can download them. when I have time I'll see if I can get the classes.dex file for you and let you know what I did to get it
kyouko said:
attach the apk and the odex files in a zip so I can download them. when I have time I'll see if I can get the classes.dex file for you and let you know what I did to get it
Click to expand...
Click to collapse
i think its the systemUI he is trying to deodex everything i have tried to deodex it errors out.
however i have circumvented it and i am excited
ya im tryin to do what kyle said. i just wanna edit the signal bars. is it possible to make a odex file for a apk.

Editing XML's

Sorry if this is the wrong place for this post. I have spent the last 2 hours looking for an answer to this. What is the easiest and best way to edit xml files to change font color in the theme i am working on. I cannot find a method that works. I have tried a few of the big name xml editors out there and they wont even open the files. I would like to be able to open and edit them on my computer. I used 7zip to pull the individual xml's i wanna exit out and into their own folder. Now i just need a way to edit them, then use 7zip to put them back into the Framework.res apk. Thanks in advance for any help.
willjohnson said:
Sorry if this is the wrong place for this post. I have spent the last 2 hours looking for an answer to this. What is the easiest and best way to edit xml files to change font color in the theme i am working on. I cannot find a method that works. I have tried a few of the big name xml editors out there and they wont even open the files. I would like to be able to open and edit them on my computer. I used 7zip to pull the individual xml's i wanna exit out and into their own folder. Now i just need a way to edit them, then use 7zip to put them back into the Framework.res apk. Thanks in advance for any help.
Click to expand...
Click to collapse
i wondered this too as i was learning how to theme, first you have to decompile the .apk i was advised to use notepad++ on windows, use apktool located in your tools folder of sdk to decompile and then open your xmls in notepad++ then after you're done editing use the command window to use apktool build > the directory of ur decompiled .apk
Funnyface19 said:
i wondered this too as i was learning how to theme, first you have to decompile the .apk i was advised to use notepad++ on windows, use apktool located in your tools folder of sdk to decompile and then open your xmls in notepad++ then after you're done editing use the command window to use apktool build > the directory of ur decompiled .apk
Click to expand...
Click to collapse
This is the best advice. I just started using apktool myself.
willjohnson said:
Sorry if this is the wrong place for this post. I have spent the last 2 hours looking for an answer to this. What is the easiest and best way to edit xml files to change font color in the theme i am working on. I cannot find a method that works. I have tried a few of the big name xml editors out there and they wont even open the files. I would like to be able to open and edit them on my computer. I used 7zip to pull the individual xml's i wanna exit out and into their own folder. Now i just need a way to edit them, then use 7zip to put them back into the Framework.res apk. Thanks in advance for any help.
Click to expand...
Click to collapse
You can't just pull them with 7zip, you have to decompile the apk the xml files are in and then you can simply use notepad++ or any xml editor to edit them.
Use APK Manager to decompile and recompile.
Sent from my DROIDX using XDA App
willjohnson said:
Sorry if this is the wrong place for this post. I have spent the last 2 hours looking for an answer to this. What is the easiest and best way to edit xml files to change font color in the theme i am working on. I cannot find a method that works. I have tried a few of the big name xml editors out there and they wont even open the files. I would like to be able to open and edit them on my computer. I used 7zip to pull the individual xml's i wanna exit out and into their own folder. Now i just need a way to edit them, then use 7zip to put them back into the Framework.res apk. Thanks in advance for any help.
Click to expand...
Click to collapse
You can also use apkmanager. This makes editing xml's and any images a breeze...
http://forum.xda-developers.com/showthread.php?t=695701
Wow, put up a post, go to bed, wake up and all my answers are here. Thanks a lot guys for the info and quick responses. I think i can figure it out with all the info you have supplied. Thanks again
Apkmanager ended up being my favorite method. But use version 4.8, I had issues with 4.9 not compiling apk's properly.
Apkmanager lets you pull apk's, extract, compile, zipalign, sign, and push them back to your device.
I have been trying the apk manager and have not been able to get it to work. I pull the framework-res.apk from my theme with 7zip. Then put in the folder for modding in the manager folder. Then decompile. Edit in the projects folder as per instructions for apk manager. Then when i am done i recompile, sign and put into the theme again with 7zip. I get an error everytime with recompiling it, but it lets me continue to the end anyway, so i tried it out and it made my phone bootloop on install. So i had to sbf and start over. I get the same errors everytime, has to do with the .9 patch files i think. Too many errors to list in other words.
Read the log file. All the pngs with problems that have issues are listed at the beginning. Also, if there are extra pngs that are not used by the framework then remove them.
Tip. Open the log.txt clear it and save. When done and you get it to compile, don't sign it (its a system apk and does not require it. Then after it is successfully compiled. Unzip it, delete the meta folder and android.manifest file.
Copy the meta folder and android.maifest from the original apk and drop them into the newly compiled apk, and then tada...
Working framework.
FYI: The pngs with issues, just decompile the original framework and use those same pngs to correct your .9.pngs. (.9.pngs use the border for formatting, so duplicate the border in the ones you goofed up).
Sent from my DROIDX using XDA App

[GUIDE]Deodex An Application

Hey Guys,
This is a small tutorial for those who want to Deodex a Single Application manually.
Deodex And Odex:
The APKs or JARs of Android contain certain .odex files whose supposed function is to save space. These ‘odex’ files are actually collections of parts of an application that are optimized before booting. Doing so speeds up the boot process, as it preloads part of an application. On the other hand, it also makes hacking those applications difficult because a part of the coding has already been extracted to another location before execution.It will make your faster theoretically even though it would be too small to notice.When deodexing the .odex file is changed to classes.dex file. Deodexing also allows us to theme and install mods.Many of the Stock Roms and CyanogenMod 7 roms are now odexed and to theme them or to add mods we need to have it deodexed. So lets learn how!!
Deodexing:
Preparation:
Hope you have Java Development Kit installed on your computer to run the scripts.Get it from: here.Select you OS from the list and download the suitable package.(We would need the full thing and not the Demo versions.)
Download the Attached .zip File
Extract its Contents to a Folder.(Extracting to a New Folder in the Desktop is Preferred for Ease)
We will name this Folder with the Extracted Contents as Deodex(or any name that you like)
Procedure And Explanations:
First of all copy the Application file that you need to Deodex.A Android Application file is the .apk file found in the system/app directory.Copy the .apk file and the .odex file of the application that you want to Deodex and paste in the Deodex folder(Folder to which the attachment's contents was extracted)
Now go to your system/framework directory and you can see a lot of .jar and .odex files in this folder and copy all its contents to the folder to which the attachment's contents was extracted.
Before doing anything more backup your rom and the application file(If anything goes wrong you can use it then)
To Deodex a application you need to specify its "BOOTCLASSPATH" files. BOOTCLASSPATH are files that contain the classes for an application or in simple language BOOTCLASSPATH files are those files that are required by a android application to run properly. They are actually those files that we have copied from the system/framework directory to our Deodex folder. There are mainly 5 BOOTCLASSPATH files for every android rom.They are: android.policy.jar , core.jar , bouncycastle.jar , ext.jar , framework.jar
All apps are dependent on these files but some apps are dependent on some other BOOTCLASSPATH files.So sometimes the problem is that we actually dont know to which of these files is a particular app dependent to.So we will have to specify all the BOOTCLASSPATH files or the .jar files in the system/framework directory.So problem solved!! Now enough with the theory class,lets proceed to the practical classes!!!!!
Open Command Prompt.
As an example we will Deodex Settings.apk
Type in this command in Command Prompt:
Code:
java -Xmx1024m -jar baksmali.jar -c :am.jar:android.policy.jar:android.test.runner.jar:bmgr.jar:bouncycastle.jar:
com.android.location.provider.jar:com.google.android.maps.jar:sonyericsson.suquashi.jar:
core.jar:corej-unit.jar:ext.jar:framework.jar:ime.jar:input.jar:java.awt.jar:javax.obex.jar:monkey.jar:pm.jar:
:services.jar:sqlite-jdbc.jar:svc.jar -x Settings.odex
Here:
-Xmx says the heap memory needed.In the above command it is given to 1024m. Sometimes deodexing may have errors due to the low heap memory.So set it to 1024m itself.
-jar baksmali.jar says the program to run baksmali.jar file.
-c says that the following files are the BOOTCLASSPATH files of the application we are deodexing.
-x says the name of the application that we are deodexing.It should end with .odex extension.
Note:
When you specify the .jar files just add all those .jar file names in the system/framework folder(only add the .jar files and not the .odex files).Ensure that you have added the .jar extension at the end of each file. Separate the .jar files with colon " : " symbol.
If you have made no spelling errors and have done everything mentioned you will get a folder named "out".
Now we have to smali the out folder into classes.dex file.
So again type in the Command Prompt:
Code:
java -Xmx1024m -jar smali.jar out -o classes.dex
Here:
-o says what the output file should me named to.Dont rename the classes.dex file into anything else.
Now you will have a file in our Deodex folder(Folder to which the attachment's contents was extracted) called "classes.dex".
Finalizing:
Now open the application's .apk file(which you were trying to deodex) with WinRar.
Move the classes.dex file that you got to this .apk file.(Just drag and drop it to the .apk file opened with WinRar.)
Now you will have a deodexed .apk file.
Note: After deodexing you will have to delete the .odex file of the particular application which you had deodexed.
I will make a guide to Odex back a Deodexed application soon!
Hope this guide helps you....
For any doubts or questions please post it here in this forum and I will try to attend to it.........
Re: Deodex A Single Application
Thanks bro..
Good tut..
sent from my phone using hands and brain...
thanks
Re: Deodex A Single Application
Good tut...
But quite long
Sent from my W8 using xda app-developers app
hey...nice tutorial and nice explanation :good:
thanks
Re: Deodex A Single Application
But helpful too...
sent from my phone using hands and brain...
Gogeta said:
Good tut...
But quite long
Sent from my W8 using xda app-developers app
Click to expand...
Click to collapse
I made it long so that everyone understands.Even those who are very new to android
i'm stucked when i try to deodex settings.odex..
any suggestions???
Hidzrie said:
i'm stucked when i try to deodex settings.odex..
any suggestions???
Click to expand...
Click to collapse
you must deodex
settings.apk + settings.odex.....
i've already follow exactly like the tutorial above but cmd just stucked...
in 'out' folder there are \com\android\settings\ folder and these files were in it and nothing more:
AccessibilitySettings$1.smali
AccessibilitySettings$2.smali
AccessibilitySettings$3.smali
AccessibilitySettings$4.smali
AccessibilitySettings$5.smali
AccessibilitySettings$6.smali
AccessibilitySettings.smali
please anyone help..
Credit/thanks: http://forum.xda-developers.com/showthread.php?t=1208320 ?
Hidzrie said:
i've already follow exactly like the tutorial above but cmd just stucked...
in 'out' folder there are \com\android\settings\ folder and these files were in it and nothing more:
AccessibilitySettings$1.smali
AccessibilitySettings$2.smali
AccessibilitySettings$3.smali
AccessibilitySettings$4.smali
AccessibilitySettings$5.smali
AccessibilitySettings$6.smali
AccessibilitySettings.smali
please anyone help..
Click to expand...
Click to collapse
follow the highlighted lines and try again and deodexing takes time according to your computer's ram.so be patient.if you still cant do it then just upload the system=>framework folder and the app you want to deodex and its odex file and Private Message me the links. I will check whats the problem.
L_S said:
Credit/thanks: http://forum.xda-developers.com/showthread.php?t=1208320 ?
Click to expand...
Click to collapse
this can be found in the android sources site but it not so easy to understand for beginners so i made it a little easier to understand and i didnt refer that guide because all is clearly written in the android sources site.
i understood why some of you are making mistakes when trying to deodex a apk or jar file.
its because you are copying exactly the same bootclasspath files that i specified in the guide.
it varies depending on your device and your rom. So I have made some changes in my guide.some lines are highlighted in red.
follow those lines.
Hidzrie said:
i'm stucked when i try to deodex settings.odex..
any suggestions???
Click to expand...
Click to collapse
Specify your device and rom that you use. Are you sure that you followed what i told itself? Try it once more as I have made some more changes in the guide to help you guys.
Still if you cant do it then just copy your framework folder and the apk and .odex file that you want to deodex and pm me. I will try to deodex it.
fotak-x said:
you must deodex
settings.apk + settings.odex.....
Click to expand...
Click to collapse
no fotak we dont need to deodex settings.apk. We only need to deodex the .odex file but we will have to keep the apk file also in the same folder.
Leon1234 said:
Specify your device and rom that you use. Are you sure that you followed what i told itself? Try it once more as I have made some more changes in the guide to help you guys.
Still if you cant do it then just copy your framework folder and the apk and .odex file that you want to deodex and pm me. I will try to deodex it.
Click to expand...
Click to collapse
I'm using samsung gt-s5830i.. Rom simplicity v4..
I've tried like many times..still wont work..
Hidzrie said:
I'm using samsung gt-s5830i.. Rom simplicity v4..
I've tried like many times..still wont work..
Click to expand...
Click to collapse
dont worry,we can figure it our!
what error are you getting in command prompt?
can you give the lines that come up in command prompt?
Leon1234 said:
dont worry,we can figure it our!
what error are you getting in command prompt?
can you give the lines that come up in command prompt?
Click to expand...
Click to collapse
There are no error appear on cmd..
After I insert a command to deodex settings.odex and press enter, it just like nothing happen...
There are no error appear on cmd..
After I insert a command to deodex settings.odex and press enter, it just like nothing happen...
Click to expand...
Click to collapse
you will have to wait for some time when deodexing depending on the ram of your device.
what is the ram of your computer?
and do you have java 7?

[Q]decompile settings.apk [SOLVED}

Hello,
Yesterday night I was trying to decompile Settings.apk with apktool...
Bt it was being unsuccessful on every try...
Showing errors, see attachments.
plz guide..
LINK: http://d-h.st/mk9
Try with another apk decompiling tools.
aniket.lamba said:
Try with another apk decompiling tools.
Click to expand...
Click to collapse
tried with apkmanager... not wrking..
EDIT: Can I give u the apk to decompile.. as im noob in these things
Did you import "framework-res.apk" and "twframework-res.apk"?
If yes then are you using the same framework from the same rom of the "settings.apk" or your using settings.apk of other rom?
Sent from my GT-S5360 using Tapatalk 2
just load it up,together with your framework-res.apk and twframework-res.apk,so we can help i hope.
-CALIBAN666- said:
just load it up,together with your framework-res.apk and twframework-res.apk,so we can help i hope.
Click to expand...
Click to collapse
WTF, giving error while uploading zip.. :/
your first screenshot shows that you have not placed framework-res.apk in the location your command prompt is at
in other words you did not place framework-res.apk in the location c:\new folder
just as a tip - when working with dos prompt - never put a space in folder or file names - it doesnt like it
marcussmith2626 said:
your first screenshot shows that you have not placed framework-res.apk in the location your command prompt is at
in other words you did not place framework-res.apk in the location c:\new folder
just as a tip - when working with dos prompt - never put a space in folder or file names - it doesnt like it
Click to expand...
Click to collapse
No, Ive placed two folders named 'apktool' and 'new folder'...
'apktool ' includes apkmultitool and new folder includes PY-APKTOOL, I found that here http:// http://forum.xda-developers.com/showpost.php?p=39697820&postcount=4 respectively.
Ive used apkmultitool as:
I renamed framework-res.apk as apktool if framework-res.apk and tried to decompile it. Bit i ve faced an error.
I could not install framework-res.apk in my computer..
Framework-res.apk:
I followed guide to decompile framework-res.apk from here [URL=" http://caliban666isaddicted.blogspot.in/2013/06/guide-for-change-platlogoeasytextmaybe.html?m=1" ] http://caliban666isaddicted.blogspot.in/2013/06/guide-for-change-platlogoeasytextmaybe.html?m=1 [/URL]
And done my modifications in framework-res.apk and installed it successfully.
While I was trying to decompile settings.apk, the errors were occuring..
crazysuraj said:
No, Ive placed two folders named 'apktool' and 'new folder'...
'apktool ' includes apkmultitool and new folder includes PY-APKTOOL, I found that here http:// http://forum.xda-developers.com/showpost.php?p=39697820&postcount=4 respectively.
Ive used apkmultitool as:
I renamed framework-res.apk as apktool if framework-res.apk and tried to decompile it. Bit i ve faced an error.
I could not install framework-res.apk in my computer..
Framework-res.apk:
I followed guide to decompile framework-res.apk from here [URL=" http://caliban666isaddicted.blogspot.in/2013/06/guide-for-change-platlogoeasytextmaybe.html?m=1" ] http://caliban666isaddicted.blogspot.in/2013/06/guide-for-change-platlogoeasytextmaybe.html?m=1 [/URL]
And done my modifications in framework-res.apk and installed it successfully.
While I was trying to decompile settings.apk, the errors were occuring..
Click to expand...
Click to collapse
I dont understand what you are doing with importing the framework
just do this
create a folder called apktool in the root of c: - in other words create a folder apktool so its location is c:\apktool
place framework-res.apk from the rom zip along with the apk you wish to decompile - in this case settings.apk in the folder apktool you have just created
open a command prompt as admin
type the following
cd c:\apktool
apktool if framework-res.apk
apktool d settings.apk settingsdecompiled
-CALIBAN666- said:
just load it up,together with your framework-res.apk and twframework-res.apk,so we can help i hope.
Click to expand...
Click to collapse
Ive uploaded apks
Google Drive :LINKS REMOVED
UPDATED LINK: http://d-h.st/mk9
Thank You!
crazysuraj said:
Ive uploaded apks
Google Drive :LINKS REMOVED
UPDATED LINK: http://d-h.st/mk9
Thank You!
Click to expand...
Click to collapse
no problems with decompiling that apk
Its user error - make sure you are using apktool correctly - there is no point in uploading any decompiled files because you will not be able to recompile it if you dont learn how to use it including trying anything else in the future
here is a screen shot with all my commands
make sure you put framework-res.apk and twframework-res.apk and settings.apk in the folder to which your command prompt is at - in my case its c:\apktool
marcussmith2626 said:
no problems with decompiling that apk
Its user error - make sure you are using apktool correctly - there is no point in uploading any decompiled files because you will not be able to recompile it if you dont learn how to use it including trying anything else in the future
here is a screen shot with all my commands
make sure you put framework-res.apk and twframework-res.apk and settings.apk in the folder to which your command prompt is at - in my case its c:\apktool
Click to expand...
Click to collapse
Yes Sir,
Here, its my fault and I should have knowledge if I love modding
I have to learn more things about how to use apktool : rolleyes:
Thank You...!
regards.
marcussmith2626 said:
no problems with decompiling that apk
Its user error - make sure you are using apktool correctly - there is no point in uploading any decompiled files because you will not be able to recompile it if you dont learn how to use it including trying anything else in the future
here is a screen shot with all my commands
make sure you put framework-res.apk and twframework-res.apk and settings.apk in the folder to which your command prompt is at - in my case its c:\apktool
Click to expand...
Click to collapse
What is this ??
crazysuraj said:
What is this ??
Click to expand...
Click to collapse
it means you havent installed apktool correctly and/or not got java jdk installed as well
Java development tools (JDK)
http://www.oracle.com/technetwork/ja...ads/index.html
Apktool
http://code.google.com/p/android-apktool/downloads/list
Place both apktool files in C:\Windows\
see my thread here for a full picture guide to using apktool
http://forum.xda-developers.com/showthread.php?t=2206938
also why have you renamed your apks to apktool if framework-res and so on in your screenshot thats a big no - do not rename your apk files
they should just be called framework-res.apk settings.apk and twframework.apk
you have renamed them to commands you type into a command prompt and I dont understand why you have done that!
you type in the command prompt apktool if framework-res.apk - you do not rename any files
marcussmith2626 said:
it means you havent installed apktool correctly and/or not got java jdk installed as well
Java development tools (JDK)
http://www.oracle.com/technetwork/ja...ads/index.html
Apktool
http://code.google.com/p/android-apktool/downloads/list
Place both apktool files in C:\Windows\
see my thread here for a full picture guide to using apktool
http://forum.xda-developers.com/showthread.php?t=2206938
also why have you renamed your apks to apktool if framework-res and so on in your screenshot thats a big no - do not rename your apk files
they should just be called framework-res.apk settings.apk and twframework.apk
you have renamed them to commands you type into a command prompt and I dont understand why you have done that!
you type in the command prompt apktool if framework-res.apk - you do not rename any files
Click to expand...
Click to collapse
OMG!
crazysuraj said:
OMG!
Click to expand...
Click to collapse
well done you have decompiled settings.apk to a folder called settings
make sure you use notepad++ to edit any xml files (different from windows notepad)
http://notepad-plus-plus.org/download/v6.6.3.html
to recompile just type
apktool b settings newsettings.apk
and it will recompile the folder to an apk called newsettings.apk (assuming no errors have been made in modding files)
you can then rename this apk back to settings.apk and sign it if required (if you have edited the androidmanifest you need to sign the apk) - you can use zipsigner from the playstore to sign apks if you need to - use a testkey for non system apps and a platform key for system apps

Can't modify systemUI.apk on SM-G900F Lollipop 5.0

I been having serious problems trying to replace a few statusbar images from my recently rooted Samsung Galaxy S5 SM-G900F International Version. Rooting is already done (with CF Auto root). Evertyhing is ok and functional.
The problem is that I want to replace some signal images (only two PNG files) and I've tried 2 times and I always end up with black screen and statusbar gone. The only thing that fix it is restoring original systemUI.apk.
This is what I've done so far:
Copy the systemUI.apk to computer.
Extract it with WinRAR
Replace all the images
Create new systemUI.apk from WinRAR with no compression.
Put systemUI.apk back to original location /system/priv-apps/systemUI folder.
Reboot
But always I get black background and no statusbar e.g. systemUI is GONE.
I've noticed that now apps are no longer individual, they are stored in folders and, for example systemUI, it shows:
Ignore the apk4, it's mine I was just testing.
Any idea how to modify it?
See this thread.....
http://forum.xda-developers.com/showthread.php?p=54852717
The OP takes stock SystemUI apks and modifies them to produce '3D' toggles.
If anybody can help, it'll be him.
http://i.imgur.com/rVnFwJM.jpg
keithross39 said:
See this thread.....
http://forum.xda-developers.com/showthread.php?p=54852717
The OP takes stock SystemUI apks and modifies them to produce '3D' toggles.
If anybody can help, it'll be him.
http://i.imgur.com/rVnFwJM.jpg
Click to expand...
Click to collapse
I've read that thread but it seems too old and 4.4 oriented.
I tried also APKTool but nothing, I just break the whole system and need to do factory reset.
Yeah there is a lot of mention of kitkat in that thread, but the OP does help other members with lollipop. It wouldn't hurt to leave a comment in that thread and see where it gets you.....
Sent from my SM-G900F using XDA Labs
keithross39 said:
Yeah there is a lot of mention of kitkat in that thread, but the OP does help other members with lollipop. It wouldn't hurt to leave a comment in that thread and see where it gets you.....
Sent from my SM-G900F using XDA Labs
Click to expand...
Click to collapse
I will do that! Thank you.
One thing.
I was messing around and testing other system APK.
I edited one small APK (VoiceNote.APK) then did a wipe cache from stock factory and now I only enter to "Process system isn't responding" and nothing else. Do you believe a system wipe data/factoryreset would fix this? I replaced the APK with mine and left the original one inside with different name. Could I use ADB to rename it back? Or nothing and reinstall the whole ROM? I'm kinda soft bricked now.
Manimecker said:
I will do that! Thank you.
One thing.
I was messing around and testing other system APK.
I edited one small APK (VoiceNote.APK) then did a wipe cache from stock factory and now I only enter to "Process system isn't responding" and nothing else. Do you believe a system wipe data/factoryreset would fix this? I replaced the APK with mine and left the original one inside with different name. Could I use ADB to rename it back? Or nothing and reinstall the whole ROM? I'm kinda soft bricked now.
Click to expand...
Click to collapse
Update:
I made a factory reset. Up and running. Just fine. But the app I replaced "VoiceNote" is gone. Any ideas how to recover it? I still have original backup on both S5 and computer.
If you can't get into Android, your choices are fairly limited......even more limited if you have stock recovery.......
With those conditions all you can do is
1) cache wipe
2) data wipe/factory reset
3) start again with a firmware flash
but I have a feeling that you need to replace that app with a working version before you get a successful boot.....which means option 3.
Edit...ah Ok, your comment was posted before I finished my reply.....
If you go to my profile and look for threads I've started, you'll see one which deals with system apps and systen-priv apps. Basically I ripped copies of these from my 4.4.2 firmware. I'm not sure if there will be compatibility issues between apks ripped from 4.4.2 when pushed to a 5.0 firmware, but they're available if you want to try it....
If you *do* try it, remember to change permissions and reboot.....
Edit 2.....
If you still have the original, it's a simple case of copying it to it's original location, deleting the modified version and it's associated odex file (in the same folder as the apk) then setting the permissions of the 'freshly copied apk to rw- r-- r-- and rebooting....
Sent from my SM-G900F using XDA Labs
keithross39 said:
If you can't get into Android, your choices are fairly limited......even more limited if you have stock recovery.......
With those conditions all you can do is
1) cache wipe
2) data wipe/factory reset
3) start again with a firmware flash
but I have a feeling that you need to replace that app with a working version before you get a successful boot.....which means option 3.
Edit...ah Ok, your comment was posted before I finished my reply.....
If you go to my profile and look for threads I've started, you'll see one which deals with system apps and systen-priv apps. Basically I ripped copies of these from my 4.4.2 firmware. I'm not sure if there will be compatibility issues between apks ripped from 4.4.2 when pushed to a 5.0 firmware, but they're available if you want to try it....
If you *do* try it, remember to change permissions and reboot.....
Edit 2.....
If you still have the original, it's a simple case of copying it to it's original location, deleting the modified version and it's associated odex file (in the same folder as the apk) then setting the permissions of the 'freshly copied apk to rw- r-- r-- and rebooting....
Sent from my SM-G900F using XDA Labs
Click to expand...
Click to collapse
Basically I did the replacing, same file, permissions and everything, but still have no app. Voice Note is gone. I'll try a factory wipe reset if that works but I don't think so. What can I do now? Android is still running up and good.
Update:
Did factory reset and everything is good and running. App is back. So I guess I'm same as I started. I won't mess up with system files again until I know a good way to edit the SystemUI.apk. Is there any App I can use? Like Xposed or something? I really just want to replace my data connected icons (3G, H+, 4G, LTE).
Is this the sort of thing you mean?......
If it is, then Android Theme Engine module with xposed.......
That is assuming you can get it working on LP.....
Sent from my SM-G900F using XDA Labs
keithross39 said:
Is this the sort of thing you mean?......
If it is, then Android Theme Engine module with xposed.......
That is assuming you can get it working on LP.....
Sent from my SM-G900F using XDA Labs
Click to expand...
Click to collapse
Basically something like that, but I want to replace the PNG with ones I've created. For example you have your 4G icon there, I want to change it with another PNG I created.
Manimecker said:
Basically something like that, but I want to replace the PNG with ones I've created. For example you have your 4G icon there, I want to change it with another PNG I created.
Click to expand...
Click to collapse
Well, that Android Theme Engine module can change the 'theme' of those icons too. Might it be possible to decompile that, insert your images, recompile it and flash.....that way, if it goes wrong, it should be easier to recover than when you changed that system apk.....
Sent from my SM-G900F using XDA Labs
You can just use apktool, just make sure to get your framework-res and then when done open original systemui in 7zip and drag the META-INF folder and drag it to the new systemui apk you made with apktool, works every time for me.
Sent from my Galaxy S5 using XDA Labs
@Rakuu OP says he's already tried using apktool and it didn't work.....
You obviously know more about this than me, so I guess you're gonna have to take over here fella......
http://i.imgur.com/rVnFwJM.jpg
keithross39 said:
@Rakuu OP says he's already tried using apktool and it didn't work.....
You obviously know more about this than me, so I guess you're gonna have to take over here fella......
http://i.imgur.com/rVnFwJM.jpg
Click to expand...
Click to collapse
Sound like he didn't do last part would be my guess.
keithross39 said:
@Rakuu OP says he's already tried using apktool and it didn't work.....
You obviously know more about this than me, so I guess you're gonna have to take over here fella......
http://i.imgur.com/rVnFwJM.jpg
Click to expand...
Click to collapse
where did he said that he used apktool? he used winrar to extract the systemui.
you have to use apktool in order to replace/modify anything within the apk.
i guess you have to read something about decompiling and recompiling (and signing) apps before you can do your changes. just replacing anything inside the .apk's is not the right way my friend
keithross39 said:
@Rakuu OP says he's already tried using apktool and it didn't work.....
You obviously know more about this than me, so I guess you're gonna have to take over here fella......
http://i.imgur.com/rVnFwJM.jpg
Click to expand...
Click to collapse
Yes, I did use APKTool BUT I didn't do all the other steps here mentioned.
Rakuu said:
Sound like he didn't do last part would be my guess.
Click to expand...
Click to collapse
You are right, I didn't do anything about framework-res or META-INF files. I just unpacked, replaced PNG inside and repack.
mcdachpappe said:
where did he said that he used apktool? he used winrar to extract the systemui.
you have to use apktool in order to replace/modify anything within the apk.
i guess you have to read something about decompiling and recompiling (and signing) apps before you can do your changes. just replacing anything inside the .apk's is not the right way my friend
Click to expand...
Click to collapse
I guess I'm starting to learn how things work inside an 5.0 Android Device. Any more ideas (manual, PDF, guide or something) I can follow from here?
Rakuu said:
You can just use apktool, just make sure to get your framework-res and then when done open original systemui in 7zip and drag the META-INF folder and drag it to the new systemui apk you made with apktool, works every time for me.
Sent from my Galaxy S5 using XDA Labs
Click to expand...
Click to collapse
I don't understand what to do with the framework-res apk file, I do however know where to find it but nothing else. I already have APKTool on Windows up and running, but I can't tell what to do next.
Manimecker said:
I don't understand what to do with the framework-res apk file, I do however know where to find it but nothing else. I already have APKTool on Windows up and running, but I can't tell what to do next.
Click to expand...
Click to collapse
Extract the framework-res and twframework-res apks and put them in the folder with the SystemUI.apk
Open a command prompt in the folder and type apktool if framework-res.apk and hit return, then do the same for the twframework-res.apk file, this will generate the resource files needed.
To unpack an apk type apktool d SystemUI..apk for example hit the return key, to repack type apktool b SystemUI (usually the decompiled apk folder doesn't have the .apk after it), this will generate a new apk
Copy the Meta.inf, Android Manifest.xml and resources.arsc files from the original apk to the new apk , make sure the apk is titled exactly the same as the original apk so SystemUI.apk not systemui.apk and the new apk should work.
One thing you can do if you are just changing the png files is extract the png files from the folders direct from the apk to a working folder, create your new png files so they are the same size and exactly the same name as the originals, drag and drop them from the folder directly back into the folder location in the apk then reinstall the apk on the phone, this just replaces the png's, you only really need to decompile the apk if you are making changes to the xml files.
Use 7zip its better for these than winrar (personal opinion), if you want to male changes to the xml files then use Notepad++
Always keep a copy of your original apk's as a backup unless you want to install the firmware again should something go wrong.
EDIT:-
Thought you should have a bit more info about apktool, the red text is the apktool commands you would type in the CMD window from your working folder
Decompiling should look similar to this
C:\Samsung S7\APKs>apktool d SystemUI.apk
I: Using Apktool 2.1.1 on SystemUI.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
C:\Samsung S7\APKs>
When you recompile an APK it will be located in apk folder your compiling from so you decompile the SystemUI.apk which will become a folder called SystemUI when you re-compile the SystemUI folder to make a new apk then the new apk will be located in your SystemUi folder in a folder called dist.
When you recompile an apk it should look similar to this you can see here also a warning message you can ignore these they wont affect how the apk works provided you copy across the original files from the old to the new apk as mentioned below
C:\Samsung S7\APKs>apktool b SystemUI
I: Using Apktool 2.1.1
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
W: warning: string 'tw_screen_pinning_negative' has no default translation.
I: Building apk file...
I: Copying unknown files/dir...
C:\Samsung S7\APKs>
Using 7zip open this apk and open the original apk and simply drag the META.INF, respources.arsc and Android Manifest.xml from the original apk to your new apk close both apk's, put the new apk on your phone.
If you ever make any changes in the decompiled values folder then when you recompile your apk and copy across the above files from the old apk don't replace the resources.arsc file as thats where the values folders are just replace the Android Manifest and META.INF files.
ag4751 said:
Extract the framework-res and twframework-res apks and put them in the folder with the SystemUI.apk
Open a command prompt in the folder and type apktool if framework-res.apk and hit return, then do the same for the twframework-res.apk file, this will generate the resource files needed.
To unpack an apk type apktool d SystemUI..apk for example hit the return key, to repack type apktool b SystemUI (usually the decompiled apk folder doesn't have the .apk after it), this will generate a new apk
Copy the Meta.inf, Android Manifest.xml and resources.arsc files from the original apk to the new apk , make sure the apk is titled exactly the same as the original apk so SystemUI.apk not systemui.apk and the new apk should work.
One thing you can do if you are just changing the png files is extract the png files from the folders direct from the apk to a working folder, create your new png files so they are the same size and exactly the same name as the originals, drag and drop them from the folder directly back into the folder location in the apk then reinstall the apk on the phone, this just replaces the png's, you only really need to decompile the apk if you are making changes to the xml files.
Use 7zip its better for these than winrar (personal opinion), if you want to male changes to the xml files then use Notepad++
Always keep a copy of your original apk's as a backup unless you want to install the firmware again should something go wrong.
EDIT:-
Thought you should have a bit more info about apktool, the red text is the apktool commands you would type in the CMD window from your working folder
Decompiling should look similar to this
C:\Samsung S7\APKs>apktool d SystemUI.apk
I: Using Apktool 2.1.1 on SystemUI.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
C:\Samsung S7\APKs>
When you recompile an APK it will be located in apk folder your compiling from so you decompile the SystemUI.apk which will become a folder called SystemUI when you re-compile the SystemUI folder to make a new apk then the new apk will be located in your SystemUi folder in a folder called dist.
When you recompile an apk it should look similar to this you can see here also a warning message you can ignore these they wont affect how the apk works provided you copy across the original files from the old to the new apk as mentioned below
C:\Samsung S7\APKs>apktool b SystemUI
I: Using Apktool 2.1.1
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
W: warning: string 'tw_screen_pinning_negative' has no default translation.
I: Building apk file...
I: Copying unknown files/dir...
C:\Samsung S7\APKs>
Using 7zip open this apk and open the original apk and simply drag the META.INF, respources.arsc and Android Manifest.xml from the original apk to your new apk close both apk's, put the new apk on your phone.
If you ever make any changes in the decompiled values folder then when you recompile your apk and copy across the above files from the old apk don't replace the resources.arsc file as thats where the values folders are just replace the Android Manifest and META.INF files.
Click to expand...
Click to collapse
I will try that! I'm gonna get back with update.
Just one question. Do I need to odex or deodex my APK? Should I edit the SystemUI.odex.xz and SystemUI.odex.art.xz, both inside the ARM folder?
Manimecker said:
I will try that! I'm gonna get back with update.
Just one question. Do I need to odex or deodex my APK? Should I edit the SystemUI.odex.xz and SystemUI.odex.art.xz, both inside the ARM folder?
Click to expand...
Click to collapse
No clue on that, always used deodexed roms cause messing with odexed stuff is a pain in the rear, if you deodexed your rom this will be about 5x easier.
Sent from my Galaxy S5 using XDA Labs
Manimecker said:
I will try that! I'm gonna get back with update.
Just one question. Do I need to odex or deodex my APK? Should I edit the SystemUI.odex.xz and SystemUI.odex.art.xz, both inside the ARM folder?
Click to expand...
Click to collapse
As @Rakuu says themeing with deodexed roms is preferred by most people although I never themed with deodexed roms myself, when I used to theme stock roms I just removed the apk made the changes to the png and xml files and replaced the apk, never changed anything with the odex.apk just the apk itself, as you want to do the systemui then just pull that from the rom make a copy of the apk, make the changes in your copy and push that back to the phone., keep an original unchanged version of the apk as a backup.
Do you have a custom recovery like TWRP on your phone and Android SDK installed on your computer as it makes pulling and pushing the apk's much safer than what you appear to be doing as it looks like your just doing copy and paste, although it works its not the ideal or safest way to do it.
The apk should be in the system/priv-app/SystemUI folder

Categories

Resources