settings.apk help - Android Q&A, Help & Troubleshooting

hello i tried modding my settings.apk using this guide to add rom name and devloper name
http://forum.xda-developers.com/showthread.php?t=2341389
my device is xperia c
i edited the strings.xml and device info settings.xml to modify
then i tried to compile got a xml parsing error
then copied the resources.arsc to decompiled folder
then tried compiling and app compiled but did not install in phone
then i copied the meta inf and androidmanifest.xml to decompile folder and compiled again
app succesfully installed to system but o opening it says "unfortunately settings has stopped"
what am i doing wrong??
i also set correct permission..
I HAVE ALREADY INSTALLED FRAMEWORK
@marcussmith2626
@SpaceCaker
@hnkotnis
@serajr
@iSiddharth
@stryder001

You have incorrectly modified the xml hence the error
You don't need to copy any other file into the decompiled folder from the original apk - I have never done that
Just resign the apk with a platform key
Your main problem is incorrect modification of the xml
You should always decompile & recompile the apk without making any changes just to test you have the environment setup correctly - if it recompiles you know it's your changes that are wrong - if it doesn't it's the environment eg wrong framework loaded
Can't help you with making the mod - apktool will tell you which line the error is on

abhishekr700 said:
hello i tried modding my settings.apk using this guide to add rom name and devloper name
Click to expand...
Click to collapse
Visit THIS

iSiddharth said:
I tried the method given in the thread link that you have posted and that worked perfectly for me. This might be helpful to you.
Here I am writing a very detailed guide on what is told there.
Step 1 : Download Advanced APK Tools, 7-Zip, Notepad++
Step 2 : Get your settings.apk and framework-res.apk
Step 3 : Place your settings.apk and framework-res.apk in 2-IN folder of advanced apk tools folder.
Step 4 : open advancel apk tools.exe and select the option to install firmware, select your framework-res.apk here.
Step 5 : After firmware is installed, select the option to deceompile file and decompile the settings.apk
Step 6 : Go to 3-OUT folder and open Setings.apk folder.
Step 7 : Go to res>>xml and open the file "device_info_settings.xml" using Notepad++.
Step 8 : Now go to bottom of the file and add lines like these :
Code:
<Preference android:title="@string/rom_header" android:key="rom_header" android:summary="@string/rom_name" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/author_header" android:key="author_header" android:summary="@string/author_name" style="?android:preferenceInformationStyle" />
Step 9 : Now go to res>>values and open the "strings.xml" file using Notepad++
Step 10 : Now go to bottom of the file and add lines like these :
Code:
<string name="rom_header">Rom Name</string>
<string name="rom_name">nameofyourromhere</string>
<string name="author_header">Developed By</string>
<string name="author_name">yournamehere</string>
Step 11 : Save both the files and get out of all the open folders.
Step 12 : Now in advanced apk toos select the option of recompile files and then recompile the Settings.apk.
Step 13 : Now open 4-OUT folder and there you will see new settings.apk.
Step 14 : Extract this settings.apk using 7-Zip.
Step 15 : Open 3-out>>Settings.apk>>original and copy everything from there.
Step 16 : Open 4-done and paste all the files where you have extracted the settings.apk. Replace the files when asked.
Step 17 : Select all the files and using 7-Zip add all of them in a archive and replace the .zip extension be .apk when making the archive.
Step 18 : Press the thanks button below if I helped you!!
Done! You now have the ROM NAME and DEVELOPED BY in your setting>>about phone.
Click to expand...
Click to collapse
during compile it gives error
0: error: Multiple substitutions specified in non-positional format; did you mea
n to add the formatted="false" attribute?
D:\apk tools\apktool-install-windows-r05-ibot\settings\res\values-bg\strings.xml
:110: error: Unexpected end tag string
brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.Br
utException: could not exec command: [aapt, p, --min-sdk-version, 17, --target-s
dk-version, 17, -F, C:\Users\ABHISHEK\AppData\Local\Temp\APKTOOL6105431854394950
70.tmp, -0, arsc, -I, C:\Users\ABHISHEK\apktool\framework\1.apk, -S, D:\apk tool
s\apktool-install-windows-r05-ibot\settings\res, -M, D:\apk tools\apktool-instal
l-windows-r05-ibot\settings\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)
at brut.androlib.Androlib.buildResources(Androlib.java:283)
at brut.androlib.Androlib.build(Androlib.java:206)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not
exec command: [aapt, p, --min-sdk-version, 17, --target-sdk-version, 17, -F, C:
\Users\ABHISHEK\AppData\Local\Temp\APKTOOL610543185439495070.tmp, -0, arsc, -I,
C:\Users\ABHISHEK\apktool\framework\1.apk, -S, D:\apk tools\apktool-install-wind
ows-r05-ibot\settings\res, -M, D:\apk tools\apktool-install-windows-r05-ibot\set
tings\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:357)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd
k-version, 17, --target-sdk-version, 17, -F, C:\Users\ABHISHEK\AppData\Local\Tem
p\APKTOOL610543185439495070.tmp, -0, arsc, -I, C:\Users\ABHISHEK\apktool\framewo
rk\1.apk, -S, D:\apk tools\apktool-install-windows-r05-ibot\settings\res, -M, D:
\apk tools\apktool-install-windows-r05-ibot\settings\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:355)
... 6 more

