[GUIDE | TUT | HACK] Remove Android 4.2.x safe volume message - Android Software/Hacking General [Developers Only]

Hey XDA community!
I received the Android 4.2.1 update for my Asus Transformer TF300T tablet and after using it for awhile i noticed when headphones are plugged into the device, and you increase the volume past (10 for my tablet) you will get a message saying that it is unsafe to use headphones at high volumes. Well I'm sorry. If people really need that message because they do not have the common sense to figure it out, well i have no comment.
{
"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"
}
So since this message is awfully annoying, i decided to go forth and remove it.
After hours of Google not helping, only finding other people on Nexus 7 devices and the like, seriously annoyed with it as i was. I knew i had to write this guide.
So here we go!
Firstly, there are two methods i discovered to remove this. First method, and prolly the easiest for people, is to:
1. Grab your framework-res.apk file from /system/framework/framework-res.apk using either adb or root explorer on your device
2. Using APKTool decompile framework-res.apk
3. Once decompiled directory.
4. Navigate to the file framework-res.apk/res/values/integers.xml YOU MUST USE NOTEPAD++ DO NOT USE MS NOTEPAD (Linux users need not worry)
5. Find the following "<integer name="config_safe_media_volume_index">10</integer>"
6. Change the "10" to a "20"
7. Save the changes to the xml file
8. Recompile the framework-res.apk with APKTool
9. Using adb or a flashable zip, put the framework-res.apk back to your device by:
adb remount
adb push <path to newly compiled apk> /system/framework/framework-res.apk
adb shell chmod 644 /system/framework/framework-res.apk
10. Reboot device and test
The second method is a little more tricky as it deals with smali code. Some people have no idea what smali code is but for those who do, this is the mod i personally use.
1. Grab your framework.jar file from /system/framework/framework.jar directory
2. Using either apktool, or baksmali, decompile framework.jar
3. Once decompiled, find the file framework.jar/smali/android/media/AudioService$AudioHandler.smali
4. YOU MUST USE NOTEPAD++ AGAIN! (Linux users again need not worry )
5. Once opened, find the following.
Code:
:pswitch_data_0
.packed-switch 0x0
:pswitch_0
:pswitch_2
:pswitch_3
:pswitch_5
:pswitch_6
:pswitch_7
:pswitch_9
:pswitch_a
:pswitch_8
:pswitch_b
:pswitch_c
:pswitch_f
:pswitch_d
:pswitch_e
:pswitch_1
:pswitch_4
:pswitch_12
:pswitch_13
:pswitch_14
:pswitch_15
:pswitch_b
:pswitch_10
:pswitch_11
:pswitch_16
:pswitch_17
:pswitch_18
:pswitch_19
:pswitch_19
.end packed-switch
6. at the bottom, you will see
Code:
:pswitch_19
(hoping this is the same for all devices) and comment out
Code:
:pswitch_19
(i have two i dont know why, if you also have two, comment both out)
Should look like this:
Code:
:pswitch_data_0
.packed-switch 0x0
:pswitch_0
:pswitch_2
:pswitch_3
:pswitch_5
:pswitch_6
:pswitch_7
:pswitch_9
:pswitch_a
:pswitch_8
:pswitch_b
:pswitch_c
:pswitch_f
:pswitch_d
:pswitch_e
:pswitch_1
:pswitch_4
:pswitch_12
:pswitch_13
:pswitch_14
:pswitch_15
:pswitch_b
:pswitch_10
:pswitch_11
:pswitch_16
:pswitch_17
:pswitch_18
# :pswitch_19
# :pswitch_19
.end packed-switch
7. Once edited, save the file.
8. Using APKTool or smali, recompile framework.jar
9. Using adb or a flashable zip, push the file back to your device
adb remount
adb push <path to newly compiled framework.jar file> /system/framework/framework.jar
adb shell chmod 644 /system/framework/framework.
adb reboot recovery
10. Once in recovery, wipe dalvik cache and cache.
11. Reboot and test
I have a zip attached for those who wish to use a zip.
Just OPEN the zip using 7zip, you will see two folders (META-INF, system) open system folder, open framework folder, and place your newly compiled file in there. Put the zip to your device, and flash in recovery.
ROM devs, feel free to use this! Just give credit Thanks
Guys dont hesitate to hit that thanks button! Can even donate to me as well Thanks everyone!

First method doesn't work
With the modified framework-res.apk per your instructions, the device hangs at the "X" animation. I push the original, everything works again.
This is how the process looks like:
>apktool d -f framework-res.apk tmp
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
Editing the xml file, extremely carefully with a hex editor, only changing the original value 7 to 20, then:
>apktool b tmp/ framework-res.apk
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
When it didn't boot I compared the original and rebuilt apk, I noticed that the META-INF directory was missing, so I copied it over, into the .apk. Still no luck, device hangs at boot.
Nexus 4 with 4.2.2 stock, rooted, CWM.

hello_world.c said:
With the modified framework-res.apk per your instructions, the device hangs at the "X" animation. I push the original, everything works again.
This is how the process looks like:
>apktool d -f framework-res.apk tmp
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
Editing the xml file, extremely carefully with a hex editor, only changing the original value 7 to 20, then:
>apktool b tmp/ framework-res.apk
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
When it didn't boot I compared the original and rebuilt apk, I noticed that the META-INF directory was missing, so I copied it over, into the .apk. Still no luck, device hangs at boot.
Nexus 4 with 4.2.2 stock, rooted, CWM.
Click to expand...
Click to collapse
I have this problem time to time. Its prolly a compressed resources.arsc file. Do this.
Take newly compiled apk.
Open with 7zip.
Copy the resources.arsc to desktop.
Open ORIGINAL (make a copy so you still have original) delete the resources.arsc file.
Go to your desktop.
Copy resources.arsc file to the ORIGINAL.
Then push to device. Should work.
Sent from my ASUS Transformer Pad TF300T using Tapatalk 2

Worked this way and the safe levels warning seems to be gone. Thanks!!!

Howdy - nice work on this
Any way you could share the smali code of what pswitch_19 points to? Might be handy for people trying to figure out what exactly it is that should be removed if things don't appear quite the same here so they comment out the appropriate switch. Thanks!

dwitherell said:
Howdy - nice work on this
Any way you could share the smali code of what pswitch_19 points to? Might be handy for people trying to figure out what exactly it is that should be removed if things don't appear quite the same here so they comment out the appropriate switch. Thanks!
Click to expand...
Click to collapse
pswitch_19 points to the method that stops the volume from increasing as well as displaying that message. Its an $access1234523 number so its prolly different in each jar file. If people have issues i will be able to help them
They just need to post here

elesbb said:
pswitch_19 points to the method that stops the volume from increasing as well as displaying that message. Its an $access1234523 number so its prolly different in each jar file. If people have issues i will be able to help them
They just need to post here
Click to expand...
Click to collapse
Gotcha - and no worries. Depending on what is used to decompile sometimes those access$### calls have a commented out bit right above them telling you what that static access function is doing/what is being called - but you are right people should just post if they need help. Thanks again for this

didnt work for me on my S4 with android 4.2.2

cabloomi said:
didnt work for me on my S4 with android 4.2.2
Click to expand...
Click to collapse
that is such a broad statement. if you want help youre gonna have to provide more info like which method you tried, is the ROM deodexed or odexed. etc etc
Sent from my ASUS Transformer Pad TF300T using Tapatalk 2

---------- Post added at 12:51 PM ---------- Previous post was at 12:49 PM ----------
[/COLOR]
elesbb said:
that is such a broad statement. if you want help youre gonna have to provide more info like which method you tried, is the ROM deodexed or odexed. etc etc
Sent from my ASUS Transformer Pad TF300T using Tapatalk 2
Click to expand...
Click to collapse
oh. so sorry. wasn't expecting a reply, im running deodexed and my files came up just like you said. i also had 2 "switch_19" and i put the # as you did
compile with no problem. replaced the the classes.dex files to the original one. so what now..
i still get that annoying message. do you think it in the android policy jar. becouse it can unlock the phone to show the notification
 @elesbb

cabloomi said:
---------- Post added at 12:51 PM ---------- Previous post was at 12:49 PM ----------
[/COLOR]
oh. so sorry. wasn't expecting a reply, im running deodexed and my files came up just like you said. i also had 2 "switch_19" and i put the # as you did
compile with no problem. replaced the the classes.dex files to the original one. so what now..
i still get that annoying message. do you think it in the android policy jar. becouse it can unlock the phone to show the notification
@elesbb
Click to expand...
Click to collapse
can you post the framework.jar please? And i always try to reply to my threads
Sent from my ASUS Transformer Pad TF300T using Tapatalk 2

ok here it is
http://d-h.st/Cbp
this is unedited just so you can do your magic from scratch @elesbb

cabloomi said:
ok here it is
http://d-h.st/Cbp
this is unedited just so you can do your magic from scratch @elesbb
Click to expand...
Click to collapse
Test this please? I dont have the S4 so i cannot try it.
Its flashable so just flash in recovery.

oh man. yeah that worked. your awesome. can you guide me through on how you did that. its perfect
@elesbb

cabloomi said:
oh man. yeah that worked. your awesome. can you guide me through on how you did that. its perfect
@elesbb
Click to expand...
Click to collapse
Follow my guide on the op. that's really all I did. Then I copied over the META-INF folder from the original jar file to retain signatures.
Sent from my SGH-T999 using Tapatalk 2

Hi Elesbb,
Thanks for this guide. Could you please tell me if flashing your .zip file would work on a stock unrooted ZTE grand x in?
If I have to root my phone first than that will be a little more work for me prior to even attempting your tutorials.
Thanks either way.
Sent from my Grand X In using Tapatalk 2

svetievboris said:
Hi Elesbb,
Thanks for this guide. Could you please tell me if flashing your .zip file would work on a stock unrooted ZTE grand x in?
If I have to root my phone first than that will be a little more work for me prior to even attempting your tutorials.
Thanks either way.
Sent from my Grand X In using Tapatalk 2
Click to expand...
Click to collapse
The zip in the OP has nothing in it. I posted it so after people follow my guide, they are able to download that zip, place their new file inside it, then flash.
But yes you have to be rooted. Or at least a custom recovery. Any Stock Recovery will reject the zip.
Sent from my ASUS Transformer Pad TF300T using Tapatalk 2

