[Q] Compiling AOSP Standalone apps - Samsung Galaxy SL i9003

Hi, I've managed to edit, compile, and run the camera app on eclipse, to avoid compile the whole rom just to debug and try things.
(AOSP/CM9 to standalone app)
I just wanted to change the accesibility shutter button, but there are some issues:
I took sources from here: packages\apps\Camera (acual cm9 teamhacksung repo)
Then I removed all the AOSP references and added the correct libraries to make it work.
But the result of it was a different camera app, the differences are:
- The accesibility shutters works by default (power button) ☑
- There is no focus mode option in settings ☐
- Poor preview/picture quality ☑
- Glitched front face camera (green/black flickering) ☑
- etc ☐
(Seems like all the teamhacksung changes are not here)
Where do I need to take the sources to have our actual cm9 camera app to have the latest changes?
My objective is not to compile and finish this app in a standalone or a separated AOSP version, I just want to debug and edit stuff to see how is it working and then when I know that its working fine, push the edited files to the AOSP dir, and compile the whole rom.
Thanks in advance.
Here is the compiled .apk: http://www.mediafire.com/?9bi86dwgaln1abp
EDIT: Some issues are fixed by correcting the AndroidManifest.xml file.
EDIT2: All fixed http://forum.xda-developers.com/showpost.php?p=29418513&postcount=3

If your tree is updated and you just need to build a single part, you can use mmm
Code:
. build/envsetup.sh
lunch
mmm path/to/the/part/
So you don't have to worry about dependencies, libs etc and your sources are updated.
And if you just need to do changes in resources files, like xml files, images (like the wifi signal icon ) etc, you can add them in the overlay directory.
For example, if you need to do changes in config.xml of the Camera app:
Code:
mkdir -p devices/samsung/galaxysl/overlay/packages/apps/Camera/res/values/
and there create your config.xml, adding only the strings you want to override.

nice
Thanks, that's very useful info, so..
If I replace /device/samsung/galaxysl/overlay/packages/apps/Camera/res/values/config.xml (the only file) in my eclipse project it should work as the same app that when I do the mmm thing?
I will try that
EDIT: I've checked that config.xml and just toggle a flag (<bool name="wantsFocusModes">true</bool>)
So I just toggled that flag in my project and everything worked fine, also the alternative shutter.
The poor quality/front face bugs/glitches were becouse of my manifest file that I fixed later.
The question is: Why the accesibility/alternative shutter isnt working with the original one? The config.xml has nothing to do with the shutter >.< , maybe with permissions like this one:
<uses-permission android:name="android.permission.PREVENT_POWER_KEY" />
Click to expand...
Click to collapse
Btw my new Camera.apk works as I wanted to
Also checked this:
http://wiki.cyanogenmod.com/wiki/Loading_source_in_eclipse
and this:
To import the formatter, go to the preferences, section Java > Code Style >
formatter, then click on import and choose
development/ide/eclipse/android-formatting.xml
To import the import order, to go into Java > Code Style > Organize Import,
then click on import and choose development/ide/eclipse/android.importorder
Click to expand...
Click to collapse
Here is my Camera.apk compiled with eclipse, replace the Camera.apk in /system/app with this one. (Sorry for the size)
http://www.mediafire.com/?8plrf0hxxh02262
I was the only one with this "alt. shutter issue" right?

frapeti said:
Thanks, that's very useful info, so..
If I replace /device/samsung/galaxysl/overlay/packages/apps/Camera/res/values/config.xml (the only file) in my eclipse project it should work as the same app that when I do the mmm thing?
I will try that
EDIT: I've checked that config.xml and just toggle a flag (<bool name="wantsFocusModes">true</bool>)
So I just toggled that flag in my project and everything worked fine, also the alternative shutter.
The poor quality/front face bugs/glitches were becouse of my manifest file that I fixed later.
The question is: Why the accesibility/alternative shutter isnt working with the original one? The config.xml has nothing to do with the shutter >.< , maybe with permissions like this one:
Btw my new Camera.apk works as I wanted to
Also checked this:
http://wiki.cyanogenmod.com/wiki/Loading_source_in_eclipse
and this:
Here is my Camera.apk compiled with eclipse, replace the Camera.apk in /system/app with this one. (Sorry for the size)
http://www.mediafire.com/?8plrf0hxxh02262
I was the only one with this "alt. shutter issue" right?
Click to expand...
Click to collapse
No, you are not the only one. Actually it works, but you need to focus first.
I don't know if you built it with eclipse or mmm, but with mmm there's no png optimization and the resulting files are bigger.

loSconosciuto said:
If your tree is updated and you just need to build a single part, you can use mmm
Code:
. build/envsetup.sh
lunch
mmm path/to/the/part/
So you don't have to worry about dependencies, libs etc and your sources are updated.
And if you just need to do changes in resources files, like xml files, images (like the wifi signal icon ) etc, you can add them in the overlay directory.
For example, if you need to do changes in config.xml of the Camera app:
Code:
mkdir -p devices/samsung/galaxysl/overlay/packages/apps/Camera/res/values/
and there create your config.xml, adding only the strings you want to override.
Click to expand...
Click to collapse
Million thanks for the mmm trick and the link to cm web site! It is so hard to find information on building the sources.

May i use this in JB
Sent from my GT-I9003 using xda premium

Code for your App
Can I have code that can be compiled in Eclipse? Would you please email it to me @ [email protected]

Thank you so much for posting this question
Hi first of all billions of thanks, by getting an answer I can not build Settings.apk within few min,
My question is, I want to add activity in Settings.apk, for that I have done following code in AndroidManifest.xml
Code:
<activity android:name="com.android.settings.network.AirplaneModePreference"
android:taskAffinity="com.android.settings"
android:configChanges="orientation|keyboardHidden|screenSize"
android:parentActivityName="Settings"
android:label="Advance Airplane Mode">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
But still, when I want to start Activity in Settings.apk I am getting following an error
Code:
Process: com.android.settings, PID: 24946
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.settings.network/com.android.settings.network.AirplaneModePreference}; have you declared this activity in your AndroidManifest.xml (which is in Settings/AndroidManifest.xml) ?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2005)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1673)
at android.app.Activity.startActivityForResult(Activity.java:4587)
at android.app.Activity.startActivityForResult(Activity.java:4545)
at android.app.Activity.startActivity(Activity.java:4906)
at android.app.Activity.startActivity(Activity.java:4874)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:379)
at android.support.v7.preference.Preference.performClick(Preference.java:1139)
at com.android.settingslib.RestrictedPreference.performClick(RestrictedPreference.java:78)
at android.support.v7.preference.Preference.performClick(Preference.java:1107)
at android.support.v7.preference.Preference$1.onClick(Preference.java:172)
at android.view.View.performClick(View.java:6597)
at android.view.View.performClickInternal(View.java:6574)
at android.view.View.access$3100(View.java:778)
at android.view.View$PerformClick.run(View.java:25906)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6729)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Do you have any idea, then please let me know, thanks alot in advance

Related

Trying to change status_bar.xml but aapt keeps inserting zero bytes?