abhishekr700 said:
during compile it gives error
Click to expand...
Click to collapse
Did you use Advanced Apk Tools only?
This software is made specially for Xperia Devices...

marcussmith2626 said:
You have incorrectly modified the xml hence the error
You don't need to copy any other file into the decompiled folder from the original apk - I have never done that
Just resign the apk with a platform key
Your main problem is incorrect modification of the xml
You should always decompile & recompile the apk without making any changes just to test you have the environment setup correctly - if it recompiles you know it's your changes that are wrong - if it doesn't it's the environment eg wrong framework loaded
Can't help you with making the mod - apktool will tell you which line the error is on
Click to expand...
Click to collapse
at first i tried without copying anything then on compiling i got error ie parsing error..

abhishekr700 said:
at first i tried without copying anything then on compiling i got error ie parsing error..
Click to expand...
Click to collapse
Then what ever you have modified is incorrect - Most likely the syntax or layout
If Gingerbread use apktool 1.5.2 https://code.google.com/p/android-apktool/downloads/list
If KitKat/lollipop use the new beta apktools
https://bitbucket.org/iBotPeaches/apktool/downloads

marcussmith2626 said:
Then what ever you have modified is incorrect - Most likely the syntax or layout
If Gingerbread use apktool 1.5.2 https://code.google.com/p/android-apktool/downloads/list
If KitKat/lollipop use the new beta apktools
https://bitbucket.org/iBotPeaches/apktool/downloads
Click to expand...
Click to collapse
I have jellybean
And I have given link in first post I did the same way he did
Also I wanna know that whether changes in res/xml and res/values are integrated into resources.arsc or somewhere else

abhishekr700 said:
I have jellybean
And I have given link in first post I did the same way he did
Also I wanna know that whether changes in res/xml and res/values are integrated into resources.arsc or somewhere else
Click to expand...
Click to collapse
Like I said - Iv never copied resources - I just sign with platform key
Can't give you any other help - if you get a compile error it's user error - Most likely incorrect syntax or you have missed something
Apktool will tell you which line the error is on
Can't help you anymore than that

marcussmith2626 said:
Like I said - Iv never copied resources - I just sign with platform key
Can't give you any other help - if you get a compile error it's user error - Most likely incorrect syntax or you have missed something
Apktool will tell you which line the error is on
Can't help you anymore than that
Click to expand...
Click to collapse
At first I tried without copying anything
But I got error while compiling..is that because resources.arsc not there or that file just gets decompiled and the error is not due to that

abhishekr700 said:
At first I tried without copying anything
But I got error while compiling..is that because resources.arsc not there or that file just gets decompiled and the error is not due to that
Click to expand...
Click to collapse
No like I keep saying - nothing to do with resources - I have never copied that
It's because most likely a syntax error - ie what you have typed in the xml is wrong or is missing something or the layout is wrong eg you have opened a layout but not closed it
I can't help you with that - apktool tells you what the error is and on what line of the file
I can't help you write in the mod for you - that's your job to understand what you are doing - what changes you are making & why you are making them - unless youunderstand what you are doing then you will not be able to solve the error apktool is telling you there is

Awww. So sad bro. But I have a solution! You need to root your phone first! I'm sure you backed up the original settings.apk to your sd card right? If is not. I don't know to fix that. Btw, if you backed up, Install Root Explorer. Replace the original settings.apk to Root explorer/System/App. Just paste the settings.apk. Once done, Your phone will automatic reboot. And now your phone is fixed. This is based on my experiences.