elesbb said:
The zip in the OP has nothing in it. I posted it so after people follow my guide, they are able to download that zip, place their new file inside it, then flash.
But yes you have to be rooted. Or at least a custom recovery. Any Stock Recovery will reject the zip.
Sent from my ASUS Transformer Pad TF300T using Tapatalk 2
Click to expand...
Click to collapse
Thanks for the clarification, I wouldn't have known the zip was empty. I'm still noobish when it comes to Android.
Sent from my Grand X In using Tapatalk 2

elesbb said:
Test this please? I dont have the S4 so i cannot try it.
Its flashable so just flash in recovery.
Click to expand...
Click to collapse
Didn't seem to work on my i9500
I'm also having issues turning my volume all the way up now, is there a way to reverse this flash?

mxpxboi said:
Didn't seem to work on my i9500
I'm also having issues turning my volume all the way up now, is there a way to reverse this flash?
Click to expand...
Click to collapse
Youre supposed to make a backup before you do anything. And it is working for whatever phone that guy had. I'd have to see your framework.jar file.
Sent from my ASUS Transformer Pad TF300T using Tapatalk 2

Related

[GUIDE] ICS Style 'Settings.apk' - Make it yourself !! !!

{
"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"
}
Hi all !! This is a guide on how to mod your Settings.apk to make it like an ICS's one !!
My sincere credits to iiandskater. He is the one who FIRST made MODS like this. I learnt these by comparing his MOD !!
He hasn't come up with a guide because he doesn't have time . (I think so!)
If you have completed modding and posting it ( on any website/forum), then please give credits and give a link to this thread !! This helps it reaching more people !! Thanks.
Pre-requisites:
-7zip
-Notepad++
This guide helps you to mod your settings' main screen only. If you want mod even other screens, then you need to read - why this/that step is done.
If you want to know 'Why is this/that step done?' , then read the post completely !!
I'll start from the basics.
Starting with basics:
1. Decompile your Settings.apk with 'apktool' (or) Apk Multi-tool (or) anything like that of your comfort !
Why is this/that step done?: It is done in order to decode .xml files the apk.
I decompiled with apktool.
2. Now navigate to Decompiled_Folder\res\values
3. There, open 'strings.xml' with notepad++
4. Go to the very end of the file, there above </resources>, add the following:
Code:
<string name="location_settings_title">Location service</string>
<string name="settings_ics_system">SYSTEM</string>
<string name="settings_ics_radio">WIRELESS & NETWORKS</string>
<string name="settings_radio_more">More...</string>
<string name="settings_ics_device">DEVICE</string>
<string name="settings_ics_personal">PERSONAL</string>
<string name="settings_ics_system_cap">SYSTEM</string>
<string name="power_usage_summary_text">Battery</string>
It should look like this:
Now save the file and close it.
Why is this/that step done?: This is for the 'text' that appear at different places. For example:
5. Now navigate to decompiled_folder\res\xml\
6. There open 'settings.xml' with notepad++
Any phone's user can follow upto this blindly, but from here you should do similar things for your phone.
HTC users, read this
7. Your 'settings.xml' will look like this (may not be exact)(this is my modded settings.xml - i'll explain what i have modded):
Now i have separated different 'things'/tags with an empty line between them, so that you won't get confused:
Here, i will explain every different 'things'/tags with only one example, other things, you yourself will have try because others will be similar to what i explain.
Preference screen:
From the above picture, i am taking only the circled (can't 'define' its radius lol ).
Now lets zoom it:
On reading it, you yourself can understand that:
---android:title="@string/wifi_quick_toggle_tittle" refers to a TEXT registered under the string name "wifi_quick_toggle_tittle" in the 'strings.xml'.
Now check in your 'strings.xml', which is located at res/values/, by searching for "wifi_quick_toggle_tittle". There you will find this line/line similar to this:
Code:
<string name="wifi_quick_toggle_title">Wi-Fi</string>
You can very well understand that the TEXT between the tags here(in strings.xml) will appear on the screen !!
---settings:icon="@drawable/ic_settings_wireless"> refers to the icon located at res/drawable-ldpi (or) res/drawable-xxxx(that of your phone).
You can leave other things as it is but except for android:targetClass="com.android.settings.wifi.WifiSettings". This is because according to this only, you are directed to another screen on selecting it !!
Here, i need to go to Wi-Fi settings on selecting it directly from the main screen. So i need to change it.
To change, i opened res/xml/wireless_settings.xml
There, like what we have seen earlier, many preference screens will be defined. There i found the preference screen of Wi-Fi settings
I copied the android:targetClass="xxxxxxxxxxxx"(something given there) to Settings.xml file.
If you want to do it for Bluetooth, then copy any of the preference screen completely [from <com.android.settings...... to </com.android.settings.IconPreferenceScreen>
Then make changes in the title , icon, and target classs.
Not yet over, last thing:
Adding custom categories like Device, Personal, System etc.
It is this line that makes it:
Place it anywhere above (or) in-between any two preference screens !!
Code:
<PreferenceCategory android:title="@string/settings_ics_radio" />
About icons, I'll tell after re-compiling.
8. Re-Compiling it:
After making all necessary changes and saving the 'xml' files, re-compile (or) build the apk. You should not get any error.
9. After building it, you'll find the new 'Settings.apk' in decompiled_folder/dist. Do NOT use it.
Now Go the folder where you have ORIGINAL/STOCK Settings.apk. Now simply extract it to any folder, say "settings-new", using 7zip.
8. Now go to decompiled_folder/build/apk
From there copy the 'resources.arsc' file and paste it in "Settings-new" folder. Replace it.
9. Now again, go to decompiled_folder/build/apk/res/xml. There copy 'settings.xml'
Paste it in Settings-new/res/xml folder. Replace if asked.
10. ICONS:
After downloading the icons.zip, you'll find the icons in 'drawable-ldpi' folder. Copy everything and paste it in Settings-new/res/drawable-xxxx (that of your phone). [If you do not know what is that 'xxxx' for your phone, then paste it in every 'drawable-ldpi/mdpi' folder]
Replace if asked.
11. Now come back and open "Settings-new" folder. You'll find 6 objects there, including folders. Now select them all --> "7zip" --> "Add to archive...". There, select 'Archive format as 'zip'and 'compression level' as 'Store' and then select 'ok'.
12.Now rename the newly formed 'xxxx.zip' file to 'xxxx.apk'.
Before copying to system/app rename it to Settings.apk instead some xxxx.apk !!
Now your apk is ready to be put in system/app !!
If you have completed everything and would like to distribute it, then download the 'Pre-scripted-update.zip' from attachments.
Open the archive with 7zip (no need to extract) go to system/app. Just drag and drop your modded 'Settings.apk'.
Thats all !! Close it and flash it via recovery !!
Thats all....i believe........still can refine it.......!
Icons-uploaded........!!
If you have completed modding and posting it ( on any website/forum), then please give credits and give a link to this thread !! This helps it reaching more people !! Thanks.
If you like this thread, the hit THANKS !!
thanks for this guide i'm searching from 5 days to but i can't find.
You're welcome !!
again good work bro....nice tut... u r going great man! cheers!!!!
Thank you :d
great guide and keep up the good work
Thanks everyone !!
nice, this is my first walk maybe if i want to be a dev
looking forward for the icons
Thanks it's a nice tut.
EDIT :::: saw what i did wrong XD
now working correctly
spacecaker said:
hmm
i get
C:\Users\robin\Downloads\ICS_Settings_Froyo_v1\system\app>cd\Users\RoBiN-b
ArRy\Music
C:\Users\robin\Music>apktool d C:\Users\robin\Music\Settings.apk
I: Baksmaling...
testI: Loading resource table...
W: Skipping "android" package group
I: Loaded.
I: Loading resource table from file: C:\Users\robin\apktool\framework\1.ap
k
I: Loaded.
I: Decoding file-resources...
I: Loading resource table from file: C:\Users\robin\apktool\framework\2.ap
k
I: Loaded.
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
C:\Users\robin\Music>apktool b C:\Users\robin\Music\Settings
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
C:\Users\robin\Music\Settings\res\values\styles.xml:59: error: Error retri
eving parent for item: No resource found that matches the given name '@android:s
tyle/Widget.TextView.ListSeparator'.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\ROBIN-~1\AppData\Local\Tem
p\APKTOOL6269797135419968898.tmp, -I, C:\Users\robin\apktool\framework\1.a
pk, -I, C:\Users\robin\apktool\framework\2.apk, -S, C:\Users\robin\M
usic\Settings\res, -M, C:\Users\robin\Music\Settings\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a: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:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\robin-~1\AppData\Local\Temp\APKTOOL6269797135419968898.tmp, -I, C:\Users\robin\apktool\framework\1.apk, -I, C:\Users\robin\apktool\framework\2.
apk, -S, C:\Users\robin\Music\Settings\res, -M, C:\Users\robin\Music
\Settings\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more
C:\Users\robin\Music>
its really annoying
ive tried to update
java
apktool
aapt
exe
can u help me ?
i will attache my framewok-res.apk
twframework-res.apk
and settings.apk
1.apk = framework-res.apk
2.apk = twframework-res.apk
settings.apk
thank you any ways
even for trying it
thank you
Click to expand...
Click to collapse
did you install your framework apk?
Perry977 said:
did you install your framework apk?
Click to expand...
Click to collapse
Yes ive installed everything
Ive got this prob most of the times with settings apk and camera
i am spacecaker
aint a grill
First, Try re-compiling it without any changes.............
Even when doing that, if you get that error, then you won't be able to compile it even after modding.....
so follow this:
Download my ICS Settings for FROYO (without unlock settings) from my signature.
Try decompiling and recompiling it (install both frameworks fr0m attachments). You should not get any error......
Now go to the folder where you've decomiled your settings.apk. There, after making necessary changes in the xml files(strings.xml & settings.xml) and saving them:
1. copy ALL files under res/values of YOUR decompiled settings folder and replace them in that of mine.
2. Similarly, now copy & replace settings.xml from your folder in mine.
Now compile MY settings folder.
You should not get any error.
After compilation, copy resources.arsc from build/apk of MY folder.
2. Extract (not decompile) YOUR stock settings.apk. Paste & replace resources.arsc there.
Like wise replace settings.xml from build/apk/res/xml of my folder.
Also place/replace icons like that.
Now make a zip of all the contents (in the folder where you EXTRACTED) as said in first post.
Now your apk is ready.....try n reply !!!
Brilliant.
Sent from my U8160 using xda premium
wow very helpful for me thanks
balamu96m said:
First, Try re-compiling it without any changes.............
Even when doing that, if you get that error, then you won't be able to compile it even after modding.....
so follow this:
Download my ICS Settings for FROYO (without unlock settings) from my signature.
Try decompiling and recompiling it (install both frameworks fr0m attachments). You should not get any error......
Now go to the folder where you've decomiled your settings.apk. There, after making necessary changes in the xml files(strings.xml & settings.xml) and saving them:
1. copy ALL files under res/values of YOUR decompiled settings folder and replace them in that of mine.
2. Similarly, now copy & replace settings.xml from your folder in mine.
Now compile MY settings folder.
You should not get any error.
After compilation, copy resources.arsc from build/apk of MY folder.
2. Extract (not decompile) YOUR stock settings.apk. Paste & replace resources.arsc there.
Like wise replace settings.xml from build/apk/res/xml of my folder.
Also place/replace icons like that.
Now make a zip of all the contents (in the folder where you EXTRACTED) as said in first post.
Now your apk is ready.....try n reply !!!
Click to expand...
Click to collapse
nope still not working
my pc is just **** -_-
ive updated apktool etc
ive downgraded it
etc
and still not working
( Galaxy ace + GB )
spacecaker said:
nope still not working
my pc is just **** -_-
ive updated apktool etc
ive downgraded it
etc
and still not working
( Galaxy ace + GB )
Click to expand...
Click to collapse
what is not working ??
even compiling my settings.apk doesn't work ??
balamu96m said:
what is not working ??
even compiling my settings.apk doesn't work ??
Click to expand...
Click to collapse
Yes
I think my pc is mad at me -_-
I can only decompile framework res apk and some other apps but those not
herpderp © aint got money to pay to my fish
spacecaker said:
Yes
I think my pc is mad at me -_-
I can only decompile framework res apk and some other apps but those not
herpderp © aint got money to pay to my fish
Click to expand...
Click to collapse
one thing that u can try is, download all apktool files again (.jar file, aapt and the script) and place it in a new location in the root of your windows drive (mostly C:\)......and also try deleting the folder apktool under C:\users\*username*\
balamu96m said:
one thing that u can try is, download all apktool files again (.jar file, aapt and the script) and place it in a new location in the root of your windows drive (mostly C:\)......and also try deleting the folder apktool under C:\users\*username*\
Click to expand...
Click to collapse
Did that
Ivetried to find solutions
But i think i need to buy better pc
herpderp © aint got money to pay to my fish

HOW TO Decompile/Recompile /edit smali ICS

I promised id make this so here it goes
Download Wanams Apk Manager
http://forum.xda-developers.com/showpost.php?p=23935070&postcount=14
and Win rar
A few notes..
when doing smali edits .. dont do them at the same time as xmls or pngs
Whe doing jar files and classes.dex i use
AutoAPKTool2.0.4
(or just smali baksmali in command
if enough people want this i will include it )
Lets Use a Deodexed ICS SystemUi.apk
Code:
[center]
-Place systemui.apk in place-apk-here-for-modding
-then run script.bat in apk manager root folder
-now select your project .. (option 22)
and then option 1 for systemui.apk
and hit enter
now press option 9 (decompile)
it should run a few lines then complete...
Now go into the folder titled projects and find your systemui folder
lets just use one file for example we will call it default_wallpaper.png
you would place this in res/drawable hdpi/default_wallpaper.png
replacing what is already there
now go back to the script and this time select option 11 (compile)
as long as you didnt mess up any .9pngs or include any extra unidentified pictures it will compile without errors ( if you encounter errors its something you did check the logs.txt)
so now the program will ask you is this a system file
say yes
next it will ask you if you want to make a copy of everything in a keep folder
to ensure everything works right.... now there are three options
If you edited pictures say yes
if you edited xml files say yes
if you edited smali files say no and skip to finalizing with win rar down below
so youve said yes bc you only made picture edits
sp now go into apkmanager folder called keep
and navigate back to res/drawable hdpi/default_wallpaper.png and delete it
and also:::::: only if you decided to edit any xml files.....
make sure you delete resources.src at this point
now go back to your script ... since it should say hit enter to continue..
hit enter
[/center]
FINALIZING THE FILE WITH WINRAR
Code:
Now navigate back to place apk here for modding
and find unsignedsystemui.apk
double click it and open it with winrar
extract the contents
now navigate to the newly extracted unsignedsystemui folder
highlight everything and right click
say add to archive
rename it SystemUI.apk
set it as a zip (but rename zip extension to apk)
and set it to store
hit ok and Voila You have a newly edited and resigned Apk file
[/center]
​
If You want to change Bat%Icon in status bar! This is how you can do it! Follow the guide step by step and you will be done within minutes!
http://forum.xda-developers.com/showthread.php?t=1434061
I didn't wanted to write so here I just got it from xda user so thnx to him.
For only .pngs!
Andrewtst said:
Changing/Replacing the .png file inside .apk
Amending normal .png no need to de-compile, just extract the file and modified using any photoshop tools or simply replace the .png
Just right click any .apk file and select 7-zip extract to, as seen below:
{
"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"
}
Now go to the extracted folder and amend / replace any .png file you like to replace. (Remember .9.png file cannot just simply replace, check following post for instruction.)
Click to expand...
Click to collapse
This is how to work with .9pngs!
Andrewtst said:
Modifying tricky .9.png file.
The .9.png cannot just simply amend using any photoshop and put back, because by doing so, either the amend .9.png won't appear or just simply give you FC in your phone when running it.
What to do:
De-compile the .apk.
Below showing the different between before and after de-compile of .9.png, as you can seen on right image,they is extra 4 black dot + 1 black bar and surrouding with transparent bar, all this area must be keep and not amend during photoshop. The de-compile image will auto increase 1 x pixel + 1 y Pixel.
Just amend without touching those area, save it and then put back to correct folder and compile back.
Click to expand...
Click to collapse
And This is how u can do XML!
Andrewtst said:
Modifying .xml file
After you have de-compile the .apk, now all inside .xml is readable where you can make some changes on the color selection, clock position and etc. by just simply open with notepad and modified.
Before de-compile, the .xml look like below which is not readable and understand by human.
After de-compile, now the .xml is readable and understand by human.
Now you can amend what ever you like, Google/Search XDA forum for which .XML to amend.
Use this color code checker site for getting your desire color code.
After done, don't forget, you must compile back the .xml before it is understandable by Android OS.
Screenshot below showing modifying the sub text .xml to ICS blue color.
Change all
Code:
from android:color="#ffffffff to [B]android:color="#ff3f9bbf[/B]
at zzz_tw_secondary_text_sub.xml
Click to expand...
Click to collapse
i will share anything ive learned
Also have a great setup here. With special tools for frame rrs and systemui
And this for editing colors.xml which makes life so much easier
Color edit tool can be found here http://forum.xda-developers.com/showthread.php?t=1348613
Its for editing colors.xml in decompiled framework-res
Dont have to enter hex. Just click and select color
And an fyi. U also need twframework-res installed to decompile Mms.apk properly.
And if u want to edit .9pngs u need photoshop or paint.net.
Zoom in 800 percent so u can see the 1 pixel border.
Do not touch the border pixels. Use rectangle select.
And cut whats inside the border.
Open new. Paste and do ur changes
Then merge the edited cut layer back inside the border.
Or look up how to use draw9patch. In the sdk tools. But its not nearly as simple.
You will also need notepad ++ to edit xml's and updater scripts. A simple text editor/notepad will corrupt them
Thanks a lot guys!
If you can't beat em, join em
Silver and Sean, thank you both :thumbup:
Sent from my SAMSUNG-SGH-I727 using Tapatalk 2
I can't decompile systemui....I can decompile framework and twframework but if in try to decompile systemui all I see is a smali folder. I've been trying to use apktool succesfully for three weeks now and no success. I have all the newest sdk items and Java etc.......I want to build custom rooms but its getting frustrating. I've uninstalled sdk and reinstalled everything and still no go. Don't know what I'm doing wrong....
Sent from my GT-P7510 using xda premium
i can decompile and compile systemui without errors i cant deodex it though and when changing a few png's and putting the new complied systemui on the phone i lose the notification bar
--------------------------------------------------------------------------
|Sun 04/22/2012 -- 21:11:35.44|
--------------------------------------------------------------------------
'mode' is not recognized as an internal or external command,
operable program or batch file.
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
Could Not Find C:\Users\sean boren\Desktop\ROMMING\Apk_Manager_ICS\place-apk-her
e-for-modding\../place-apk-here-for-modding/signedSystemUI.apk
Could Not Find C:\Users\sean boren\Desktop\ROMMING\Apk_Manager_ICS\place-apk-her
e-for-modding\../place-apk-here-for-modding/unsignedSystemUI.apk
I: Baksmaling...
Exception in thread "main" org.jf.dexlib.Util.ExceptionWithContext: Unknown opco
de: ff
at org.jf.dexlib.Util.ExceptionWithContext.withContext(ExceptionWithCont
ext.java:54)
at org.jf.dexlib.Code.InstructionIterator.IterateInstructions(Instructio
nIterator.java:87)
at org.jf.dexlib.CodeItem.readItem(CodeItem.java:157)
at org.jf.dexlib.Item.readFrom(Item.java:76)
at org.jf.dexlib.OffsettedSection.readItems(OffsettedSection.java:48)
at org.jf.dexlib.Section.readFrom(Section.java:143)
at org.jf.dexlib.DexFile.<init>(DexFile.java:431)
at org.jf.dexlib.DexFile.<init>(DexFile.java:267)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:44)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)
at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
Caused by: java.lang.RuntimeException: Unknown opcode: ff
at org.jf.dexlib.Code.InstructionIterator.IterateInstructions(Instructio
nIterator.java:51)
... 12 more
Error occured at code address 2184
code_item @0x3bf94
Press any key to continue . . .
or if i try just plain ol apktool...........
C:\Android>apktool if SystemUI.apk
I: Framework installed to: C:\Users\sean boren\apktool\framework\127.apk
C:\Android>apktool d SystemUI.apk
I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\sean boren\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
W: Cant find 9patch chunk in file: "drawable-hdpi/tw_btn_default_small_normal.9.
png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/tw_plmn_bg.9.png". Renaming it
to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/tw_quickpanel_title_background
.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/tw_btn_default_small_normal_di
sable.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/tw_status_bar_close_on.9.png".
Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/status_bar_close_on.9.png". Re
naming it to *.png.
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
C:\Android>
any help?
---------- Post added at 03:22 AM ---------- Previous post was at 03:14 AM ----------
and this is the recompile.......
C:\Android>apktool b SystemUI
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Android\SystemUI\res/drawable-sw600dp-hdpi
invalid resource directory name: C:\Android\SystemUI\res/layout-sw600dp
invalid resource directory name: C:\Android\SystemUI\res/layout-sw800dp
invalid resource directory name: C:\Android\SystemUI\res/values-sw600dp
invalid resource directory name: C:\Android\SystemUI\res/values-sw600dp-port
invalid resource directory name: C:\Android\SystemUI\res/values-sw720dp
invalid resource directory name: C:\Android\SystemUI\res/values-sw720dp-port
invalid resource directory name: C:\Android\SystemUI\res/values-sw800dp
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\SEANBO~1\AppData\Local\Tem
p\APKTOOL6504191100815924378.tmp, -I, C:\Users\sean boren\apktool\framework\1.ap
k, -S, C:\Android\SystemUI\res, -M, C:\Android\SystemUI\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a: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:\U
sers\SEANBO~1\AppData\Local\Temp\APKTOOL6504191100815924378.tmp, -I, C:\Users\se
an boren\apktool\framework\1.apk, -S, C:\Android\SystemUI\res, -M, C:\Android\Sy
stemUI\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more
C:\Android>
Those would be errors from .9pngs what were not edited properly on the decompile. And either same on recompile. Or xml errors.
Do u have the new aapt from the new sdk is also what i would make sure of .
---------- Post added at 01:46 AM ---------- Previous post was at 01:42 AM ----------
Also do apktool b -f SystemUI when u recompile
---------- Post added at 01:47 AM ---------- Previous post was at 01:46 AM ----------
And systemui/res\values doesnt look right
Systemui/res/values
Somethin funy going on with the /\ not a valid directory. / /
silver03wrx said:
Those would be errors from .9pngs what were not edited properly on the decompile. And either same on recompile. Or xml errors.
Do u have the new aapt from the new sdk is also what i would make sure of .
---------- Post added at 01:46 AM ---------- Previous post was at 01:42 AM ----------
Also do apktool b -f SystemUI when u recompile
---------- Post added at 01:47 AM ---------- Previous post was at 01:46 AM ----------
And systemui/res\values doesnt look right
Systemui/res/values
Somethin funy going on with the /\ not a valid directory. / /
Click to expand...
Click to collapse
I have all the updated stuff and tried wanam's . Like I said I completely uninstalled and reinstalled the sdk and apktool files.
I've tried apktool b SystemUI.API, apktool -f........., but it won't matter if I can't decompile correctly right?
All of this is from the ROM I'm using(appdroids) and I've also tried to do a stock from with the same results.
I've put everything in my C:\ directory like every tutorial I've watched or read said to do. That's why I can't understand what I'm doing wrong.
I also have Ubuntu dual booted on my computer and still can't get it to work.
I really wanna figure this stuff out because I would love to start a ROM of my own.
Sent from my GT-P7510 using xda premium
Gots team viewer?
silver03wrx said:
Those would be errors from .9pngs what were not edited properly on the decompile. And either same on recompile. Or xml errors.
Do u have the new aapt from the new sdk is also what i would make sure of .
---------- Post added at 01:46 AM ---------- Previous post was at 01:42 AM ----------
Also do apktool b -f SystemUI when u recompile
---------- Post added at 01:47 AM ---------- Previous post was at 01:46 AM ----------
And systemui/res\values doesnt look right
Systemui/res/values
Somethin funy going on with the /\ not a valid directory. / /
Click to expand...
Click to collapse
The funny \ in the dir name is from not putting the new aapt into autoapktool dir.... I was getting that on recompile
Sent from my SAMSUNG-SGH-I727 using Tapatalk
silver03wrx said:
Gots team viewer?
Click to expand...
Click to collapse
No but it won't be hard to get
Sent from my GT-P7510 using xda premium
silver03wrx said:
Those would be errors from .9pngs what were not edited properly on the decompile. And either same on recompile. Or xml errors.
Do u have the new aapt from the new sdk is also what i would make sure of .
---------- Post added at 01:46 AM ---------- Previous post was at 01:42 AM ----------
Also do apktool b -f SystemUI when u recompile
---------- Post added at 01:47 AM ---------- Previous post was at 01:46 AM ----------
And systemui/res\values doesnt look right
Systemui/res/values
Somethin funy going on with the /\ not a valid directory. / /
Click to expand...
Click to collapse
Thanks for this. I'm trying to learn. I'm stuck tho. I decompiled my framework-Res.apk I made changes and rran compile script.
Now I have a file called singedframework-Res.apk
Please tell me what to do next so its ready to go back into the phone.Thank You
Sent from my SAMSUNG-SGH-T989 using xda premium
Can anyone help?
Sent from my GT-P7510 using xda premium
slambkny said:
Thanks for this. I'm trying to learn. I'm stuck tho. I decompiled my framework-Res.apk I made changes and rran compile script.
Now I have a file called singedframework-Res.apk
Please tell me what to do next so its ready to go back into the phone.Thank You
Sent from my SAMSUNG-SGH-T989 using xda premium
Click to expand...
Click to collapse
pretty sure you don't want to sign system apks. If you're useing the Autoapktool sean posted here, then after you choose option 11 to compile, it will ask you if it is a system app. you say yes. It will ask if you about using other files you did not edit, you say yes. It will generate a folder called "keep." Go to the keep folder and delete every file you edited and leave everything else. If you made any xml edits, then delete resources.arsc too. Then go back to the prompt and hit enter. It will create an unsigned apk.
Now, I dunno if this is necessary if you made sure to set compression level to zero but sean recommended this and it's worked for me. You right click on the new unsigned apk, and extract it with 7zip. Go into the extracted directory. Highlight everything and right-click > Add to Archives. In the winrar window that comes up select zip, change compression method to "Store", remove the "unsigned" part of the file name and change the end of it from zip to apk. Done.
roughneckboren - I was having a similar issue when I was trying to decompile Systemui.apk's from the UCALC4 roms as well. I have no clue if this will help you, but what worked for me was saving the apktool.jar from the folder downloaded from Wanam to another name (I used apktool.jar.bak) and then copied the apktool.jar from apktool 1.4.2 and dropped it into the folder. At that point I was able to decompile the SystemUI.apk and modify it however I wanted. When finished, and before compiling, I just renamed the apktool.jar from 1.4.2 and named the original from Wanam back.
This only happened to me on UCALC4 roms and I haven't had a single issue with the UCLD2 roms that I have edited. Again, I have no clue if this is going to help you but it is what worked for me so I figured there is no harm in at least mentioning it...
Hope you get it figured out, or have already. Good luck! Also, thanks to Sean, Silver and the rest of everyone else here on the forums for getting this information out to everyone!
Hey im actually having this problem here using your manager.
--------------------------------------------------------------------------
|Thu 04/26/2012 -- 10:50:25.59|
--------------------------------------------------------------------------
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)
Could Not Find C:\Users\Toria\Documents\Arc\Apk_Manager_ICS\place-apk-here-for-modding\../place-apk-here-for-modding/signedSystemUI.apk
Could Not Find C:\Users\Toria\Documents\Arc\Apk_Manager_ICS\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedSystemUI.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Toria\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x010806fe
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x0108073e
I: Decoding values*/* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x010a010b
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:61)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:55)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:51)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferenceValue.java:59)
at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:46)
at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlValue(ResScalarValue.java:54)
at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(ResStyleValue.java:56)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:264)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
Im actually trying to edit an xperia arc arconium ics systemui.apk which is deoxed.
Hi,
i tried to follow the tutorial ( got an normal SII XD )
But the problem ist ...if i use apktool or apkmanager: I never get a smali folder.
I try to edit camera.apk (
Pls tell me what i'm doing wrong
Thank you

(Newbies) Cooking a Rom with a Kitchen

The purpose of this guide is to show users here in our Forum how to use the DSIXDA kitchen so that they may become familiar with cooking their own Roms and possibly becoming a valuable asset to our community down the road. So I hope to see this become useful for some of you willing to learn and well, to also not be lazy and expecting others to do the work for you - no pun intended lol.
Let's understand what a basic Rom contains:
- First and foremost, a Rom.zip will always have at minimum:
-- A boot.img at the root of the Rom.zip
-- A /system folder
-- A /META-INF folder
{
"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"
}
--- Now, I assume you already have done me the favor of installing the kitchen and so by therefore, saving me the trouble of having to explain the process of installation. It's simple. Moving along now.
--- Go ahead and get the kitchen up and running in your CMD Window. I will be using Ubuntu in reference to this guide but the same should also apply to those who prefer Windows/Cygwin.
As you see in your CMD Window there are some options with basic information as to what those options will do for you.
The first thing we need to do is set up our working folder which will be option number 1, but before we can do that we need a Rom to work with. There are many ways to getting your hands on a Rom. However, for the sake of this tutorial I will use a Nandroid Backup created by TWRP (Custom Recovery).
-- Please note that a TWRP system backup will require additional steps.
-- This is because the kitchen does not support its backup format.
--- Go ahead and make a copy of your boot and system backup and paste them in the original_update folder which can be found in the kitchen directory. From a 'TWRP backup' the boot.img will be originally named boot.emmc.win and the system.img will originally be named system.ext4.win. Go ahead and change them respectively to boot.img and system.img (It is that easy).
--- Now, create a folder and name it whatever you like, BUT the name MUST include WORKING_ at the beginning of its name.
-- An example: WORKING_k2cl_412_deodexed
--- Move the boot.img in to the created folder. Open up the working folder and create another sudirectory folder named system.
--- Go ahead and move the system.img in to the subdirectory folder named system located inside of your working folder.
--- Open up a new CMD Window and change directories to where the system.img is currently located at.
--- Go ahead and enter:
Code:
tar -xvf system.img
-- This will unpack the system backup made by TWRP
-- DSIXDA Kitchen does not currently support this format so YOU must do it.
--- As you can see, the system folder is now complete with all that you will need to start on your Rom. Go ahead, and remove the actual system.img file as it will not be needed now.
--- Go back to the CMD Window which has the kitchen up and running. Select option 1 to set up your working folder for the kitchen. It will give options to show supported formats or to abort. Go ahead and just press enter.
--- It will bring up a list of working materials to use for establishing your working folder for the kitchen. In my case, the working folder I will be using is option number 2, WORKING_k2cl_412_deodexed. Go ahead and select your option now.
--- It will ask you if you want to change the name of the new working folder. The option is yours. Choose yes or no (this part really doesn't matter).
--- Once you press enter it will create the new working folder which can be found at the root of the kitchen directory. It will be copying the contents over to the new working folder.
--- It will detect whether or not your rom has an updater script, symlinks, root, busybox, etc. If any of these are detected it will let you know it found them and it will adjust accordingly to them. Which saves you lots of time.
--- Now it will ask you if you would like to view the Rom's information. This is optional for you. If you want to see it then select yes, if not, then select no.
--- Congratulations! You have a Rom set up to be worked on! At this point you can choose to deodex your Rom, unpack and edit your boot.img, root your device both, /system and boot.img. Add additional tweaks, apply init.d support, etc.
--- Once you have finished playing with your Rom as a first timer, go ahead and back out to the main menu of the kitchen. Select number 99 to build your Rom from the working folder.
--- You will be asked to select a build option. Go ahead and select option number 1.
--- Select yes to zipalign your apk files
--- Next it will build your updater-script for your Rom based on an android device. It will ask you to review the updater-script before proceeding forward. You MUST insure the updater-script is ready for your device or it will not flash!
--- Go to the working folder of that rom and scroll the the subdirectories found in the META-INF folder until you see the updater-file. Open it up with notepad++ for Windows users or Gedit for linux users. You are going to look at the top and add the following (PLEASE INSURE YOU USE THE PROPER SYSTEM PARTITION FOR YOUR DEVICE - THIS EXAMPLE IS BASED ON MY K2_CL DEVICE!:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p35", "/system");
delete_recursive("/system");
package_extract_dir("system", "/system");
--- Now scroll to the bottom of the updater-script. You may see some crazy stuff about raw writing the boot.img. Go ahead and remove that mess and replace it with the following (PLEASE INSURE YOU USE THE PROPER BOOT PARTITION FOR YOUR DEVICE - THIS EXAMPLE IS BASED ON MY K2_CL DEVICE!:
Code:
package_extract_file("boot.img", "/dev/block/mmcblk0p20");
--- Once done, go ahead and save the updater-script file. Go back to the CMD window running the kitchen and select yes to keep the updater-script for the Rom.
--- It will create the update.zip, it will ask you to sign the Rom (say yes), then it will ask you if you wish to change its name or leave it as is (your choice).
--- Congratulations, now go ahead and flash your Rom to test it out. Be sure to Factory reset your device from within the custom recovery, and insure that the system partition is wiped also. After it is done flashing the rom, wipe the dalvik and cache before rebooting, and remember... Any problems without a logcat is trivial!!!
--- Happy Hunting!!
That's my pet lizard, Saucy. He keeps me company, haha.
Sent from my C525c using Tapatalk
Thanks man. This is exactly what I wanted to get me going. It's late for me but I'll definitely be checking this guide out tomorrow.
Good luck. I used a TWRP backup as an example because it requires extra steps. Any other time, like a system dump for example, the kitchen will detect it and be able to unpack the system.img for you automatically, but because of how TWRP formats the ext4 backups it must be done manually since the kitchen doesn't support it yet. Just some insight so you know that you don't always have to manually unpack the system.img.
Sent from my C525c using Tapatalk
If a normal system img aside from TWRP then all is required is naming them boot.img and system.img then placing both inside of the 'original_' folder then running the kitchen. Select option 1 and it should detect both. It will build the working folder, the subdirectory system folder, meta-inf folder, place the boot.img, and unpack the system.img automatically. For future reference.
Sent from my C525c using Tapatalk
also, for the "newbies" including me,
http://forum.xda-developers.com/showthread.php?t=2597220
[KITCHEN][FORK] Android Kitchen Continuation (WIP) [Linux / Mac / Windows]
here's a link to a more up to date kitchen, I haven't used it but it seems legit.
Haha, just took a look at it. Most of the added features I have already done for my personal use. Guess I can hit this guy up with some ideas. Thanks for that link @russellvone
Sent from my C525c using Tapatalk
Top priority is adding support for TWRP backups, and looking into implementing the ability to re-odex the Rom. It can be done, despite that the founder says otherwise.
Sent from my C525c using Tapatalk
Oh, and don't no one take offense to my title, "Newbies". Meant nothing insulting by it. Just used it regarding that maybe you are new to it. We all got to start somewhere.
Sent from my C525c using Tapatalk
If you ran through and deodexed, did you by chance get an error when it attempts to deodex HTCNotes?
Here's what I'm getting:
Code:
NOW AT FILE 1 OF 1 IN system/app: HtcNotes.odex
Disassembling HtcNotes.odex ...
java -Xmx512m -jar baksmali.jar -a 17 -d ../framework -x HtcNotes.odex
Error while disassembling method Lcom/htc/notes/detail/NotesDetailActivity$13;->handleMessage(Landroid/os/Message;)V. Continuing.
org.jf.dexlib.Code.Analysis.ValidationException: Could not resolve the method in class Lcom/htc/widget/HtcSeekBarPopupWindowListener; at index 75
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInvokeVirtualQuick(MethodAnalyzer.java:3655)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:1110)
at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:213)
at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:389)
at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:311)
at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:132)
at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:338)
at org.jf.baksmali.Adaptors.ClassDefinition.writeVirtualMethods(ClassDefinition.java:310)
at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:117)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:186)
at org.jf.baksmali.main.main(main.java:308)
opcode: invoke-virtual-quick/range
CodeAddress: 1478
Method: Lcom/htc/notes/detail/NotesDetailActivity$13;->handleMessage(Landroid/os/Message;)V
ERROR: Aborting HtcNotes.odex
Finished system/app
WARNING: Could not deodex the following (you can try to deodex these files again):
HtcNotes.odex
I've already tried again too
@palmtree5
Is your Rom 4.1.2 or 4.2.2?
Sent from my C525c using Tapatalk
Modding.MyMind said:
@palmtree5
Is your Rom 4.1.2 or 4.2.2?
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
4.1.2
@palmtree5
Thought so lol.
You are getting that error because you are using API 17 setting for a 4.1.2 Rom. 4.1.2 is built on 16. Change it to 16 and try it again.
Sent from my C525c using Tapatalk
Modding.MyMind said:
@palmtree5
Thought so lol.
You are getting that error because you are using API 17 setting for a 4.1.2 Rom. 4.1.2 is built on 16. Change it to 16 and try it again.
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
Now why didn't I think of that!
---------- Post added at 01:54 PM ---------- Previous post was at 01:33 PM ----------
palmtree5 said:
Now why didn't I think of that!
Click to expand...
Click to collapse
Ok, the deodexing worked out fine after that
@palmtree5
Just a heads up...
When you go to flash your deodex Rom, it will take forever to boot up for its first intial boot. Afterwards, it will boot up at normal timing. So when you flash it and it goes through the bootanimation then hangs on the HTC logo, be patient. Don't pull the battery lol.
Sent from my C525c using Tapatalk
Should take no more than 5 to 10 minutes at most given my personal experience.
Sent from my C525c using Tapatalk
Modding.MyMind said:
@palmtree5
Just a heads up...
When you go to flash your deodex Rom, it will take forever to boot up for its first intial boot. Afterwards, it will boot up at normal timing. So when you flash it and it goes through the bootanimation then hangs on the HTC logo, be patient. Don't pull the battery lol.
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
Yeah, fairly certain I've used deodexed roms before on other devices, just never deodexed one myself
palmtree5 said:
Yeah, fairly certain I've used deodexed roms before on other devices, just never deodexed one myself
Click to expand...
Click to collapse
Nice
Just making sure bro lol. Didn't want you coming back panicking under the assumption you may had not been aware.
Sent from my C525c using Tapatalk
Modding.MyMind said:
Nice
Just making sure bro lol. Didn't want you coming back panicking under the assumption you may had not been aware.
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
Right. Better to err on the side of caution
I'm bumping this thread because I am seeing A LOT OF PEOPLE ON HERE having troubles fixing their devices and for whatever the reason may be it seems to be with a LOT of these twrp backups people are grabbing from others because they either lost theirs or never made one from the get go (horrible decision).
So, if you are having troubles restoring with a backup then this guide should help you make up a quick Rom and get your device back.
You aren't looking to do anything fancy with the "kitchen" but to just build a quick odex or deodex Rom to flash and be up and running again.
Please take advantage of this if all else is failing for you.
IT IS NOT THAT HARD TO DO
--- Happy Hunting!!!
Sent from my C525c using Tapatalk

[Tool][Windows]CMX: Port CM11 Themes to X/HKTheme engine in one click

{
"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"
}
Thread Index:
Post 1 - Information. PLEASE READ!
Post 2 - Usage and porting info.
Post 3 - Features status. To request features use the tab at the top of the thread.
Post 4 - Ported themes and links.
Click to expand...
Click to collapse
When posting I only ask of 3 simple requirements.
1) Please search or read first. If the question has been asked/answered i will not reply.
2) Post any log extracts and pictures within the "hide" tags to keep the thread clutter free.
3) Do not quote posts in full. If you have to, use the hide tags
What is CMX?
This is a batch script that runs on Windows to port CM11 themes to work with XTheme/HKTheme engine.
Unless porting png's solely, this is designed to take most of the leg work out of porting themes across, so expect some errors when working with the xml's. It is difficult to encompass all the different CM11 themes and quirks they bring with them without downloading and testing each and every theme available.
Ive tried to make the script as unobtrusive and self sufficient as possible with minimal user input in automatic mode.
If you include xml's, some manual labour may be necessary depending on the theme so expect to get your hands dirty. From the themes I've tested with xml's included, 50% have ported straight through and 50% have failed and required some extra attention.
When the script runs through the asset configuring phase (png's/xml's) it will open up a window for each package folder one at a time. One folder must finish processing before the other begins.
Requirements:
Java development kit (jdk) -Link. Installed and in your environment path -Link
CM11 theme to port Take your pick.
The ability to solve apktool log errors. I will help, but I will not spoonfeed!!.
Time Taken:
Setting up 10 minutes (inc. Java install)
Porting (depending on theme)
png's only- 2 minutes.
Difficulty- 2/10. Common error- 9 patch faults.
inc. xml's- 5 minutes.
Difficulty- Dependant on theme. Common error- xml faults.
Basically my script will work as follows when ran and "Automatic" is selected:
Set up required folders.
Automatically detect the apk in "CMThemeIn" folder and set it as the project or prompt the user to insert an apk.
Decompile set theme.
Create all the redirection.xml's required.
Cycle through the
Code:
assetsoverlays*InsertPackageNameHere*resdrawable
folders, and move them to the corresponding folder in the XTheme folder.
Gather xmls from res "drawable" and values" and insert appropriate redirections for that package name.
Ask the user to input a package name in AndroidManifest.xml.
Ask the user to input a theme, app, author and original themer name in strings.xml.
Compile, sign, zipalign and then place the output in "XThemeFinished" folder" ready for installing.
Currently the ports are best served with AOSP but there is an option to add redirections for TouchWiz and Semc (JellyBean 4.2 framework-res.apk).
The script offers you the option to include xml's or not.
Depending on the android version you are using certain xml's may not work or cause conflicts resulting in SOD's, force closes and bootloops.
To recover from a bootloop read the FAQ below.
Currently I wont be porting boot animations and fonts. Although I may add an option to port boot animations etc to a flashable zip.
Finally, the ported themes will NEVER look like the CM counterpart due to the Xposed limitation of themeing "styles.xml". This is not a restriction of the CMX tool, theme .apk or the theme engine
To find out more about the structure and for a better understanding go here and read more:
http://forum.xda-developers.com/showthread.php?t=2334637
Click to expand...
Click to collapse
FAQ
Q). It says Java not found, how do I add the Java path?
A). Check "What is CMX?" for a guide.
Q). The script fails in auto, what's wrong?
A). Read the log.txt and assets,txt in tools and look for any errors, if you cannot understand them then post your log either as a .txt file or as a snippet wrapped in hide tags as shown above.
Q). Whats the difference between CM10 and CM11 themes?
A). All the drawable resources for CM11 themes now reside in "assetsoverlays" and not "resdrawables" as they previously did. Also they no longer use redirection xml's.
Due to this change, XTheme and HKTheme engines do not support CM11 themes...until now.
Q). Why doesn't the theme look like the CM11 counterpart?
A). This is due to styles.xml not being supported and xml restrictions if not included.
Q). I've got a bootloop, how can I fix it?
A). Go and follow the instructions here: http://tinyurl.com/nm4eups
Q). Why does it take longer when porting than it used to?
A). I have muted the opening of seperate windows. Each folder in the CM11Themeassets directory is processed one at a time to prevent errors. This must be done correctly or this will have detrimental effects to the xml's being created and
cause compiling errors.
Q). What are the duties of the folders?
A).
"tools": Contains all the resources needed to help porting.
"CMThemeIn": This is the folder you place your desired CM theme to be ported.
"CMThemeOut": When apktool decompiles the apk from "CMThemeIn", this is the source/reference for porting.
"XTheme": Contains the resources from "CMThemeOut" that have been configured and modified to be X/HKTheme compatible.
"XThemeFinished: This folder is used to store the newly created, X/HKTheme compatible apk.
Q). How do I remove "ON" and "OFF" from the switches?
A). See this post: Link.
Q). I get "invalid resource directory name" in the error log, how do I fix it?
A). Something has broken the script process and caused the creation of unnecessary folders. Goto "XThemeXThemeBase.apkres" and remove the folders detailed in the log.
Example: "XThemeXThemeBase.apkresdrawable-SomeRandomName" delete "SomeRandomName" folder
Click to expand...
Click to collapse
Credits:
@brut.all, @iBotPeaches and @JesusFreke for apktool and smali/baksmali respectively.
@nhnt11 for his xml generator.jar.
@existz and @xIC-MACIx for letting me test on their themes.
@rovo89, @ruqqq and @hdbk1986 for Xposed, Xtheme and HKTheme respectively.
@pierx for TouchWiz 4.2 framework-res redirections.
All the beta-testers.
Click to expand...
Click to collapse
XDA:DevDB Information
CMX, Tool/Utility for all devices (see above for details)
Contributors
dully79
Version Information
Status: Beta
Current Beta Version: v3
Beta Release Date: 2014-09-15
Created 2014-08-29
Last Updated 2014-09-27
Using the script and porting.
Instuctions:
Download the zip.
Downloads can be found in the "Download" tab above.
Or if your browsing via mobile you can use this mirror: CMX beta v3
Unzip the "CMX" folder to a directory containing no spaces or rename the folder.
Any spaces within the containing folder will result in the jar files not being able to run.
BAD= C:/Users/My name/desktop/CMX beta T1000
GOOD= C:/Users/My_name/desktop/CMX_beta_T1000
I've also included Jarsigner.exe in the download. Move it to your "Java\bin" folder if you do not have it installed, otherwise you can delete it.
Start ".RunMe.bat".
Your now presented with 2 main options with regards to porting.
Automatic.
Manual.
I've covered automatic above in "What is CMX" so i'll explain manual.
Basically all the options in the manual menu (other than options 0 and 1) are what the automatic mode cycles through in the same order. This can be useful if you receive any errors and want to carry on from where automatic failed.
The options are self explanatory but I'll give basic details:
Choose apk. Can be used to override the automatic built in selection. Useful if you have a number of apks in the "CMThemeIn" folder, although it is recommended to just keep one apk to prevent possible bugs.
Decompile apk. Decompiles the chosen apk for assets extraction.
Create main redirections.xml. Creates the main redirection xml containing all the package redirections.THIS MUST RUN BEFORE 4+5.
Configure CM11 xml's. Configures and ports CM11 xml's to work with X/HKTheme.
Configure CM11 png's.Create package (app) redirections.xml's and copies all the images to the appropriate folders in XThemeBase.apk inc. theme icon and wallpaper.
Set package and strings.xml name. Asks the user to declare the new package name in AndroidManifest.xml. Ideally use the same as the theme but with an "X" prefixing. e.g "com.mac.theme.gem" becomes "Xcom.mac.theme.gem". Also asks the user to to set the new app, theme, porter and original author name.
Compile. Compiles XThemeBase.apk into the ported theme apk.
Sign and zipalign. Signs and zipaligns the newly compiled apk ready for installation. The key used is market compatible generated by me.
Return to main menu. Returns to the initial screen.
When porting a theme try to name it so it is easy to differentiate from the original.
Example.
Original package and app name:
com.mac.theme.gem
Gem Flat
Ported with png's only:
X.com.mac.theme.gem
X Gem Flat
Ported with xml's:
X.com.mac.theme.gem.inc
X Gem Flat inc
How to port the custom launcher icons?
To use the new custom icon porter option, you will find it under option 2 (Manual) and 9. Two pre-requisites must be met:
You must have decompiled the apk in CMThemeIn prior to choosing this option.
Set the AndroidManifest name or strings. If you have not, or closed the tool since porting the main theme, you can define them using option 2 (Manual) and 6.
If the theme you are porting doesnt support a certain density, you can use this jar tool to create them:
https://github.com/redwarp/9-Patch-Resizer/releases
ONLY CREATE DENSITIES LOWER THAN THE INPUT!.
Porting themes? Then read this:
If you are going to port a theme and share it, you MUST obtain permission from it's creator/author.
Not only is this good community manners it is XDA forum rules.:highfive:
XDA Rules
12. Using the work of others.
If you are developing something that is based on the work of another Member, you MUST first seek their permission and you must give credit to the member whose work you used. If a dispute occurs about who developed / created a piece of work, first try to settle the matter by private message and NOT in open forum. If this fails, you may then contact a Moderator and provide clear evidence that the work was created by you.
Click to expand...
Click to collapse
Feature status and changelog
Feature status:
Auto porting of xml's- xml's need the correct redirection prefix adding to the resource direction inside the file. This can be done manually if required (NOT RECOMMENDED). Complete.
Redirections for OEM ROM's e.g. TouchWiz, Semc etc. Complete.
Porting of app themed icons- This is something i will add in to port to a separate apk. Complete.
Porting of boot animations, fonts, ringtones etc. Possibly to a flashable zip.
styles.xml- Broken inside Xposed.
Changelog:
29/08/14
First beta release.
31/08/14 beta v1.1
Lots of code cleaning and bug fixes inc. message suppressing.
The script now searches for installed framework-res.apk, if none is found it will install the provided apk automatically.
If you input a CMTheme.apk that isnt a true CM11 Theme (doesn't use assets\overlays) you will receive a warning in the console and the decompiled folder will be removed.
"tools" folder contains:
framework-res.apk from CM11 for Mako.
aapt from android sdk build tools 4.4#
My updated version of the XTheme sample.apk A.K.A XThemeBase.apk
15/09/14 beta v3
Added xml porting support.
Updated XThemeBase.apk to include drawable and xml folder.
Lot's of code cleaning and bug fixes.
Removed opening of multiple windows. This results in a longer but cleaner process.
Added Jarsigner.exe to download.
Some other stuff.
23/09/14 beta v4
Removed jarsigner.
Removed framework-res.apk to reduce zip size (added to CMX folder in post #4 if required).
Added framework-res.apk redirections (4.2 Jelly Bean) for Sony and Samsung (thanks @pierx) devices.
Added the ability to port custom icons and wallpaper.If supported by the ported theme to a standalone Apex/Nova theme.apk. Manual option 9.
Fixed bug where invalid resource directories where created in XTheme.
Cleaned and re-wrote some code inc. an extra log for xml and png porting. This can be found in tools\ called assets.txt
24/09/14 beta v4.1
Added custom AndroidManifest and strings.xml to icon.apk porter. Uses values defined for main theme port. Can be redefined by selecting option 2 (Manual) and 6.
Ported CM11 Themes
The themes are split into 2 categories:
Drawables port.
Full port.
The reason for being split is because devices on older android versions (<4.3) might bootloop if using a fully ported 4.4 theme with a conflicting xml.
To cancel any bootloops you can disable Xposed via the flashable zip provided in rovo's Xposed thread, or by using adb shell delete in recovery. See faq above.
Layout:
[Supoorted densities] Name of theme- Created by author
Original thread- Link
Density key:
H=hdpi. X=xhdpi. XX=xxhdpi
Drawables only themes:
[X~XXHDPI] Gem Flat free v2.6.1- Created by @xIC-MACIx
Original thread-http://tinyurl.com/o3ofx5h
---------------------------------------------------------------------------------------
[XXHDPI] Android L-Mint v1.7- Created by @existz
Original thread-http://tinyurl.com/p2ulk26
Full port themes:
[X~XXHDPI] Gem Flat free v2.6.1- Created by @xIC-MACIx
Original thread-http://tinyurl.com/o3ofx5h
---------------------------------------------------------------------------------------
[XXHDPI] Android L-Mint v1.7- Created by @existz
Original thread-http://tinyurl.com/p2ulk26
---------------------------------------------------------------------------------------
[XXHDPI] Flats free v4/6 @rayford85
Original thread-http://tinyurl.com/mxf5jgb BEWARE.There is a bug when opening settings !
PLEASE NOTE: These ports are intended as a preview to what the tool can do. I will not be maintaining them or fixing bugs.
Downloads:
Click the Icon or the link.
Everything CMX related inside.
http://tinyurl.com/lv7cpqx
If you want to post ported themes in this thread then feel free and i will link to your post from here.
Please obtain the authors permission to port and distribute.
Many thanks to the authors of the themes for allowing me to port them.
If you download their theme you should go to the link above and thank them.:good:
First!!!!!!!.. Is it possible to make this an app for android? That would be great
Juansegovia20 said:
First!!!!!!!.. Is it possible to make this an app for android? That would be great
Click to expand...
Click to collapse
You win a prize for premature jubilation.
It probably is possible. If the script was converted from batch to .sh to run on your device, you could package it into an apk... But I won't be doing it. Creating this took me long enough. Plus I don't have the skills.
Ideally there would be an update to X/HKTheme or a new module developed. In the mean time this is the next best option.
dully79 said:
You win a prize for premature jubilation.
It probably is possible. If the script was converted from batch to .sh to run on your device, you could package it into an apk... But I won't be doing it. Creating this took me long enough. Plus I don't have the skills.
Ideally there would be an update to X/HKTheme or a new module developed. In the mean time this is the next best option.
Click to expand...
Click to collapse
I was just asking about the app because some of us don't have the knowledge do do all of this... but thanks, i hope someone here will accept requests to port the themes
Juansegovia20 said:
I was just asking about the app because some of us don't have the knowledge do do all of this... but thanks, i hope sometime here will accept requests to port the themes
Click to expand...
Click to collapse
There is no knowledge required.
All you need is:
Java installed on your Windows system.
A CM11 theme of your choice placed in "CMThemeIn"
Run the script, select option 1 (Automatic) and follow the prompts (4 of).
Install the resulting signed file in "XThemeFinished".
It takes 2 minutes literally. Everything is automated to make it as noob friendly as possible.:good:
If you have Windows give it a try and you'll be surprised how easy it is.
dully79 said:
There is no knowledge required.
All you need is:
Java installed on your Windows system.
A CM11 theme of your choice placed in "CMThemeIn"
Run the script, select option 1 (Automatic) and follow the prompts (4 of).
Install the resulting signed file in "XThemeFinished".
It takes 2 minutes literally. Everything is automated to make it as noob friendly as possible.:good:
If you have Windows give it a try and you'll be surprised how easy it is.
Click to expand...
Click to collapse
Awesome, thanks, i tried yesterday but i was confused, with this new instruction things look way easier,lol, I'll report back if i successfully managed to port a theme, thank you Sir!!
dully79 said:
and follow the prompts (4 of)
Click to expand...
Click to collapse
can u please explain this ?
theme is loaded and recognized, then i select 1 for automatic, then ?
i cannot seem to get anything as a result in the XTheme folder
eurochild said:
can u please explain this ?
theme is loaded and recognized, then i select 1 for automatic, then ?
i cannot seem to get anything as a result in the XTheme folder
Click to expand...
Click to collapse
There are only 4 prompts contained in the automatic option
Set AndroidManifest.xml "package name".
Set strings.xml "app name".
Set strings.xml "theme name".
Set strings.xml "copyright name". This is the original author.
What does the log say?
dully79 said:
There are only 4 prompts contained in the automatic option
Set AndroidManifest.xml "package name".
Set strings.xml "app name".
Set strings.xml "theme name".
Set strings.xml "copyright name". This is the original author.
What does the log say?
Click to expand...
Click to collapse
i dont get these prompts when on automatic mode
log
--------------------------------------------------------------------------
|30-Aug-14 -- 16:33:48.84|
--------------------------------------------------------------------------
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) Client VM (build 24.65-b04, mixed mode, sharing)
Error: Unable to access jarfile C:\Users\admin\Desktop\CMX-
The system cannot find the path specified.
Error: Unable to access jarfile C:\Users\admin\Desktop\CMX-
Error: Unable to access jarfile C:\Users\admin\Desktop\CMX-
eurochild said:
i dont get these prompts when on automatic mode
log
--------------------------------------------------------------------------
|30-Aug-14 -- 16:33:48.84|
--------------------------------------------------------------------------
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) Client VM (build 24.65-b04, mixed mode, sharing)
Error: Unable to access jarfile C:\Users\admin\Desktop\CMX-
The system cannot find the path specified.
Error: Unable to access jarfile C:\Users\admin\Desktop\CMX-
Error: Unable to access jarfile C:\Users\admin\Desktop\CMX-
Click to expand...
Click to collapse
Its not accessing apktool in the "tools" folder.
Try removing the "-" from CMX- and try again.
Can u create an app to Port themes?
READ!
IVIanuu said:
Can u create an app to Port themes?
Click to expand...
Click to collapse
Seriously?!
The thread only has 11 posts and 2 of them are regarding your question.
Please read or search before posting.
http://forum.xda-developers.com/announcement.php?f=1507:
1. Search before posting.
Use one of our search functions before posting or creating a new thread. Whether you have a question or just something new to share, it's very likely that someone has already asked that question or shared that news.
Click to expand...
Click to collapse
Juansegovia20 said:
First!!!!!!!.. Is it possible to make this an app for android? That would be great
Click to expand...
Click to collapse
dully79 said:
You win a prize for premature jubilation.
It probably is possible. If the script was converted from batch to .sh to run on your device, you could package it into an apk... But I won't be doing it. Creating this took me long enough. Plus I don't have the skills.
Ideally there would be an update to X/HKTheme or a new module developed. In the mean time this is the next best option.
Click to expand...
Click to collapse
post #14 @dully79 i'm on my mission right now
Thanks
dully79 said:
Its not accessing apktool in the "tools" folder.
Try removing the "-" from CMX- and try again.
Click to expand...
Click to collapse
same issue here even after removing the "-"
Rename the folder from "CMX- Betav1" to "CMX", the space will be throwing it out.
Everything works great.
Nicely done
Regards
everything goes well up until signing, zipaligning and recompilation.
Log:
Code:
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Panna\apktool\framework\1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 15, -F, C:\Users\Panna\AppData\Local\Temp\APKTOOL5025674521367376442.tmp, -0, arsc, -I, C:\Users\Panna\apktool\framework\1.apk, -S, D:\dRO\CMX\XTheme\XThemeBase.apk\res, -M, D:\dRO\CMX\XTheme\XThemeBase.apk\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, 15, -F, C:\Users\Panna\AppData\Local\Temp\APKTOOL5025674521367376442.tmp, -0, arsc, -I, C:\Users\Panna\apktool\framework\1.apk, -S, D:\dRO\CMX\XTheme\XThemeBase.apk\res, -M, D:\dRO\CMX\XTheme\XThemeBase.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:357)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 15, -F, C:\Users\Panna\AppData\Local\Temp\APKTOOL5025674521367376442.tmp, -0, arsc, -I, C:\Users\Panna\apktool\framework\1.apk, -S, D:\dRO\CMX\XTheme\XThemeBase.apk\res, -M, D:\dRO\CMX\XTheme\XThemeBase.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:93)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:355)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at brut.util.OS.exec(OS.java:84)
... 7 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 11 more

[GUIDE] How to Build TencentOS for any Device [GUIDE]

{
"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"
}
TencentOS is an aftermarket firmware designed by the Chinese company Tencent. Tencent also created the QQ and WeChat IM services.​
TencentOS, just like MiUi is not open source. However, Tencent has provided a version of PatchRom for you to use called TOSPlus. I have tested this on the Samsung Galaxy Star Pro. The guide for the TencentOS PatchRom is different than the MiUi and LewaOS and it is written in Chinese only. I will be writing a guide in English so that more people can port this great ROM to their devices.
Pre Steps:
You should Install 2 versions of Java. Version 7, and Version 6.
For Ubuntu and derivatives, type:
Code:
sudo apt-get install openjdk-7-jdk
Now we need the official Java 6.
For Ubuntu and derivatives, type:
Code:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer
Be sure to select add when it asks if you want to add the repository or not.
Then, make sure you have all of the required android packages:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip
Note: the above is only for 64-bit. Will update when 32-bit is tested.
------------------------------------------------------------------------------------------------------
Step 1:
Make sure you are on a version of Ubuntu 14.04 or greater (16.04 may or may not work).
Step 2:
Now you need to make a copy of the TencentOS PatchRom. Change to whatever directory you want and Type:
Code:
git clone https://github.com/TOSPlus/TPS
This will make a folder called TPS in whatever directory you were in before. The TPS folder will contain all of the code required to build TencentOS for your device.
Step 3:
Change the directory to TPS and type:
Code:
source build/envsetup.sh
This will initiate the build process.
Step 4:
Next, you build the directory for your device. Type:
Code:
make create brand=put-manufacturer-name device=device-model
Replace "put-manufacturer-name" with your manufacturer and replace "device-model" with your device model.
Step 5:
Next you need to copy a zip file of a ROM you want to use as your base into your device model folder. Name the zip file to ota.zip. Make sure the base ROM is android 4.3 or above.
Step 6:
Now, you configure the build. Type:
Code:
make config device=device-model
Replace device-model with your device's model.
Step 7:
Once you have that done, you need to edit a few files. Those files are misc_info.txt, remove_files.list, tos_system_files.ignore, and build.prop. You can find all of the files underneath the config folder within your device-model folder.
In misc_info.txt, you need to change blocksize, boot_size, recovery_size, system_size, userdata_size, and cache_size to match your device. You can find these in the BoardConfig.mk of your device.
In remove_files.list, you add the files that need to be removed so that TencentOS can function fully. This usually takes quite a bit of trial and error to get correct.
In tos_system_files.ignore, you designate which files should not get edited when you are patching the different services.
In the build.prop, you need to add the TencentOS properties.
example (for the gt-i9500):
ro.qrom.beaconkey=0M000V5PH01B6QQD
ro.qrom.product.device=ja3g
ro.qrom.product.device.brand=samsung
ro.qrom.build.brand=tos
ro.qrom.build.os=android4.4.2
ro.qrom.otapath=/data/media/0
qrom_disposeIcon_enable=1
qrom_permission_enable=1
# ro.qrom.build.version.snflag=ADRQRTOS
ro.qrom.build.version.snver=01
#need edit ro.qrom.build.version.day=151028
ro.qrom.build.version.name=ADRQRTOS01_M
ro.qrom.build.version.number=01151028
ro.qrom.build.version.type=M
#need edit ro.qrom.build.number=3
ro.qrom.build.lc=A1B2C3000D4E5F6
ro.qrom.build.lcid=99
#need edit ro.qrom.build.date=Wed OCT 28 21:01:25 CST 2015
ro.qrom.build.date.utc=1446014851
ro.qrom.build.type=mod
Everything that says need edit, you need to edit for your device specifically.
Step 8:
Copy file_contexts from the boot.img and put in the config folder.
Step 9:
Copy recovery.fstab from the recovery.img of your device to the config folder
Step 10:
Next, you need to extract all of the files from the ota.zip and put them in the correct place. To do that, type:
Code:
make prepare
Step 11:
Now, you can patch your ota.zip. type:
Code:
make patch
If there are any failed patches, you have to patch those smali files manually.
Step 12:
After patching has been done, type:
Code:
make repack
It repacks the jars and frameworks required that TencentOS has edited.
Step 13:
You made it this is the final step. Type:
Code:
make package
It will create a zip file of TencentOS for your device model.
Then you can flash it in a custom recovery and enjoy your new ROM
Here is a video of how to do it: http://forum.xda-developers.com/showpost.php?p=67495578&postcount=75
===========================================================================================
Apps you should manually remove after building (not all may be in your ROM) :
SystemUI.apk
Trebuchet.apk
Dialer.apk
Mms.apk
Contacts.apk
Email.apk
DSPManager.apk
qotaupdater.apk (let's face it, our devices will never get an official update )
Apollo.apk
Launcher3.apk
SetupWizard.apk
VideoEditor.apk
Calculator.apk
Calendar.apk
CalendarProvider.apk
CMFileManager.apk
CMHome.apk
CMWallpapers.apk
DocumentsUI.apk
Gallery2.apk
DownloadProviderUI.apk
HoloSpiralWallpaper.apk
InCallUI.apk
LatinIME.apk (or qime.apk)
LiveWallpapers.apk
LiveWallpapersPicker.apk
LockClock.apk
MagicSmokeWallpapers.apk
PackageInstaller.apk
SoundRecorder.apk
Term.apk
VideoEditor.apk
CMAccount.apk
CMUpdater.apk
Contactsprovider.apk
VoiceDialer.apk
qtheme.apk
ThemeChooser.apk
ThemeProvider.apk
if you dont mind can you please share your device tree
!
manojkumar8552 said:
if you dont mind can you please share your device tree
!
Click to expand...
Click to collapse
You don't actually need a device tree or kernel tree for this, as long as you have a deodexed zip of the ROM you will use as your base, you can build TencentOS.
Here is my github anyways: https://github.com/Qiangong2
Can we port this rom for any device with above mentioned steps
Sent from my XT1022 using XDA-Developers mobile app
surajsj said:
Can we port this rom for any device with above mentioned steps
Sent from my XT1022 using XDA-Developers mobile app
Click to expand...
Click to collapse
Yes. It even works on Spreadtrum devices
Sent from my Q5 using XDA Free mobile app
Qiangong2 said:
Yes. It even works on Spreadtrum devices
Sent from my Q5 using XDA Free mobile app
Click to expand...
Click to collapse
What are spreadtrum devices. Won't u continue the rom for star pro
Sent from my XT1022 using XDA-Developers mobile app
surajsj said:
What are spreadtrum devices. Won't u continue the rom for star pro
Sent from my XT1022 using XDA-Developers mobile app
Click to expand...
Click to collapse
Spreadtrum devices refers to the processor. Spreadtrum devices use spreadtrum processors, Mediatek devices use Mediatek processors, and Qualcomm devices use Qualcomm processors. Spreadtrum devices are notorious for being hard to develop for as there is not as much information on them as on Qualcomm and Mediatek devices.
Sent from my Q5 using XDA Free mobile app
Ok
Sent from my XT1022 using XDA-Developers mobile app
Qiangong2 said:
Step 6:
Now, you configure the build. Type:
Code:
make config=device-model
Click to expand...
Click to collapse
make config device=device-model
manojkumar8552 said:
make config device=device-model
Click to expand...
Click to collapse
Yup you're right. Added it to original post.
Hello.
I want to ask about something.
Can we enable the navigation bar in build.prop,and is the system fully compatible with it?
Also,has it been tested on Lollipop?
The Marionette said:
Hello.
I want to ask about something.
Can we enable the navigation bar in build.prop,and is the system fully compatible with it?
Also,has it been tested on Lollipop?
Click to expand...
Click to collapse
The notification bar is built into qsystemui.apk. You need to remove the original systemui.apk that you had in the ota.zip after the packaging.
Sent from my Q5 using XDA Free mobile app
Hmmm, I got around 40 errors. Where are the "reject" files put after the command ends?
The errors look like this:
Code:
[ERROR]patching /home/the/roms/tencent/TPS/devices/tos/smali/framework2.jar/smali/com/android/internal/app/ChooserActivity.smali ... fail.
[ERROR] cannot find corresponding target smali file of com/android/internal/app/ChooserActivity.smali
The Marionette said:
Hmmm, I got around 40 errors. Where are the "reject" files put after the command ends?
The errors look like this:
Code:
[ERROR]patching /home/the/roms/tencent/TPS/devices/tos/smali/framework2.jar/smali/com/android/internal/app/ChooserActivity.smali ... fail.
[ERROR] cannot find corresponding target smali file of com/android/internal/app/ChooserActivity.smali
Click to expand...
Click to collapse
There is no reject file as far as I can find. I didn't honestly look too hard though. If you are on Lollipop, I haven't tried it on 5.0 or above. You have to go into the smali file that has an error and manually patch it. Also, I used CM11 as my base. You may need an aosp or cm based rom to be used as your base.
Sent from my Q5 using XDA Free mobile app
is this working for MTK device? tnx
Qiangong2 said:
There is no reject file as far as I can find. I didn't honestly look too hard though. If you are on Lollipop, I haven't tried it on 5.0 or above. You have to go into the smali file that has an error and manually patch it. Also, I used CM11 as my base. You may need an aosp or cm based rom to be used as your base.
Sent from my Q5 using XDA Free mobile app
Click to expand...
Click to collapse
I am using Cm12.1 as a base. And we have nothing older than CM12.1...
When I was using the FlymeOS Patchtool,if it had errors,it would distinctively show the conflicts in the troublesome files.
But Tencent Patchtool doesn't make a "reject" folder.
I tried searching for the files,and I would get two files found. I open them both in text editors,but there are no conflict lines in there.
Then I tried to just make the package,but it gave me an error mentioning those files which weren't edited.
UnKnoWn.XD said:
is this working for MTK device? tnx
Click to expand...
Click to collapse
It should
Sent from my Q5 using XDA Free mobile app
The Marionette said:
I am using Cm12.1 as a base. And we have nothing older than CM12.1...
When I was using the FlymeOS Patchtool,if it had errors,it would distinctively show the conflicts in the troublesome files.
But Tencent Patchtool doesn't make a "reject" folder.
I tried searching for the files,and I would get two files found. I open them both in text editors,but there are no conflict lines in there.
Then I tried to just make the package,but it gave me an error mentioning those files which weren't edited.
Click to expand...
Click to collapse
Okay. Were any successful at patching?
Sent from my Q5 using XDA Free mobile app
The Marionette said:
I am using Cm12.1 as a base. And we have nothing older than CM12.1...
When I was using the FlymeOS Patchtool,if it had errors,it would distinctively show the conflicts in the troublesome files.
But Tencent Patchtool doesn't make a "reject" folder.
I tried searching for the files,and I would get two files found. I open them both in text editors,but there are no conflict lines in there.
Then I tried to just make the package,but it gave me an error mentioning those files which weren't edited.
Click to expand...
Click to collapse
I think I figured out why it won't work. It won't work if you have the rom with .dat files. You need it open like on 4.4 and below.
Sent from my Q5 using XDA Free mobile app
Qiangong2 said:
I think I figured out why it won't work. It won't work if you have the rom with .dat files. You need it open like on 4.4 and below.
Click to expand...
Click to collapse
I made the zip open already,I am not THAT bad. xD
But I hope we are on the same page here. I made sure that my zip wasn't block based,but normal like 4.4 was(I could edit all things inside the zip instead of having one system.DAT image in the zip).

Categories

Resources