Hi,
I was trying to modify status_bar.xml in framework-res.apk. I downloaded the source from git, and started changing the xml files. Then I used aapt to package them into an apk. However, when I move the binary status_bar.xml to some other framework-res.apk that worked before, I get stuck in a boot loop. I compared both status_bar.xml's in a hex editor, and it seems aapt inserted a lot of zero bytes (see screenshot, left the new one, right is the working one), at first I thought it might have something to do with UTF-8, but setting another encoding didn't do anything. Anyone know what I'm doing wrong here?
Yeah, you're right, file on the right was built using new encoding introduced in Froyo and it can't work on Android <= 2.1 . It's used when you set minSdkVersion to 8.
But you said, that this one is ok and that normal encoding ("normal", cause it was here for last 2 years) on the left isn't working. I don't really know, why.
Brut.all said:
Yeah, you're right, file on the right was built using new encoding introduced in Froyo and it can't work on Android <= 2.1 . It's used when you set minSdkVersion to 8.
But you said, that this one is ok and that normal encoding ("normal", cause it was here for last 2 years) on the left isn't working. I don't really know, why.
Click to expand...
Click to collapse
The status_bar.xml on the right is from this AOSP Desire rom. I just tried to built it with minSdkVersion set to 8 and it seems to work. Thanks for the help!
Got one more question on the subject. It's working now, in the sense that I edit the XML file, use aapt to build an apk, then move the binary xml to the original framework-res.apk. When I try to sign the homebuilt framework-res.apk and boot my phone it goes into a boot loop. Is there any way that you can replace framework-res.apk without resigning all other apps?
I think you must install it through an update.zip file.
And right you are. Thank you very much
And here I am again. It does seem to work, signing it and putting it into an update.zip, however, when I boot my phone, it gets to the sim unlock screen, and it starts FCing. Logcat has the following messages:
Code:
W/PackageManager( 400): Unknown permission android.permission.VIBRATE in package com.google.android.gsf
W/PackageManager( 400): Unknown permission android.permission.WAKE_LOCK in package com.google.android.gsf
W/PackageManager( 400): Unknown permission android.permission.WRITE_CONTACTS in package com.google.android.gsf
Basically it shows these messages for all applications, for all permissions. The weird thing is, I tried this yesteray, right after your post and it worked fine. But now it doesn't work anymore. This is, by the way, the newest framework-res.apk from git, no changes.

A way to Optimizing APK & Framework files