marcussmith2626 said:
No like I keep saying - nothing to do with resources - I have never copied that
It's because most likely a syntax error - ie what you have typed in the xml is wrong or is missing something or the layout is wrong eg you have opened a layout but not closed it
I can't help you with that - apktool tells you what the error is and on what line of the file
I can't help you write in the mod for you - that's your job to understand what you are doing - what changes you are making & why you are making them - unless youunderstand what you are doing then you will not be able to solve the error apktool is telling you there is
Click to expand...
Click to collapse
Okk I will try decompile without any changes to any file to check
BTW im using the basic apltoll version not the custom ones which provides a user interface I hope that isnt causing problem
And u said u sign apk with platform keys wont that lead to signature mismatches with other system apps and finally app not being installed??

AkcezzInc said:
Awww. So sad bro. But I have a solution! You need to root your phone first! I'm sure you backed up the original settings.apk to your sd card right? If is not. I don't know to fix that. Btw, if you backed up, Install Root Explorer. Replace the original settings.apk to Root explorer/System/App. Just paste the settings.apk. Once done, Your phone will automatic reboot. And now your phone is fixed. This is based on my experiences.
Click to expand...
Click to collapse
Brother im not a noob
I know the basics we r having a little hifi talk here..btw thanks u tried helping

Related

Statusbar modding tools

I am wondering what many are using to modify the statusbar icons. It seems that the easy way(7Zip png swap) doesnt work anymore. AutoAPKtool is giving me errors and wont recompile the SystemUI.apk. apk multi tool wont decompile the apk completely. Any program or cmd way of swapping the icons would be great.
Here is the error im getting in AutoAPKTool when recompiling:
[*] C:\AutoAPKTool2.0.4\_INPUT_APK\SystemUI
recompiling C:\AutoAPKTool2.0.4\_INPUT_APK\SystemUI...
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
The system cannot find the drive specified.
Any help would be great!
If you are just changing icons then you can just open up the .apk as a .zip then drop in the corresponding icons that you want to use, and using the correct name. Bear in mind that GB icons are 39x39, and ICS uses 50x50. The icons are located in the /res/drawable-xhdpi folder in the .apk .
The only tools I use is GIMP for resizing/modding the .png, and WinRAR.
Thanks I did resize all the png's I plan to change. I tried opening up the apk but when I drag the png into the extracted folder 7Zip says "not implemented". I have made modded statusbars before but for some reason it wont work for me on ICS.

[Q]How to change clock color from status bar JB 4.1.2