For optimizing apks, aside from fixAllAPKs by omniwolf, I found another one.
Note: I have no responsibility for breaking your ROM, so backup first.
Rights: No rights reserved, you can do whatever you like.
The classes.dex files have significant amount of debug infos in it, striping out those can reduce file size and increase some performance. I test it with all /system/app/ and /system/framework/ files, the ROM runs snapier, especially when you launching apps. Stripe out those debug info doesn't hurt anything, they are usefull only for original developer and one who wants to mod it, but you can always keep a copy of the original one for modding and debugging purpose.
Note that this does not boost performance like increase CPU freq, but the theory is, since the file size is reduced, dex and dalvik-cache became smaller in size, occupies memories smaller, thus processing is faster, and saves a little battery life, you can think it as something like optipng does.
Note also, you don't need to specify 0 compression, dex will be decompressed to /data/dalvik-cache, just use fixAllAPKs for fixing files inside APK that should not be compressed, and 0 compression for file type like xml isn't really a good idea.
Don't use this for ICS Framework files yet, there are specific files will causes surprising bugs when recompiled, but I'm lazy to find it out why and what, so just don't do it.
For FixAllAPKs, original thread here, http://forum.xda-developers.com/showthread.php?t=1123463
or post #36 by carl1961 http://forum.xda-developers.com/showpost.php?p=21458549&postcount=36
==========================================================================================================
RemoveDebuggingInfo_v2.2:
API Level must be specified to get 100% compatibility, it seems not forward nor backward compatible.
Froyo = 8, GB = 10, ICS4.0 ~ 4.0.2 = 14, ICS 4.0.3 = 15
Added API Level chooser, default 15 (ICS 4.0.3)
Added more descriptions.
Correct typos.
==========================================================================================================
depricated...
RemoveDebuggingInfo_v2.1:
First, Thanks to all who corrects me.
fix typo for menu selection 6
fix path for pulling for adb to work without setting PATH env variable
fix pushing framework to wrong directory
update smali/baksmali to v1.3.2
update script to compile/decompile using api level 15
added menu selection of fixAllAPKs
Instructions: Important
The default config is for ICS 4.03 base ROM, if you are gonna use it for Gingerbread Base ROM, need to edit the file RemoveDebuggingInfo.bat, and change the -a 15 to -a 10 for API level 10, then just double click start.bat and follow the on screen instruction.
java -jar baksmali-1.3.2.jar -b -a 10 -o .\classes .\classes.dex
java -jar smali-1.3.2.jar -a 10 .\classes -o .\classes.dex
Click to expand...
Click to collapse
Using API level 10 for ICS and API level 15 for GB will not work, you phone will just hang or endless reboots.
Pushing framework will reset all your settings, so if you choose to push framework, do a factory reset instead and just re-install your user apps.
After pushing /system/app, you must reboot to recovery and wipe dalvik and cache, another way of pushing is boot to recovery, mount /system then push.
I have only tested on Gingerbread 2.08.401.1 base, have no idea for ICS, but it should work, as the latest smali/baksmali supports ICS.
If you experience glitches, do it from the beginning by using un-modified apk and jar.
How it works: it is just baksmali (decompile dex to smali code WITHOUT debugging info) and then smali (compile back to dex)
Requirements: java and htc sync usb driver.
==========================================================================================================
Depricated - too much error.
RemoveDebuggingInfo_v2:
Added another script for simpler operations, instead of dragging hundreds of APKs, it is self descriptive, can pull and push /system/app, /system/framework, optimizing all files for app and framework, and reboot to recovery.
Tested on v2.08.401.1 ROM, on all files /system/app, /system/framework, should work on other device and ROM too, but not sure, test it yourself!
==========================================================================================================
For /data/app/ user application files, modify it may not installed at all, re-sign it also not help, so just do it manually to test.
But for now, here is a way to do it manually, since /system partition will not grow and many spaces left, you can simply put some APP on this partition, and following are working on my ROM, some should have naming as com.a.b.c... whatever is the name installed on /data/app/ stripe out the -1 at the end. Just besure the APP is uninstalled before pushing to /system/app/
Below are what I tested.
AdobePhotoshopExpress.apk
BarcodeScanner.apk
com.evernote.skitch.apk
ESFileExplorer.apk
GoogleDocs.apk
GoogleGoggles.apk
GoogleTranslate.apk
GPSTest.apk
org.hermit.audalyzer.apk
For APKs that has lib folder, you can just extract it and put it on /system/lib/ then del the lib folder inside the apk archive, e.g. flashplayer, adobereader.
adb should be start only once after booting your PC, if you get issues, like adb always shows restarting and out of date, it is because the included adb.exe in htc sync is out of date, and you had installed android sdk with environmental variable set, to fix it, both must have same version, or simply delete one of them, and if you have path variable set, you can del the included adb.exe as well.
Thanks for this, I will be sure to use it
Sent from my HTC Sensation XE with Beats Audio Z715e using xda premium
I have 189 Apps in system/app .... is there a way to make it with all files!?
Jonny said:
Thanks for this, I will be sure to use it
Just out of interest, what program do you use for getting the smali code?
Click to expand...
Click to collapse
It is the one and only, baksmali.jar and smali.jar http://code.google.com/p/smali/
xtcislove said:
I have 189 Apps in system/app .... is there a way to make it with all files!?
Click to expand...
Click to collapse
Yes I know it is so much, but need to write a sohphisticated code, maybe if I have time, I'll try to make it more easier, a vbscript or cmd script, or a shell script in linux. And don't forget the framework files too.
mudhi said:
I test it with all /system/app/ and /system/framework/ files, the ROM runs snapier, especially when you launching apps.
Click to expand...
Click to collapse
It is really so. I have checked it up.
mudhi said:
It is the one and only, baksmali.jar and smali.jar http://code.google.com/p/smali/
Click to expand...
Click to collapse
Thank you mudhi
a little off topic here, Is there a way to change smali files into a readable code (let's say i want to use it with eclipse !!)
i have tried searching and i came across Dex2Jar and jd-gui !!
my question here is: is there a way to use smali files into Eclipse ??
Alfaifi said:
Thank you mudhi
a little off topic here, Is there a way to change smali files into a readable code (let's say i want to use it with eclipse !!)
i have tried searching and i came across Dex2Jar and jd-gui !!
my question here is: is there a way to use smali files into Eclipse ??
Click to expand...
Click to collapse
Yes, use dex2jar to jar archive file, then jd-gui to view the source, you can also use DJ-decompiler (commercial) to view and change code, but that's not really readable, and compile back is too hard, and also jbe, ce etc... but I came to a conclusion.
Use dex2jar to decompile dex and use jd-gui to view the source for understand logic, method etc... and just reference it to smali code, and if you get use to it, hacking app will be easier, perhaps more easier than viewing the source code, because hackiing involviing mostly on 0 to 1, true to false, jump to where ... and that is only adding or changing a single code in smali, e.g. logic if a == b then c, if you want to make it always c, then just if 0 == 0 then c, or just a simple jump etc...
@mudhi new smali/baksmali 1.3.2 is out
And is also possible to remove debugging info from jar files that are present in framework folder?
texture said:
And is also possible to remove debugging info from jar files that are present in framework folder?
Click to expand...
Click to collapse
I think you can just rename them to .apk and then back to .jar.
mike1986. said:
I think you can just rename them to .apk and then back to .jar.
Click to expand...
Click to collapse
No you dont need to, just put(or pull) all framework files (both apks and jars) and it will process them all automatically.
Btw i just ran this on InsertCoin 4.1.1 for all APPS and Framework except i changed a script a bit (added -mx0) so it compresses APKS with 0 compression.
And can tell you that phone definitively feels faster, boots faster, apps open faster, and there a bit more free RAM available now.
Thank you mudhi allot for this!
mike1986. said:
@mudhi new smali/baksmali 1.3.2 is out
Click to expand...
Click to collapse
ah... hehe thank you, supposed ICS 4.0.3 is supported. Thank you!
Need a little clarification ..
java -version
if errorlevel 1 goto javaerr
---------------------
C:\>java -version
'java' is not recognized as an internal or external command,
operable program or batch file.
---------------------
I installed java however still get an error ..
What is needed > to install ? Link Maybe ?
Also ... I found a small ops in the bat file ..
:javaerr
cls
echo Java is not found, please install java and rerun the script.
echo Hit anykey to quit
PAUSE
goto end < forgot this ?
Thanks ..
WarlockW said:
Need a little clarification ..
java -version
if errorlevel 1 goto javaerr
---------------------
C:\>java -version
'java' is not recognized as an internal or external command,
operable program or batch file.
---------------------
I installed java however still get an error ..
What is needed > to install ? Link Maybe ?
Also ... I found a small ops in the bat file ..
:javaerr
cls
echo Java is not found, please install java and rerun the script.
echo Hit anykey to quit
PAUSE
goto end < forgot this ?
Thanks ..
Click to expand...
Click to collapse
You need to set java variable, here's how-to:
http://java.com/en/download/help/path.xml
mudhi, You've got few errors in start.bat file. If you want to pull the apps to "app" folder, use this command "adb pull /system/app/ app". If you do cd app, It won't find the adb in the app folder and won't do nothing.
ivicask said:
No you dont need to, just put(or pull) all framework files (both apks and jars) and it will process them all automatically.
Btw i just ran this on InsertCoin 4.1.1 for all APPS and Framework except i changed a script a bit (added -mx0) so it compresses APKS with 0 compression.
And can tell you that phone definitively feels faster, boots faster, apps open faster, and there a bit more free RAM available now.
Thank you mudhi allot for this!
Click to expand...
Click to collapse
Before optimizing with this script, my apks are all fixed with the vbscript by omniwolf, it only compress files that should be compressed, the script fixAllAPKs.vbs can be used before or after this. Anyway, I'll add a decision to run the script.
mudhi said:
Before optimizing with this script, my apks are all fixed with the vbscript by omniwolf, it only compress files that should be compressed, the script fixAllAPKs.vbs can be used before or after this. Anyway, I'll add a decision to run the script.
Click to expand...
Click to collapse
Is there any problem with doing 0 compression on all files? I dont have space problems, and doesnt that make phone run faster as it doesnt need to decompress any data? Saves both CPU and RAM?
drms12 said:
mudhi, You've got few errors in start.bat file. If you want to pull the apps to "app" folder, use this command "adb pull /system/app/ app". If you do cd app, It won't find the adb in the app folder and won't do nothing.
Click to expand...
Click to collapse
Oh yes, I know where's the error, because I have android sdk installed and environmental PATH variable are set, you can fix it by just set the PATH variable with where the adb.exe exist.
Or just change the script with this
ullapp
cd app
../adb pull /system/app/
or
ullapp
adb pull /system/app/ app
same as pullframe
mudhi said:
Oh yes, I know where's the error, because I have android sdk installed and environmental PATH variable are set, you can fix it by just set the PATH variable with where the adb.exe exist.
Or just change the script with this
ullapp
cd app
../adb pull /system/app/
or
ullapp
adb pull /system/app/ app
same as pullframe
Click to expand...
Click to collapse
Yes
I think you forgot to update the download, It still ver2.
There is an error in script - the push command to upload files to framework uploads them to /system/app
ICS 4.0.3 - got bootloop just after lockscreen shows. Had to restore system.

[How-To] FIX various compile errors with common Sense 4.0 files -Update apktool 1.4.9

This guide assumes you already know how to use apktool and / or apkmanager. If you don`t, there are plenty of guides already on XDA.
Latest Sense 4.0 and apktool are not great friends. The 3 most important files framework-res.apk, com.htc.resources.apk and systemui.apk all create fatal errors, when using latest apktool 1.43 version. Apktool`s error log is always a big help to solve compile issues, but you need a bit of compile and coding experience to finally solve these. After I stumbled about many people having Sense 4.0 compile issues, I decided to post this guide. Hopefully this will encourage more guys to add mods to One S, after they might have hit a wall before.
Credits:
brut for his awesome apktool
daneshm for original apkmanager
Known issues: ATM com.htc.resources fix does not work with One X
1. Framework-res.apk
a) Since ICS apktool creates multiple plurals errors, but you can easily fix these by using a custom version of apktool. Now updated incl. latest smali baksmali properties for ICS (thx fernando)
Custom ICS apktool version - http://minus.com/mIA3OFkYq/19
b) if you get tag errors like these
anims.xml:3: error: Found tag anim where item is expected
layouts.xml:3: error: Found tag layout where item is expected
raws.xml:3: error: Found tag raw where item is expected
Replace all tags in layouts.xml in values folder with:
<item type="layout" at the front and </item> at the end
Replace all tags in anims.xml in values folder with:
<item type="anim" at the front and </item> at the end
Replace all tags in raw.xml in values folder with:
<item type="raw" at the front and </item> at the end
2. Systemui.apk
When trying to decompile systemui, you will get bad magic value errors. Solution is to decompile without classes, as long as you don`t need to edit smali code. Even if you need to do that, you can still decompile classes.dex separately with smali baksmali.
a) Use -s switch when decompiling to copy classes.dex instead of decompiling it
java -jar apktool.jar d -s systemui.apk systemui-decoded
b) If you are using apkmanager, you can just export classes.dex, then delete classes inside the apk. Then decompile, edit, compile and add classes.dex back when ready.
EDIT: with updated apktool version systemui now compiles fine incl. classes.dex
3. com.htc.resources.apk
Here you get nice layouts tag errors and public entry issues. Again there`s an easy fix for that.
a) Replace all tags in layouts.xml in values folder with:
<item type="layout" at the front and </item> at the end
PHP:
<resources>
<item type="layout" name="htc_list_item_imageicon_text">@layout/zzzz_htc_list_item_imageicon_text</item>
<item type="layout" name="pin_keyboard">@layout/zzzz_pin_keyboard</item>
<item type="layout" name="zero_dummy_layout">@layout/alert_dialog</item>
<item type="layout" name="htc_list_item_2text_2stamp">@layout/zzzz_htc_list_item_2text_2stamp</item>
<item type="layout" name="htc_list_item_2text_bright">@layout/zzzz_htc_list_item_2text_bright</item>
<item type="layout" name="htc_list_item_image_2text_image_bright">@layout/zzzz_htc_list_item_image_2text_image_bright</item>
<item type="layout" name="htc_list_item_imageicon_2text_2stamp">@layout/zzzz_htc_list_item_imageicon_2text_2stamp</item>
<item type="layout" name="htc_list_item_separator">@layout/zzzz_htc_list_item_separator</item>
<item type="layout" name="htc_list_item_dlna_1">false</item>
</resources>
b) Delete entry "zero_dummy_dimen" in public.xml - it will be created correctly again during compile
In case you still have issues, here is my apkmanager build environment, that works fine with all these fixes.
http://minus.com/mIA3OFkYq/20
Hex editing solution for latest com.htc - thx to tbonanno231 - http://forum.xda-developers.com/showpost.php?p=32222697&postcount=112
Latest apktool version 1.4.9 from ibotpeaches
Big thx to ibotpeaches for the tremendous follow up on apktool
Fixes plural errors
Fixes item tag errors
Fixes bad magic value errors
Adds ICS smali properties (compared to latest official version from brutall)
Fixes unknown folder issues (only with patched aapt.exe)
Download apktool 1.4.9:
http://sdrv.ms/T0LpzK
Download patched aapt.exe
http://sdrv.ms/Mfrkaa
c) Workaround for One X ROM´s
Since many of you guys might only be in need to decompile all the .9`s in com.htc.resources, there is a workaround that allows you to compile these.
Decompile with:
1. java -jar apktool.jar d --keep-broken-res com.htc.resources.apk com.htc.resources-decoded
This ignores all errors and decompiles the apk incl. all patched pngs.
2. Make your changes and copy the changed png`s in any given decompiled apk (I use calendarprovider.apk for this task, very slim apk, compiles fast...) and compile them
Updated with new custom apktool version, that includes latest smali baksmali properties to properly decompile ICS Java code.
Updated with new section b), that explains how to fix tag errors with latest 1.78 framework-res.apk
After trying this method.....it compiles framework-res 100% with absolutely NO issues. Thanks a million!!! I'm pretty sure everything else works....
Now I guess I'll try and work and see if I can find out how integrated in the framework WiFi calling is in the T-Mobile One S build in hopes we can get it working on any One S ROM, US or EU based....
Any ideas would help! lol
You can PM chrisch1974 from Virtuous team, he is already working on this. Maybe your combined efforts help.
Updated apkmanager with latest apktool version that includes ICS smali properties
he_stheone64 said:
Updated apkmanager with latest apktool version that includes ICS smali properties
Click to expand...
Click to collapse
Would be amazing integrate this tutorial with mine on vts!
Inviato dal mio HTC Sensation XE con Tapatalk 2
no problem old DHD buddy, just go ahead.
Really appreciate this man! Exactly what I've been waiting for. The apktool.jar seems to be working fine, but the apk manager build environment won't compile .apks correctly for me. Is it supposed to be working straight out of the box?
Edit: Has anyone successfully edited colors.xml in Camera.apk without breaking the video recording function? Seems to be impossible for me.
Edit 2: Has anyone successfully edited colors.xml in Contacts.apk without breaking it?
I tried HTCContacts and resources like colors and styles are fine, it did not break anything on the phone.
First of all great work.
But i have a little problem.
When i decompile the systemUi its works well but when a compilate it, after i made a few changes, it simple dont change anyting. The final system is the same that de original...
Can you help me?
Thanks
he_stheone64 said:
no problem old DHD buddy, just go ahead.
Click to expand...
Click to collapse
Yeah now I'm on Sensation, ASAP I'll send you a pm
Inviato dal mio HTC Sensation XE con Tapatalk 2
MatZ69 said:
First of all great work.
But i have a little problem.
When i decompile the systemUi its works well but when a compilate it, after i made a few changes, it simple dont change anyting. The final system is the same that de original...
Can you help me?
Thanks
Click to expand...
Click to collapse
Have you spelled the name of your compiled apk correctly? Once I had like four systemuis in there, with variations of capital/ non-capital letters you can check via adb:
adb shell
Cd system/app
Ls
Then you can use rm commands to remove the apks there and push your modded one
Sent from my HTC One S using XDA
Double post
Habarug said:
Have you spelled the name of your compiled apk correctly? Once I had like four systemuis in there, with variations of capital/ non-capital letters you can check via adb:
adb shell
Cd system/app
Ls
Then you can use rm commands to remove the apks there and push your modded one
Sent from my HTC One S using XDA
Click to expand...
Click to collapse
Yh you are right. Now have another problrm. Im trying to compile te settings but i need the dependencies of framework
Bu whe do decompile whit dependencies it simple dont accept it. I cant figure what its wrong. Thanks
Sent from my GT-S5660 using XDA
Did you install proper framework with apktool if command or with 10 in apkmanager?
he_stheone64 said:
Did you install proper framework with apktool if command or with 10 in apkmanager?
Click to expand...
Click to collapse
Yh but it says: "Sorry that is not a dependencie apk"...
and i did with apktool the "if" command...
Dont know :/
did you try dragging in the htc.resources.apk from your rom in the first step of option 10. in apk manager?
Sorry but i'm using a samsung :S
Then you need to do the same with twframework.