Hi guys i want to know is anyone who can help me to change color of clock,i really don't like,i changed the color for signal,wireless and battery but with clock i have no ideea were to go to change,thanks in advance,i put the systemUI.apk if anyone like this.
mariox26 said:
Hi guys i want to know is anyone who can help me to change color of clock,i really don't like,i changed the color for signal,wireless and battery but with clock i have no ideea were to go to change,thanks in advance,i put the systemUI.apk if anyone like this.
Click to expand...
Click to collapse
Inside "ROM Control" or "AOKP Settings", go to clock and change the color as you want.
mariox26 said:
Hi guys i want to know is anyone who can help me to change color of clock,i really don't like,i changed the color for signal,wireless and battery but with clock i have no ideea were to go to change,thanks in advance,i put the systemUI.apk if anyone like this.
Click to expand...
Click to collapse
just PM this guy's @ vegeta1 or @kroz46 they will do the needfull for u
delawalla said:
Inside "ROM Control" or "AOKP Settings", go to clock and change the color as you want.
Click to expand...
Click to collapse
he is on stock firmware where that option is not available if i am right
I have 4.1.2 stock XXLSJ and no option for what you said
i have no s2 if you can decompile the systemUI and send me then i can surely help mate
vegeta1 said:
i have no s2 if you can decompile the systemUI and send me then i can surely help mate
Click to expand...
Click to collapse
here:https://www.box.com/shared/37ofclatfjpyc2xgpzlb thanks a lot
mariox26 said:
here:https://www.box.com/shared/37ofclatfjpyc2xgpzlb thanks a lot
Click to expand...
Click to collapse
mate recompile this and lemme know if this works
SystemUI_decompiled_changed
vegeta1 said:
mate recompile this and lemme know if this works
SystemUI_decompiled_changed
Click to expand...
Click to collapse
what i do wrong,i recompiled the .apk i signed the apk,copy to phone restart and after i get fc UI,when i recompiled i get error for translation ....can be this the problem?
here is how it's done
1) decompile the systemUI.apk
2) open "\res\layout\status_bar.xml"
3) search for "com.android.systemui.statusbar.policy.Clock"
4) at the end of the line you add " android:textColor="#ff33b5e5" "
5) compile it, but don't sign it
6) put it in /preload/symlink/system/app
7) restart phone
8) done
karotti said:
here is how it's done
1) decompile the systemUI.apk
2) open "\res\layout\status_bar.xml"
3) search for "com.android.systemui.statusbar.policy.Clock"
4) at the end of the line you add " android:textColor="#ff33b5e5" "
5) compile it, but don't sign it
6) put it in /preload/symlink/system/app
7) restart phone
8) done
Click to expand...
Click to collapse
nice guide,thanks but i have a problem when i try to compile,is give me allways this error:
Recompiling SystemUI.apk folder...
W: Could not find sources
I: Building resources...
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/drawable-sw360dp-hdpi
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/drawable-sw600dp
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/drawable-sw600dp-hdpi
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/drawable-sw720dp-hdpi
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/layout-sw600dp
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/layout-sw720dp
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/layout-sw800dp
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/values-sw320dp
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/values-sw360dp
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/values-sw600dp
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/values-sw600dp-land
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/values-sw600dp-port
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/values-sw720dp
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/values-sw720dp-port
invalid resource directory name: C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res/values-sw800dp
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\mariox26\AppData\Local\Temp\APKTOOL1873502715595648032.tmp, -I, C:\Users\mariox26\apktool\framework\1.apk, -S, C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res, -M, C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\mariox26\AppData\Local\Temp\APKTOOL1873502715595648032.tmp, -I, C:\Users\mariox26\apktool\framework\1.apk, -S, C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\res, -M, C:\Users\mariox26\Desktop\xdaAutoTool\_INPUT_APK\SystemUI\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
Done!
really i search a lot for this problem with no result.
try decompiling with dependencies firt so framework-res is installed.
then compile again. this should work
the needed images have to be in drawable-hdpi before compiling.
here is the systemui.apk with the mod.
karotti said:
try decompiling with dependencies firt so framework-res is installed.
then compile again. this should work
the needed images have to be in drawable-hdpi before compiling.
here is the systemui.apk with the mod.
Click to expand...
Click to collapse
I used this systemui only cange i see it is for battery
another percentage
vegeta1 said:
mate recompile this and lemme know if this works
SystemUI_decompiled_changed
Click to expand...
Click to collapse
I compiled but no result, clock color is same grey.i tried to change color in layout/color.xml and no effect, i change color in status.bar.xml no effect, i tried to change in value folder and is always same color is don't want to change
Sent from my GT-I9100 using xda app-developers app
I can say the same here. Tried all the same locations were I see that the Clock color might be set, then change the value and recompile, transfer contents from recompiled into the SystemUI.apk using archive manager and load it up through recovery. I just cannot find how it is done. I have ask this questions to devs that have different then stock AOSP color and no reply yet. Hope one of them will guide and I will be glad to pass that info along. I am trying this on my Tablet, but the source is just about the same when it comes down to it.
mariox26 said:
I used this systemui only cange i see it is for battery
another percentage
I compiled but no result, clock color is same grey.i tried to change color in layout/color.xml and no effect, i change color in status.bar.xml no effect, i tried to change in value folder and is always same color is don't want to change
Sent from my GT-I9100 using xda app-developers app
Click to expand...
Click to collapse
Alright bro I stay true to my word and figured out my issue with my ROM which is a AOSP 4.1.2 build as with yours. I was able to change the color of the clock on the Status Bar as well and some others that use the same color hex as the clock. They are within the framework-res.apk and not the SystemUI.apk like other ROMS are. 4.1.2 is a bit different when it comes to these changes. After setting up apktool with framework-res.apk go ahead and Decompile it and guide your way to this path, framework-res/res/value/color. You will see a nice list there with hex colors settings. The ones you need to change are (<color name="holo_blue_light">#ff33b5e5</color>) and (<color name="holo_blue_dark">#ff0099cc</color>). The hex color settings on these examples are for the stock blue that everyone is custom too, but can be changed to any color you wish. After change is complete using texted editor save changes and make sure that you can see hidden files. Some text editor tools will create a backup on the Hidden files and you need to delete that backup before compiling the apk back. To recompile I went ahead and used this command to just compile it back (apktool b framework-res AlmostDone.apk). When complete all you need to do is Open up current framework.res.apk in archive as well as AlmostDone.apk, don't extract either one. Drag and drop the resources.arsc file from AlmostDone.apk over to framework.res.apk. Then load up your framework.res.apk back to your phone using recovery or what ever means you like to use and your all done.
nobe1976 said:
Alright bro I stay true to my word and figured out my issue with my ROM which is a AOSP 4.1.2 build as with yours. I was able to change the color of the clock on the Status Bar as well and some others that use the same color hex as the clock. They are within the framework-res.apk and not the SystemUI.apk like other ROMS are. 4.1.2 is a bit different when it comes to these changes. After setting up apktool with framework-res.apk go ahead and Decompile it and guide your way to this path, framework-res/res/value/color. You will see a nice list there with hex colors settings. The ones you need to change are (<color name="holo_blue_light">#ff33b5e5</color>) and (<color name="holo_blue_dark">#ff0099cc</color>). The hex color settings on these examples are for the stock blue that everyone is custom too, but can be changed to any color you wish. After change is complete using texted editor save changes and make sure that you can see hidden files. Some text editor tools will create a backup on the Hidden files and you need to delete that backup before compiling the apk back. To recompile I went ahead and used this command to just compile it back (apktool b framework-res AlmostDone.apk). When complete all you need to do is Open up current framework.res.apk in archive as well as AlmostDone.apk, don't extract either one. Drag and drop the resources.arsc file from AlmostDone.apk over to framework.res.apk. Then load up your framework.res.apk back to your phone using recovery or what ever means you like to use and your all done.
Click to expand...
Click to collapse
Sorry bro but i don't understead.If this is the stock blue color: (<color name="holo_blue_light">#ff33b5e5</color>) and (<color name="holo_blue_dark">#ff0099cc</color>),why my clock on status bar is still grey?and i look to the file you did and has this setting color,this is the color i am looking.I tried another thing to change in framework this line <color name="darker_gray">#ffaaaaaa</color> to <color name="darker_gray">#ff33b5e5</color> and same color to clock
the file framework.apk need to be signed after i make change?
No after you make your adjustments just recompile as instructed and open both apk files in archive. Then drag and drop the resources.arsc file over only unless you changed any of the files in the res folder then you can drag and drop that into the archived framework-res.apk. The original signature will be fine.
Sent from the Darkside Via ME.
Already make this and not working.The same grey color.The color.xml has the default color blue how you said,so i make no change to this xml.because this is color i like,and why is not changing?
http://forum.xda-developers.com/showthread.php?p=37448994#post37448994
Here

Advanced APKTool Recompiling Error

Really awesome APKTool by BD Freak called Advanced APKTool v3.0.0
Problem Recompiling:
From LOG--
"brut common BrutException could not exec command" followed by a bunch of stuff about at brut.androlib.Androlib issues.
Background:
-I pointed JAVA HOME to JDK files (in the bin folder)
-Updated path to all versions of Java (in the bin folder)
-Followed all instructions to a tea, to include installing frameworks files
Has anyone had any issues like this when recompiling?

How do I edit the SDK number of an APK file?

A game I really liked only worked on old phones, not on "new" ones (from 2014). I made a thread asking how to make them work and they said to edit the apk's SDK number.
Hyoretsu said:
A game I really liked only worked on old phones, not on "new" ones (from 2014). I made a thread asking how to make them work and they said to edit the apk's SDK number.
Click to expand...
Click to collapse
Hi...
In order to do this, u need to decompile the app with apktool, then edit the line "min sdk version" in Android Manifest file with notepad++ and just recompile the apk.
Note: If the line is not found in Android Manifest file, it would be in apktool.yml file of same directory.
Check this tool to easily decompile and recompile APK file.
Sent from my ONE A2005 using Tapatalk
Brandon Indar said:
Hi...
In order to do this, u need to decompile the app with apktool, then edit the line "min sdk version" in Android Manifest file with notepad++ and just recompile the apk.
Note: If the line is not found in Android Manifest file, it would be in apktool.yml file of same directory.
Check this tool to easily decompile and recompile APK file.
Sent from my ONE A2005 using Tapatalk
Click to expand...
Click to collapse
Somehow it's missing a classes.dex, so apktool gives
Code:
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: java.util.zip.ZipException: error in opening zip file
when trying to decompile it and http://www.javadecompilers.com gives
"Job Outputcode: -1
Job Output:
File not found: com.vpet_source_from_JADX/classes.dexcom.vpet_source_from_JADX/classes.dex"
Hyoretsu said:
Somehow it's missing a classes.dex, so apktool gives
Code:
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: java.util.zip.ZipException: error in opening zip file
when trying to decompile it and http://www.javadecompilers.com gives
"Job Outputcode: -1
Job Output:
File not found: com.vpet_source_from_JADX/classes.dexcom.vpet_source_from_JADX/classes.dex"
Click to expand...
Click to collapse
Can u send me the APK file.
I will check it out.
There must be a classes.dex file in the APK.
Sent from my ONE A2005 using Tapatalk
Brandon Indar said:
Can u send me the APK file.
I will check it out.
There must be a classes.dex file in the APK.
Sent from my ONE A2005 using Tapatalk
Click to expand...
Click to collapse
This is the one I'm using: https://www.apk20.com/apk/4553/
Hey, did you solve your problem?

[GUIDE] Modifying apk/jar files on the Axon 7

So I decided to write up a little guide on how to modify apk and jar files on the Axon 7 for those of you who do not know how and would like to make some modifications such as the ones in my guides.
Prerequisites
A Windows/Linux/Mac computer
A rooted device with TWRP Recovery
USB cable
ADB installed and USB debugging enabled
Java JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html
APKTool: https://ibotpeaches.github.io/Apktool/install/ (Follow all the instructions)
Baksmali: https://bitbucket.org/JesusFreke/smali/downloads/baksmali-2.2.0.jar
7-Zip or another archive manager
1. Install the frameworks to your computer
Open a command window in your working directory and connect your device to your computer with the USB-C cable.
Pull the framework files with
Code:
adb pull /system/framework/framework-res.apk
adb pull /system/framework/framework-zte-res.apk
Install them
Code:
apktool if framework-res.apk
apktool if framework-zte-res.apk
Depending on which ROM you are on you may need to install other frameworks. The above is for the stock ROM.
2. Decompile the apk/jar file.
Pull the apk/jar you want to decompile with
Code:
adb pull path_to_apk_or_jar
Here are paths for some commonly modified apk/jars:
SystemUI: /system/priv-app/SystemUI_ZTE/SystemUI_ZTE.apk
Settings: /system/priv-app/Settings_ZTE/Settings_ZTE.apk
services.jar: /system/framework/services.jar
Decompile the apk with
Code:
apktool d <apk/jar>
If you did everything correctly, a folder should now exist with the name of your apk/jar.
3. Decompile the .odex file
You can skip this step if your apk/jar does not have an .odex associated with it or you only need to modify res and not smali.
Pull the odex file
Code:
adb pull path_to_odex
For example if you want to pull the odex file for SystemUI you would do
Code:
adb pull /system/priv-app/SystemUI_ZTE/oat/arm64/SystemUI_ZTE.odex
Create a folder called "smali" in the directory of your decompiled apk/jar. Then go back to your working directory.
Pull all boot oat files from your device with
Code:
adb pull /system/framework/arm64
Move all the oat files inside the arm64 folder on your PC to your working directory.
Using baksmali, decompile the odex file to smali
Code:
java -jar baksmali.jar deodex -a <api> filename.odex
where api is 23 for Android 6.0, 24 for Android 7.0, and 25 for Android 7.1
A new folder should now be created called "out". Cut and paste the files and folders inside this folder into the "smali" folder you created earlier.
4. Make your modifications.
5. Recompile the apk/jar
From the working directory (not the directory of the decompiled apk/jar) Recompile the apk/jar with
Code:
apktool b name_of_folder
where name_of_folder is the name of the directory of the decompiled apk/jar.
The complied apk/jar should now exist in the "dist" folder in the directory of the decompiled apk/jar.
6. Sign the apk.
Using 7-zip or another archive manager, copy the res folder, resources.arsc file, and the classes.dex file (if you modified smali in steps 3 and 4) from the NEW apk to the ORIGINAL apk.
7. Replace the apk/jar on your device.
Reboot your device into TWRP recovery with
Code:
adb reboot recovery
For user apps: Make sure data is mounted in TWRP's mount menu. If you have encryption turned on you must enter your password otherwise data will not be mounted!
For system apps and framework files: Make sure system is mounted in TWRP's mount menu. Uncheck "Mount system read-only" if it is checked.
Push the ORIGINAL apk/jar to the correct directory on your device
Code:
adb push <apk/jar> path_to_apk_or_jar
Set correct permissions on the apk/jar
Code:
adb shell chmod 0644 path_to_apk_or_jar
If you did step 3, use TWRP's file manager in Advanced<File Manager to navigate to the apk/jar file's directory and delete the existing .oat or .odex file associated with it.
You did it
No go
Hi,
Tried it with the SystemUI_ZTE.apk (and odex) from the 2017G B08 ROM. I ended up with a folder named SystemUI_ZTE. I created a smali folder in that folder and moved the android, com and cn folders (that I got using the "java -jar oat2dex.jar smali SystemUI_ZTE.odex" command) to that smali folder. But when I try the apktool b command I get the following error:
Code:
C:\Users\Blub\ZTE>apktool b SystemUI_ZTE
I: Using Apktool 2.3.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
SystemUI_ZTE\smali\android\support\v17\leanback\app\BackgroundManager.smali[102,4] iput-wide-volatile is an odexed instruction. You cannot reassemble a disassembled odex file unless it has been deodexed.
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: android/support/v17/leanback/app/BackgroundManager.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:75)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:59)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:36)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:412)
at brut.androlib.Androlib.buildSources(Androlib.java:343)
at brut.androlib.Androlib.build(Androlib.java:299)
at brut.androlib.Androlib.build(Androlib.java:270)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:75)
Any idea what I am doing wrong?
TIA,
Cheers,
/Cacti
le_cactus said:
Hi,
Tried it with the SystemUI_ZTE.apk (and odex) from the 2017G B08 ROM. I ended up with a folder named SystemUI_ZTE. I created a smali folder in that folder and moved the android, com and cn folders (that I got using the "java -jar oat2dex.jar smali SystemUI_ZTE.odex" command) to that smali folder. But when I try the apktool b command I get the following error:
Any idea what I am doing wrong?
TIA,
Cheers,
/Cacti
Click to expand...
Click to collapse
I updated the OP with a different tool for the odex file. Try it now.
Hi,
Thanks,but "java -jar baksmali-2.2.0.jar -a 25 -x SystemUI_ZTE.odex -d %CD%" gives me this error
Code:
Exception in thread "main" com.beust.jcommander.MissingCommandException: Expected a command, got -a
at com.beust.jcommander.JCommander.parseValues(JCommander.java:725)
at com.beust.jcommander.JCommander.parse(JCommander.java:304)
at com.beust.jcommander.JCommander.parse(JCommander.java:287)
at org.jf.baksmali.Main.main(Main.java:90)
Cheers,
/Cacti
le_cactus said:
Hi,
Thanks,but "java -jar baksmali-2.2.0.jar -a 25 -x SystemUI_ZTE.odex -d %CD%" gives me this error
Cheers,
/Cacti
Click to expand...
Click to collapse
Try it without any arguments: "java -jar baksmali-2.2.0.jar SystemUI_ZTE.odex"
Hi,
The command "java -jar baksmali.jar deodex -a 25 SystemUI_ZTE.odex"gives me
Code:
Error occurred while loading class path files. Aborting.
org.jf.dexlib2.analysis.ClassPathResolver$ResolveException: Error while loading oat file boot.oat
at org.jf.dexlib2.analysis.ClassPathResolver.loadEntry(ClassPathResolver.java:250)
at org.jf.dexlib2.analysis.ClassPathResolver.loadLocalClassPathEntry(ClassPathResolver.java:179)
at org.jf.dexlib2.analysis.ClassPathResolver.loadLocalOrDeviceBootClassPathEntry(ClassPathResolver.java:191)
at org.jf.dexlib2.analysis.ClassPathResolver.<init>(ClassPathResolver.java:120)
at org.jf.dexlib2.analysis.ClassPathResolver.<init>(ClassPathResolver.java:105)
at org.jf.baksmali.AnalysisArguments.loadClassPathForDexFile(AnalysisArguments.java:129)
at org.jf.baksmali.AnalysisArguments.loadClassPathForDexFile(AnalysisArguments.java:86)
at org.jf.baksmali.DisassembleCommand.getOptions(DisassembleCommand.java:203)
at org.jf.baksmali.DeodexCommand.getOptions(DeodexCommand.java:71)
at org.jf.baksmali.DisassembleCommand.run(DisassembleCommand.java:177)
at org.jf.baksmali.Main.main(Main.java:102)
Caused by: org.jf.dexlib2.analysis.ClassPathResolver$NotFoundException: Cannot find dependency boot-core-libart.oat in null
at org.jf.dexlib2.analysis.ClassPathResolver.loadOatDependencies(ClassPathResolver.java:270)
at org.jf.dexlib2.analysis.ClassPathResolver.loadEntry(ClassPathResolver.java:248)
... 10 more
Cheers,
/Cacti
le_cactus said:
Hi,
The command "java -jar baksmali.jar deodex -a 25 SystemUI_ZTE.odex"gives me
Cheers,
/Cacti
Click to expand...
Click to collapse
pull boot-core-libart.oat from /system/framework/arm64/boot-core-libart.oat and try again
Muchas gracias
Hi,
Had to pull all the .oat files from the /system/framework/arm64/ folder, only then I didn't get an error any more using the command "java -jar baksmali.jar deodex -a 25 SystemUI_ZTE.odex". The "command "java -jar baksmali.jar -a 25 -x SystemUI_ZTE.odex -d %CD%" still gave an error, you might wanna change that in the OP.
Now apktool b SystemUI_ZTE didn't give me any errors anymore. Executed the other steps, and bingo! Everthing seems to work. And byy replacing the charging.ogg, my device charges silently.
Thanks from my wife as she now doesn't wake up when I go to bed (and connect the charger). Many thanks for your patience and your excelent guide! I guess I'll bemodding some more APK's now
Cheers,
/Cacti
le_cactus said:
Hi,
Had to pull all the .oat files from the /system/framework/arm64/ folder, only then I didn't get an error any more using the command "java -jar baksmali.jar deodex -a 25 SystemUI_ZTE.odex". The "command "java -jar baksmali.jar -a 25 -x SystemUI_ZTE.odex -d %CD%" still gave an error, you might wanna change that in the OP.
Now apktool b SystemUI_ZTE didn't give me any errors anymore. Executed the other steps, and bingo! Everthing seems to work. And byy replacing the charging.ogg, my device charges silently.
Thanks from my wife as she now doesn't wake up when I go to bed (and connect the charger). Many thanks for your patience and your excelent guide! I guess I'll bemodding some more APK's now
Cheers,
/Cacti
Click to expand...
Click to collapse
Great! I'll add that to the OP! Thanks for helping me out!
Updated the OP with a new signing method that should fix boot hang issues with some apks (aka Settings_ZTE)
bkores said:
Updated the OP with a new signing method that should fix boot hang issues with some apks (aka Settings_ZTE)
Click to expand...
Click to collapse
IMO it was just the same as your previous method (under 5.)was saying : move META-INF ( and manifest but not necessary imo) from original apk into the new apk (in dist folder).
Now you're saying : put res, resources and classes from new apk into new apk...that's just the same, no ? Only more files to move imo.
Since res, resources and classes are indeed changing by compile, wouldn't it be better by just saying : put META-INF from original apk into new apk, like you first wrote in OP ? Easier no ?
ALSO : under 6. you say : Open a command window in the "dist" folder and push the ORIGINAL apk/jar to the correct directory on your device
Shouldn't that be : push ORIGINAL (since you copied files under 5 from NEW(in "dist") to ORIGINAL(in working folder) ) FROM WORKING FOLDER ? Since there is no original apk in DIST folder, only our new apk. Imo you make things a bit confusing here, no ? :cyclops:
raystef66 said:
IMO it was just the same as your previous method (under 5.)was saying : move META-INF ( and manifest but not necessary imo) from original apk into the new apk (in dist folder).
Now you're saying : put res, resources and classes from new apk into new apk...that's just the same, no ? Only more files to move imo.
Since res, resources and classes are indeed changing by compile, wouldn't it be better by just saying : put META-INF from original apk into new apk, like you first wrote in OP ? Easier no ?
ALSO : under 6. you say : Open a command window in the "dist" folder and push the ORIGINAL apk/jar to the correct directory on your device
Shouldn't that be : push ORIGINAL (since you copied files under 5 from NEW(in "dist") to ORIGINAL(in working folder) ) FROM WORKING FOLDER ? Since there is no original apk in DIST folder, only our new apk. Imo you make things a bit confusing here, no ? :cyclops:
Click to expand...
Click to collapse
Fixed!
bkores said:
Fixed!
Click to expand...
Click to collapse
Thnx Mate ! Appreciate all your work :good:
i have some problem with framework.jar, it doesn't have classes.dex in jar but it also doesn't have odex file in /system/framework/oat/arm64 (also arm). Because of it i can't decompile it using smali/baksmali tool. I want to make more volume steps mode like VolumeSteps+ but without Xposed. Hope someone can help.

Categories

Resources