[Guide:] The Definitive APK Modding and Theming Thread...

First of all, you don't actually need to be a "developer" as such to be able to theme and you don't need to know or have to learn lots of code either.
Secondly, EVERYTHING you need to know and need to use to modify an .apk is in this thread!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The greatest thing about Android is that you can change just about every element of the U.I and it’s really easy to do too. I wrote this guide to share the experience and knowledge I've gained since joining xda to debrand my SonyEricsson XPERIA X10i that was running Gingerbread. In 2017 there are a few different ways you can theme a ROM.
Apktool, which can decompile an .apk allowing you to modify your own .xmls and .9png images, which is what this thread will focus on.
RRO, Xposed essentially overlay themes or mods.
There is a variety of programs that use a GUI to do the work of Apktool for you, some good, some bad but at the end of the day they all ultimately do what you can easily do yourself in a faster, cleaner and more efficient manner in my opinion.
Overlaying doesn't cover every element so falls short of a one stop solution for being able to fully theme a ROM and is a bit more complex and/or restrictive in it's approach.
Tools you're going to need:
Java - Do this first if you don't have it installed already.
Apktool - The main tool for decompiling and recompiling apks.
Notepad++ - An essential program for xml editing!
Photoshop or Gimp - You'll need one of these for image editing.
7-Zip or WinRar - Required for working with apks.
We also need the ADB files from the SDK Platform and a sign.jar but to simplify this as much as possible I've made a zip for you to download which contains Apktool and everything else you need that you haven't got from the list above.
Download APKTool_2.2.4.zip to a location of your choice, preferably the C:\ drive which will give you a folder to work from. To keep the folder updated you can download the updated files from the retrospective thread/sites and simply replace them in the folder.​
This thread will cover the following in an easy to follow and straight forward manner that will have you theming your own apks in no time.
Getting apks from a ROM
Deodexing
.apk De-compiling
.apk Recompiling
.apk Signing
.apk Zipaligning
Pushing Files to your Phone
.9 images
Vector Drawable
.xmls
+More
Quick Tips;
.apk files can be browsed like .zip files so set your zip program as the default for handling apks which will makes things much easier.
If all you want to do is edit images then you don't need to decompile, you can just drag and drop images in to an apk to replace a stock image so long as they have the same file name.
Restoring files if you mess up is easier and quicker with a CWM.zip, especially if you're modifying framework apks! Just because an apk might build with no errors doesn't mean it won't give you any when installed to the Phone.
​
Getting apks from a ROM:
Once your Apktool folder is setup you need to get the apks you want to theme out of a ROM or off of your Phone and there are a couple of ways to do this.
1. The simplest method is to extract your phones whole system from an unofficial update file from xda, whatever format that may be in depends on your device. I extract the whole system with every new update before doing anything because it gives me a backup of stock files which I can also copy and deodex to be themed.
2. Use adb commands to pull files to your computer, to do that we need to open a command prompt window (hold the shift key then right click your mouse in the Apktool folder and select "open command window here").
The command to pull your whole system is...
Code:
[B]adb pull /system/ XC_206[/B]
...you can choose something other than XC_206 as your folder name but it will create that folder in your Apktool folder. Alternatively, you can just download individual folders and the commands to do that are…
Code:
[B]adb pull /system/app/ XC_206 app
adb pull /system/priv-app/ XC_206 priv-app
adb pull /system/framework/ XC_206 framework[/B]
...or to pull individual files...
Code:
[B]adb pull /system/framework/framework-res.apk[/B]
3. Use a root explorer on your phone to copy files to your SD and then to your PC.​
Depending on your method you should now have a ApkTool_2.2.4 folder with another folder named 206_system for example in it. The only folders we need at this point are app, priv-app and framework which we need for the next step.
Deodexing:
“Deodexing is basically repackaging of these APKs in a certain way, such that they are reassembled into classes.dex files. By doing that, all pieces of an application package are put together back in one place, thus eliminating the worry of a modified APK conflicting with some separate odexed parts.” – What Is Odex And Deodex In Android​The tool I use is this - [Tool/Utility] JoelDroid Lollipop Batch Deodexer. To save a lot of time I only deodex the apps I'm going to use because it removes the process of having to mess about with smali and baksmali, plus YOU DON'T NEED TO DEODEX YOUR WHOLE FW!, depending on the apk and/or the mod you want to make you don't even need to deodex.
So now you should have a folder named system full of deodexed apks that are ready for playing with.
Decompiling:
Decompiling is the process of deconstructing an apk which gives us workable source code so to speak and we need to do this to be able to edit xmls in Notepad++ or .9 images in an image editor. As said above if you don't want or need to decompile because you just want to change an image here or there you can just drag and drop your res folder out of the apk, find the image I wanted to replace or modify, drag and drop it back in to the apk and push it back to your phone.
Before proceeding you need to install your framework-res.apk and depending on your FW possibly another apk if there is one in the framework folder, which will put one (or two) apks at C:\Users\your-pc-name\AppData\Local\apktool\framework The two commands to install your apks are...
Code:
[b]apktool if framework-res.apk
apktool if SemcGenericUxpRes.apk[/b]
The command for decompiling always begins the same, apktool d then simply change it for the name of the next apk you want to modify. To decompile the framework-res.apk the command is...
Code:
[B][U]apktool[/U] [U]d[/U][/B] framework-res.apk
...this will create a folder named framework-res and it’s at this stage that you can now begin to modify .9 images and xmls to create the desired look or mod you’re after. In this folder you'll find a couple of folders but the one we want is the res folder. First glance of a decompiled res folder can be overwhelming, 1541 folders in my framework but we only need to focus on a handful and it's generally the same in every apk...
drawable
drawable-xhdpi-v4 (depending on your device)
layout
values
​...you may need to delve into others sometimes but it's very rare that I've had to.
Quick Tip;
Once you've entered a few commands so long as you leave the cmd window open you can quickly scroll back through them using your arrow keys.
Recompiling:
Once you've finished making your mods you need to recompile your apk using the following command...
Code:
[B][U]apktool[/U] [U]b[/U][/B] framework-res
...notice you only use the folder name here. If you get any errors here due to a bad edit apktool will usually tell you, in a roundabout way, you just need to read the code it throws up then retrace your steps, correct any bad edit and try again. If all goes smoothly you'll now have a new folder called dist, which contains your newly modified apk, but you can't use that just yet.
Signing:
To sign stock system .apks we need to extract from the original apk the Android.Manifest.xml and META-INF folder, into the dist folder, then from the new apk extract the resources.arsc also into the dist folder, then drag and drop all three files back into the new apk, but NOTE, it's important that you choose store as the compression method, any other will break the apk, and if you replace a broken framework-res.apk you will BOOTLOOP!. And signing is as simple as that.
For 3rd party apps you can use the following command...
Code:
[B]java -jar signapk.jar testkey.x509.pem testkey.pk8[/B] Chrome.apk ChromeS.apk
...notice the extra "S", the output name has to differ from the input name otherwise it will give an error, if done right it will create a new apk called ChromeS.apk, just remember to rename it back to the original before using it on your Phone.
[TOOL] pySignare - Quickly Sign APKs [Windows]​
Signing For The Play Store
If you plan on Publishing a Theme or any other app/apk to the Play Store then using the above method to sign your apks just wont work because you need to give it an individual signature that is unique to you, thankfully @AndroidGraphix has written a great guide that will show you how, it's a bit more fidgety than the above method but simple enough to follow...
AndroidGraphix said:
What you'll need to sign an APK.
Click to expand...
Click to collapse
- Noobs guide to signing an APK with a Private Key​
Zipaligning:
DISADVANTAGES OF UNALIGNED APKs; Quite understandably, situation would be reserved for unaligned application packages. Resource reading would be slow and memory usage would be on the higher end of the spectrum. It would also depend on how many unaligned applications are present. For example, if less number of applications with an unaligned home application, you’d see slower application launch times. This is the best case scenario. For a worst case scenario, having a number of unaligned applications will result in the system repeatedly starting and killing processes, struggling with lags and huge battery drain. - SOURCE​Move your new signed apk into your APKTool folder, you can overwrite your original if you want, and use the following command...
Code:
[B][U]zipalign -f -v 4[/U][/B] framework-res.apk ZAframework-res.apk
...notice the ZA, zipaligning creates a new apk which has to be named different from the original, but use what you want, it'll need renaming back to the original again before you use it.
Pushing Files to your Phone:
So now we need to transfer your apk back to your Phone, you can do it by copying to your SD, then to your system, change permissions, then copy to the right folder, but that's not only time consuming but highly tedious too, so a simpler method is to use adb using the push command as this allows us to push to the SD Card then install it to the system overwriting the original with the correct permissions too. If you do this with the framework-res or SystemUI apks you will need to reboot but generally all other apps will just refresh with the changes applied. The command to push to the SD Card is...
Code:
[b]adb push SystemUI.apk /sdcard/SystemUI.apk
[/b]​...then we need to mount the system before we can install our modified apk and the commands for that are...
Code:
[b]adb shell
[/b]​
Code:
[b]su
[/b]​The prefix will then change to the $ sign
Code:
[b]mount -o rw,remount /system
[/b]​...then to install your apk...
Code:
[b]dd if=/sdcard/SystemUI.apk of=/system/priv-app/SystemUI/SystemUI.apk
[/b]​If any of that fails you could try an unsecure kernel and/or Chainfires adbd Insecure app. Try the app first but if you still can't mount and push files read this thread - [HOW TO]Make your favorite kernel adbd insecure to run ADB as root on /system and try again.
.9 pngs:
I hope after reading this explanation you're not still left wondering what all the fuss is about as it really is quite simple. I'll use the following two images, btn_default_pressed_holo.9 & status_bar_close_off.9 to illustrate the basic point of the borders...
Decompiled .9pngs:
Recompiled .9pngs:
Those borders control which part of the image is stretched (Left & Top) and where on the image content will be displayed (Right & Bottom). We'll use Draw 9-patch which is for editing the borders of decompiled .9pngs and lets you see how the image, when stretched, will be displayed on the Phone. Notice that the borders are different sizes, well that's because I only want/need a certain part of the image to stretch to get the desired look on the Phone.
...in the image below the left side shows the stretched image and desired effect should look on the Phone and the right side shows how it would look if I had edited the borders incorrectly or used none at all...
You can get away by not using a border but you would need to edit your image to specific dimensions to accommodate for the stretching, for example it might look fine for a simple OK button but it might not look right if you used the same .9png for a screen press which stretches the whole length of the screen, so you're better off just using them to begin with, plus you'll more than likely get errors down the line while decompiling or recompiling your apk.
The use of the border is made even more clear when you add text to an image. For my status_bar_close_off.9 I've filled all four sides of the image (except for an empty pixel in all four corners as that is the max amount of border you can use) as I need it to stretch the image just how I've edited it...
...but if I used the same sized left side border as the btn_default_pressed_holo.9 then this is how it would look on the Phone...
...which is obviously not the look I'm trying to achieve, as the left side border is causing the image to stretch incorrectly.
So that's basically it, depending on the image you're editing you can usually leave the borders alone but if you create one from scratch then you might need to play about with them if your images doesn't look quite right when used on the Phone. Here's a few links that will assist you further, especially the batch editing...
How to edit .9.pngs
[TUTO] Create your 9.png !
[UTILITY][TOOL] 9patchPngSuite [Windows&Linux]
How to draw NinePatch images with Photoshop - .9.PNG
[TOOL][Multi-Platform][.9.png][ALL DPIs] Android Resizer Tool
[Tutorial][Commentary] How To Batch Edit .9PNG/PNG Images
9compiler - batch process for themers android
Vector Drawable:
A VectorDrawable is a vector graphic defined in an XML file as a set of points, lines, and curves along with its associated color information. The major advantage of using a vector drawable is image scalability. It can be scaled without loss of display quality, which means the same file is resized for different screen densities without loss of image quality. This results in smaller APK files and less developer maintenance. You can also use vector images for animation by using multiple XML files instead of multiple images for each display resolution.​- developer.android.com/guide/topics/graphics/vector-drawable-resources
Vector drawables obviously serve a purpose but are a pita imo for themers as they are a lot more difficult to edit and achieve the look you want.
Using my power menu to illustrate the issue, Power off, Restart and Take screenshot icons are vector drawables but the Record screen icon is a png...
...as you can see the Record screen icon is significantly bigger and ruins the look of my power menu, to over come this I have two options.
1. Learn how to edit vector drawables and create a new icon.
2. Replace the vector drawables and use pngs.
The latter to me is preferable because I already have images that I've been using for the last few years and want to continue using, to do so I need to replace the code in the relevant xmls to point at images...
framework-res/drawable/ic_lock_power_off.xml
Vector drawable code...
Code:
<?xml version="1.0" encoding="utf-8"?>
<vector android:tint="?colorControlNormal" android:height="24.0dip" android:width="24.0dip" android:viewportWidth="24.0" android:viewportHeight="24.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#ff000000" android:pathData="M13.0,3.0l-2.0,0.0l0.0,10.0l2.0,0.0L13.0,3.0zm4.83,2.17l-1.42,1.42C17.99,7.86 19.0,9.81 19.0,12.0c0.0,3.87 -3.13,7.0 -7.0,7.0s-7.0,-3.13 -7.0,-7.0c0.0,-2.19 1.01,-4.14 2.58,-5.42L6.17,5.17C4.23,6.82 3.0,9.26 3.0,12.0c0.0,4.97 4.03,9.0 9.0,9.0s9.0,-4.03 9.0,-9.0c0.0,-2.74 -1.23,-5.18 -3.17,-6.83z" />
</vector>
My edited code...
Code:
<?xml version="1.0" encoding="utf-8"?>
<bitmap android:src="@drawable/ic_lock_power_off_alpha"
xmlns:android="http://schemas.android.com/apk/res/android" />
framework-res/drawable/ic_restart.xml
Vector drawable code...
Code:
<?xml version="1.0" encoding="utf-8"?>
<vector android:tint="?colorControlNormal" android:height="24.0dip" android:width="24.0dip" android:viewportWidth="24.0" android:viewportHeight="24.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#ff000000" android:pathData="M12.0,4.0L12.0,1.0L8.0,5.0l4.0,4.0L12.0,6.0c3.9,0.0 7.0,3.1 7.0,7.0c0.0,3.9 -3.1,7.0 -7.0,7.0l0.0,2.0c5.0,0.0 9.0,-4.0 9.0,-9.0C21.0,8.0 17.0,4.0 12.0,4.0z" />
<path android:fillColor="#ff000000" android:pathData="M5.0,12.9C5.0,11.0 5.8,9.2 7.2,7.9L5.8,6.4C4.0,8.1 3.0,10.5 3.0,12.9c0.0,4.0 2.7,7.6 6.5,8.7l0.5,-1.9C7.1,18.8 5.0,16.1 5.0,12.9z" />
</vector>
My edited code...
Code:
<?xml version="1.0" encoding="utf-8"?>
<bitmap android:src="@drawable/ic_lock_restart"
xmlns:android="http://schemas.android.com/apk/res/android" />
framework-res/drawable/ic_semc_ic_dialog_screenshot.xml
Vector drawable code...
Code:
<?xml version="1.0" encoding="utf-8"?>
<vector android:height="24.0dip" android:width="24.0dip" android:viewportWidth="24.0" android:viewportHeight="24.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#8a000000" android:pathData="M5,5l4,0l0,-2l-4,0l-2,0l0,2l0,4l2,0l0,-4z" />
<path android:fillColor="#8a000000" android:pathData="M19,3l-4,0l0,2l4,0l0,4l2,0l0,-4l0,-2l-2,0z" />
<path android:fillColor="#8a000000" android:pathData="M5,15l-2,0l0,4l0,2l2,0l4,0l0,-2l-4,0l0,-4z" />
<path android:fillColor="#8a000000" android:pathData="M19,19l-4,0l0,2l4,0l2,0l0,-2l0,-4l-2,0l0,4z" />
<path android:fillColor="#8a000000" android:pathData="M16,13l0,-2l-3,0l0,-3l-2,0l0,3l-3,0l0,2l3,0l0,3l2,0l0,-3l3,0z" />
</vector>
My edited code...
Code:
<?xml version="1.0" encoding="utf-8"?>
<bitmap android:src="@drawable/semc_ic_dialog_screenshot"
xmlns:android="http://schemas.android.com/apk/res/android" />
...and the result as you can see here provides a much more unified look...
...and finally my desired end result...
.xmls:
Modifying .xmls is easy and pretty simply to understand, a massive clue in finding the ones you need to edit is the file names. You're not going to find a better guide than the one by Ticklefish so I'll just post a snippet here and you can head over and give the main thread a read and and a thanks.
Ticklefish said:
XML 101 - XML Modding Made Easy!
If you're modding Android, eventually you're going to have to edit some XML.
Want to center the clock in your statusbar? Rearrange the icons in your navbar? Change the layout of your notification screen? Get rid of a carrier label? Change the colour of some text?
Then you need to edit some XML files.
And you might not have any idea how...
Well, don't worry. The purpose of this thread is to show you just easy XML-editing can be. Once you've read it, you'll be one step closer to being an XML expert!
This guide is meant for noobs, experienced modders and everyone in between. Hopefully everybody can learn something..
Here's what this thread has to offer so far:
- Introduction (This Post)
- How To Delete A Line (Yes, Really)
- Some Useful Codes To Know
- How To Change The Colour Of The Status Bar Clock
- How To Put An Invisible Softkey In The Status Bar
- How To Center The Clock In The Status Bar...Part 1
- How To Center The Clock In The Status Bar...Part 2
- Centering The Clock In Xperia KitKat
- android:layout_gravity, android:gravity AND android:layout_weight
- Do NOT Edit "public.xml"!!​I also encourage others to post guides as well:
- How To Remove "am/pm" From The Clock On Pre-4.2 Roms (by @KronicSkillz)
- How To Swap The Notification And Status Bar Icons (by @Anmol0022)
- How To Hide A Centered Status Bar Clock When A Lollipop Device Is Locked (by @S0bes)​
Click to expand...
Click to collapse
Use Linux or a Mac? See the following threads for more information on using apktool on other Operating Systems...
[WIN/LINUX][Decompile/Compile] Quick Mod Tool 4.0 [decompile and compile with speed]
APK Manager for Mac OS X
[Linux][UTILITY][TOOL] APK Multi-Tool
[tutorial] decompiling,recompiling and signing in linux (27-01-2013)
​
The following programs are some of the better programs you can use to automate Apktool for you...
@Diamondbacks - Virtuous Ten Studio
@Ticklefishs - Tickle My Android
@BDFreaks - Advanced ApkTool
@mDroidds - StudioAndroid # Automize everything!
...there are many others but these are a couple of what I've tried, still use or are popular on xda.
Quick Tip; Use VTS to edit certain xmls because it gives you a preview of any hex colour code and has a built in editor too which makes finding and changing colours a breeze.
And that's pretty much it, the only way you're really going to learn is by reading then putting into practice what you've read and picking stuff up along the way. I've posted a few links to different tutorials in the next post that you can use as a reference to theme your own phone, while the versions of Android change the methods and code are pretty consistent but you will have to adapt from time to time, but that's how you learn, refine your skills and become able to pass on your knowledge back to the xda community in the form of guides themes and mods.​
Notable credits and thanks to @iBotPeaches, @Brut.all, @jairomeo, @manup456, @armyranger251, @Stericson, @brandenk, @beagz
ClockworkMod Recovery:
ClockworkMod Recovery zips are used for flashing individual files to whole ROMS and can be a life saver if you push a badly edited apk to your Phone that results in a bootloop. There's also a few programs that can assist you with that too, but if all you're doing is replacing a few files all you really need is a template, then it's just a matter of creating the Phones folder setup in the zip which is simply creating folders: system\app - system\media\audio etc then dragging and dropping your files into it. A basic understanding of the updater script is essential, a ROM.zip will more than likely wipe your Phone whereas a Theme.zip may just replace files but it might delete some also.​
ERRORS encountered in CWM Recovery
[Tool]easy flasher v4 (ur own update.zip)
[Tool][Windows/Linux] Android Flashable Zip Creator
How to edit updater-script and make recovery flashable zips and updates
[TUTORIAL] Making Flashable ZIPs, EDIFY Script, ZIP Signing & Key Creation
[Utility-Tool][DEVandThemers]CWMflashpack.zipCreatorV1{TheCollective}w/EdifyScripting
In the Apktool_2.4.4.zip is my CWM_backup.zip which is set up so you can add your own files to the framework and apps folders in the main system location, but you can easily add other folders to it if you want to add things like fonts, tones or anything else, just remember to add folders within folders if that's where the files you want to include are such as tones, media\audio\alarms for example. When adding files to your zip add them using Normal as the Compression Method and remember to remove any example files I've added otherwise they will be flashed to your phone too.
Links:
The following liks are what I've bookmarked over the years and posted them here for you to use as a reference, some of these may not apply for your device directly but that doesn't mean you can't learn from or adapt them to.
Locating hidden values, random dialogs and hardcodes
Theme Apps To Dark Theme | Theme Whole System | Newbies Here!
Theming 3rd Party Apps
Interactive Phone Modification
Theme Debugger - Test your themes
Rom Porter / System Extractor
9-Patch-Resizer
Android Drawable Resizer Tool
HOW TO THEME SystemUI.apk for TOTALLY newbie!
How to theme Lollipop and Marshmallow ROMs!
Theming Lollipop w/ Picture References
How to theme TW SystemUI
Where to find the colors for making a theme
Create Your Own Themed apk & Become a Themer
Power menu light><dark
Rom Logo In Settings/About
Theming Settings Heavily
Integrating/Adding applications to the settings menu
Quick Panel with Lidroid Toggles & Volume Sliders
Add Quickpanel Button In Statusbar To Switch Layouts
Increase QuickSettings Maximum number
How to add 0.00k/s meter on statusbar ICS/JB
How to add/ Change Clocks to Analog/ Digital with Seconds
Centre clock and icon switch. Update: bottom power control widget!
Xposed:
Advantages:
No need to modify any APKs. This means:
No need to decompile, change things in smali, compile, sign, ...
It will work for odexed and deodexed ROMs.
Your mod is not bound to a specific version of the ROM. Unless there is a major change in the methods called for a certain functionality, your mod will continue to work even when you upgrade your ROM. Many modules work for a wide range of ROMs from different vendors.
Multiple mods can be installed at the same time, even if they modify the same app. So you can use these battery icons and those quick toggles. Even hooking the same method twice is possible. Of course, this only works properly if the mods are not trying to do incompatible things.
Click to expand...
Click to collapse
- Xposed
Porting XTheme themes
CM Theme to XThemeEngine Converter / Porter
Port CM Themes to Xtheme Engine in One Click!
List of APPs & MODs that use XPOSED Module
Xposed Framework/TabletUI (Noob-Friendly)
XThemeEngine beta5 - Theme engine for any rooted phone
ResXploit : Theming your android the easiest way! No decompiling APKs!
hello XperienceD,
first i want to say thank you, finally i can make some modifiaction of my rom, i am managed to get 3-wa-power on my stock rom, show full option in developer setting, change color and icon, etc (still far from my target though).
for now im trying to make my phone running holo dark themes (default is light), at first it looks fine, background change from light to dark, text black to white.
but now i found some color problem, can you help me locate color setting for this :
and for setting color, i want to change text color to holo_blue
for now, i am doing bruteforce, line per line, hope can fix this tonight, but if anyone know the where should i change the color setting, i am more than happy to accept it
thanks,
jacknb1ack
jacknb1ack said:
but now i found some color problem, can you help me locate color setting for this :
Click to expand...
Click to collapse
Check the links above "where to find colors" and "changing system text".
great, i think i've clicked all the link in ur post ... but looks like i've missde some link xD ...
thanks again.
jacknb1ack said:
great, i think i've clicked all the link in ur post ... but looks like i've missde some link xD
Click to expand...
Click to collapse
Did you find it in the end?
nice tutorial
XperienceD said:
Did you find it in the end?
Click to expand...
Click to collapse
yes .. thanks to you and all developers and themer here, i can finish my own customizing rom xD
and lately i've found that its need to resign all system apps to do better in what i want, and here is my last work xD
https://picasaweb.google.com/117267626749690688218/Halo2?authuser=0&feat=directlink
jacknb1ack said:
yes .. thanks to you and all developers and themer here, i can finish my own customizing rom xD
Click to expand...
Click to collapse
Nice 1.
jacknb1ack said:
https://picasaweb.google.com/117267626749690688218/Halo2?authuser=0&feat=directlink
Click to expand...
Click to collapse
Colourful.
Thread updated.
Awesome job on this man!
ssojyeti2 said:
Awesome job on this man!
Click to expand...
Click to collapse
Thank You, just trying to do my bit.
Can we get a linux version?
</end_troll>
thanks for the guide. really appreciated it. sharing knowledge is priceless.
im trying to re compile a APK which i have edited. but always it gives error. even if i de compile it and without touching anyting and try to re compile same result.
apk is a keyboard. i was trying to edit the layout. so is there any other way to do to modify 3rd party apks??
i do without any issue with systemui's framework etc
thanks again
EDIT - is that cos i have installed framework ????
Thank you for the post.
One thing that i have been trying to do is make a theme for "Floating Notifications" i was able to edit the apk and the xml files. everything works great on the phone and everything.
my issue is once if edited an app for theming how do i sign it so i can upload my theme to the playstore?
when i upload it to the dev console it says that my apk is not signed correctly or something like that.
can you please show me how to sign an apk after editing it for the playstore
thank you
That's exactly what i was looking for! Great post mate! Thank you!
Holy [email protected] dude this is monstrous! Thanks for your dedicated work!
Man I have seen tutorials but none as comprehensive as this. I mostly know all of whats here, but you have some invaluable links to all sorts of resources. This would have taken you a long time, I hope XDA members are appreciative!
Jarmezrocks said:
Holy [email protected] dude this is monstrous! Thanks for your dedicated work!
Man I have seen tutorials but none as comprehensive as this. I mostly know all of whats here, but you have some invaluable links to all sorts of resources. This would have taken you a long time, I hope XDA members are appreciative!
Click to expand...
Click to collapse
Thanks for your comments.
Sent from my C6603 using xda premium
Roladriz said:
Can we get a linux version?
Click to expand...
Click to collapse
These links should help...
XperienceD said:
Use Linux or a Mac?
See the following threads for more information on using apktool on other Operating Systems...
APK Manager for Mac OS X
[Linux][UTILITY][TOOL] APK Multi-Tool
[tutorial] decompiling,recompiling and signing in linux (27-01-2013)
How to install and use Apktool with Ubuntu
Click to expand...
Click to collapse
Dilesh Perera said:
EDIT - is that cos i have installed framework ????
Click to expand...
Click to collapse
I don't think it will be, it is either a protected apk or from a brand of Phone that isn't that common would be my guess, but you'd need to list the error logs?
amadovi43 said:
can you please show me how to sign an apk after editing it for the playstore
Click to expand...
Click to collapse
This is the only link I have bookmarked in regards to this - Noobs guide to signing an APK with a Private Key which is the one I used for my IceGreen theme.

[GUIDE] How to Remove the Lockscreen Wallpaper and Notification pulldown Dimming Tint

This is a guide for Android 8.1 and Android P for removing the tint on the lockscreen wallpaper. It has been tested on Pixel, Pixel 2, and Nexus 5X but I would imagine it would work on others as well.
Pull and decompile the SystemUIGoogle.apk, SystemUI.apk, or whatever your SystemUI is named.
Go to the res/values folder and open the bools.xlm with notepad++
Find the below lines of code (these are not all grouped together)
Code:
<bool name="config_showDividersWhenGroupNotificationExpanded">false</bool>
<bool name="config_showGroupNotificationBgWhenExpanded">false</bool>
<bool name="config_showNotificationExpandButtonAtEnd">false</bool>
<bool name="config_status_bar_scrim_behind_use_src">true</bool>
and change them to this:
Code:
<bool name="config_showDividersWhenGroupNotificationExpanded">true</bool>
<bool name="config_showGroupNotificationBgWhenExpanded">true</bool>
<bool name="config_showNotificationExpandButtonAtEnd">true</bool>
<bool name="config_status_bar_scrim_behind_use_src">false</bool>
Next, open super_status_bar.xml located in the res/layout folder.
Add this after each of these 3 codes:
android:background="#00000000"
1.
Code:
android:fitsSystemWindows="true"
2.
Code:
android:id="@id/backdrop_back"
3.
Code:
android:id="@id/status_bar_container"
After this code add android:visibility="invisible"
Code:
android:id="@id/scrim_behind"
Your code might not be exactly the same but find the line that contains android:id="@id/scrim_behind" and you should be good. Save your changes, recompile, and replace your SystemUI.apk with your newly modded one with whatever method works best for you.
I have not found any adverse effects from these changes.
Has anyone tried this on Android Pie?
Augustin79 said:
Has anyone tried this on Android Pie?
Click to expand...
Click to collapse
Yes it still does.
Is this possible to apply on aosp rom?
I tried to decompile the systemui.apk with framework_res.apk and edit it then recompile the apk.
But no luck, after reboot my phone, the phone shows the home page directly without lock screen, status bar. I can't open the status bar or back to my lock screen until I restore the systemui.apk.
Maybe, there is something wrong with decompiling and recompiling. I will try again.
This doesn't work for me.
If I sign SystemUI.apk with my own key, it can't acquire the right permissions (logcat says "this requires android.permission.INTERACT_ACROSS_USERS_FULL") and the keyguard is skipped (boots to home screen).
If I use the META-INF from the original apk, even with the original classes.dex, the phone bootloops and spams logcat with "android.content.res.Resources$NotFoundException: String resource ID #0x0".
Cebtenzzre said:
This doesn't work for me.
If I sign SystemUI.apk with my own key, it can't acquire the right permissions (logcat says "this requires android.permission.INTERACT_ACROSS_USERS_FULL") and the keyguard is skipped (boots to home screen).
If I use the META-INF from the original apk, even with the original classes.dex, the phone bootloops and spams logcat with "android.content.res.Resources$NotFoundException: String resource ID #0x0".
Click to expand...
Click to collapse
I was able to get these changes to work by making a Substratum theme for SystemUI. Ideally this wouldn't also apply to the notifications pulldown, but at least my lock screen finally looks good.
I got it working!
So, I have been trying to modify the value of SCRIM_BEHIND_ALPHA_KEYGUARD in SystemUI, which needs more than just a Substratum theme.
I discovered that with "apksigner verify --print-certs" you can get helpful information about the verification status of an APK.
That command told me that the APK built by apktool was missing some resources. So instead of using that, I made a copy of the original APK and replaced the classes.dex with the one that apktool built.
That at least made the MANIFEST.MF agree with the contents, but the signature did not verify because the APK had been modified.
So, I signed it with the platform key using "apksigner sign --key platform.pk8 --cert platform.x509.pem --v1-signer-name CERT". Then the signature verified, and it had the same certificate digests.
It seems as though my phone only accepts a privileged system app if apksigner cannot disinguish it from one that was officially built and shipped with the ROM, which is probably a good thing.
Now I know to be more careful about A) assuming that apktool works seamlessly, B) replacing the right files in an apk and leaving everything else alone, and C) verifying an APK before putting it on my phone.

Categories

Resources