[JVP] Automatic brightness fix DIY - Galaxy S I9000 Android Development

I've made this thread to show you how to fix this frustrating bug. After few steps you'll get working light sensor better than in previous GB versions
Files need to be replaced or edited:
- services.jar
- framework-res.apk
- sensors.default.so
Recommended kernel:
- Galaxian*
Based on original Samsung sources
All Voodoo addictions (color fix, sound V9)
CPU frequencies: 100MHz, 200MHz, 400MHz, 800MHz, 1000MHz, 1200MHz, 1300MHz, 1400MHz.
CONFIG_HZ=500
CWM 3.0.0.5 based on, and fully compatible with CF-ROOT
Light sensor polling 1s instead of 2s
Compatible with RFS and EXT4
Much more I can't remember
What needs to be done:
framework-res.apk edit
1. Get apk manager (attached)
2. Put framework-res.apk in "place-apk-here-for-modding" folder
3. Run apk manager, decompile with dependancy (option 10)
4. Drag twframework-res.apk from your ROM into the script, or extract it somewhere and type path to it
5. Go into projects\framework-res\res\values\arrays.xml
6. Replace two sections:
<integer-array name="config_autoBrightnessLevels">
<item>30</item>
<item>300</item>
<item>600</item>
<item>1500</item>
<item>1500</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>80</item>
<item>150</item>
<item>200</item>
<item>255</item>
</integer-array>
Click to expand...
Click to collapse
7. Delete .bak file if you got one after changes
8. Go back to script and select compile
9. Say y
10. Say y
11. Delete resources.arsc from keep folder
12. Enter in script
13. U'll find unsignedframework-res.apk in "modding" folder
14. Use ADB
Code:
adb push unsignedframework-res.apk /data/local/tmp/framework-res.apk
adb shell
su
mount -o rw,remount /dev/block/stl9 /system
stop
rm /system/framework/framework-res.apk
cp /data/local/tmp/framework-res.apk /system/framework/
rm /data/local/tmp/framework-res.apk
reboot
services.jar replace/edit
Attached services.jar should be compatible with all JVP releases as long as author didn't modified it. If you are not sure you can always edit your own version by doing:
1. Get apk manager (attached)
2. Put services.jar in "place-apk-here-for-modding" folder
3. Rename it to services.apk
4. Run apk manager, decompile (option 9)
5. Go into projects\services.apk\smali\com\android\server\
6. Replace PowerManagerService.smali file with the one from my services.jar
7. Delete .bak file if you got one after changes
8. Go back to script and select compile
9. Say n
13. U'll find unsignedservices.apk in "modding" folder
14. Rename it to services.jar
14. Use ADB
Code:
adb push services.jar /data/local/tmp/
adb shell
su
mount -o rw,remount /dev/block/stl9 /system
stop
rm /system/framework/services.jar
cp /data/local/tmp/services.jar /system/framework/
rm /data/local/tmp/services.jar
reboot
sensors.default.so replace
1. Use ADB
Code:
adb push sensors.default.so /data/local/tmp/
adb shell
su
mount -o rw,remount /dev/block/stl9 /system
stop
rm /system/lib/hw/sensors.default.so
cp /data/local/tmp/sensors.default.so /system/lib/hw/
chmod 644 /system/lib/hw/sensors.default.so
rm /data/local/tmp/sensors.default.so
reboot
GALAXIAN KERNEL:
1. Go to the Market place
2. Install SGS kernel flasher
3. Extract zImage.7z to your internal SD card
4. Select zImage and flash
5. Be happy
New version of sensors.default.so! Now all 4 steps are working!
BTW. With those files you will now loose BLN!

Thank you very much in providing this fix.

Thks
This is what I have been waiting for....
I will recompile my services.jar n framework-res.apk and incorporate them into my custom rom.
Thank you so much!

i do not get it =) what is this fixing Oo

$omator said:
i do not get it =) what is this fixing Oo
Click to expand...
Click to collapse
It fixes the Auto brightness issue in some kernels.

i guess when auto brightness is checkedit is not reacting or reacting wrong?

Im guessing this only works on deodexed?

This is a fix of the moth !
THANK YOU SIR !
btw., what kernel is this? your own ?
Simce I can't find Galaxian anywhere on the forum.
Btw. where are the attached binaries from? Extract from original JVP kernel ?

$omator said:
i guess when auto brightness is checkedit is not reacting or reacting wrong?
Click to expand...
Click to collapse
In some kernels the brighness is reversed or totally wrong.
This has fixed it.

@ Brotuck
Will you try and include this in your GingerMod Rom? (...does it need it?)

eternal-intent said:
@ Brotuck
Will you try and include this in your GingerMod Rom? (...does it need it?)
Click to expand...
Click to collapse
I already updated my GM22 @ damians site.
It also uses a slightly different value, tested it today worked fine !

Brotuck said:
I already updated my GM22 @ damians site.
It also uses a slightly different value, tested it today worked fine !
Click to expand...
Click to collapse
Cool.
Well, I'm off to check it out...
And to the OP thanks, I'm interested to see what effect this has...it's not that I'm lazy, I just still lack confidence in my adb (dis)ability or I'd be more inclined to try and do it myself.

CWM can ask

ok now i see what is going on here =)
-provided sensors.default.so is 1:1 with stock JVP one
Click to expand...
Click to collapse
-arrays.xml is tweaked when compared to stock - and my guess OP made an error here as
<!-- Array of output values for LCD backlight corresponding to the LUX values
in the config_autoBrightnessLevels array. This array should have size one greater
than the size of the config_autoBrightnessLevels array.
-->
Click to expand...
Click to collapse
those are stock values from JVP below
<integer-array name="config_autoBrightnessLevels">
<item>30</item>
<item>2000</item>
<item>6000</item>
<item>11000</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>32</item>
<item>70</item>
<item>116</item>
<item>177</item>
<item>253</item>
</integer-array>
Click to expand...
Click to collapse
Click to expand...
Click to collapse
-at the services.jar few more tweeks that i do not see much sense in =)
i would realy like to see explanation of those changes
Click to expand...
Click to collapse

Ill look at this properly, but couldn't you put this in a CWM flashable package? Thanks if you can.
Sent from my ever changing Galaxy S

CWM flashable package, please

The biggest "problem" is that you need to change values in the framework.
And that one is connected to the theme you use.
Battery color / lockscreens stuff like that.
So making 1 general CWM is a problem....
If you encounter brightness problems, like not responding to changes or bright light in the dark (when it should be darker)
Then but only then consider this mod, if you do not know how to do it, then ask the theme maker.

ill rephrase my question =)
why those fixes (left stock, right this fix/tweak)
ALL_BRIGHT from 15 to 255
ANIM_STEPS from 10 to 50
AUTOBRIGHTNESS_ANIM_STEPS from 10 to 50
LIGHT_SENSOR_DELAY from 2000 to 1000

@$omator: it`s working! i think this is the only relevant answer!
you know a better way? then do it and start your own thread!

I'd like to try this fix but I can't because each time >compile< gets me an error in APK Manager! Something like "unknown source" and "could not exec command". Does anyone here have any success with this fix and Bezke JVP-ROM?

Related

Rapid Theme Creation/Porting in Linux

First let me say thank you to:
mattahan for his artwork/icons.
dthadamaja for his buuf theme.
Cyanogen for his ROM.
Jesus Freke for his ROM.
Stericson for his guide to theme making.
Now let me warn you:
Please back up your phone before you do any updates on it. I am not responsible if you ruin your phone. I am not responsible if you destroy your computer. I am not a responsible person in general. The scripts provided are pretty simple and straightforward with no malicious design but some of them are designed to delete files and if you use it incorrectly it could delete files that you did not want to delete. And this would be terrible.
Why:
So, I wanted to get the totally bad-ass Buuf theme on 1.5r2 but ports were hard to come by. It was also IMO a nightmare to do all this crap on Linux so I set up what I believe is a nice environment/system for doing this rapidly and effectively.
Requirements:
- the shell scripts I've attached to this post
- 7zip (Ubuntu: sudo apt-get install p7zip-full)
- Java
OPTIONAL - the Android 1.5r2 SDK: http://developer.android.com/sdk/download.html?v=android-sdk-linux_x86-1.5_r2.zip
OPTIONAL - compiled signapk.jar from mydroid
OPTIONAL - testkeys from mydroid
------------
I included the last two files but if you want you can get them yourself by:
go to: http://developer.android.com/sdk/1.5_r2/installing.html and follow the Installing the SDK notes and the Ubuntu Linux Notes (or other if you do it like that).
go to: http://source.android.com/download and follow the instructions for getting the Android source. once you have it go to your mydroid directory and run: make signapk
copy mydroid/build/target/product/security/testkey.pk8 to the directory you extracted my files to
copy mydroid/build/target/product/security/testkey.x509.pem to the directory you extracted my files to
------------
Setting up the environment:
- Extract the file attached to this post to somewhere, and add that folder to your path.
e.g. if you were in ~ and you did tar xvzf theme_maker.zip you'd end up with ~/theme_maker
edit your .bashrc file and add this to your PATH, it should look like:
export PATH=$PATH:~/theme_maker
- Edit signapk, there are 3 variables at the top:
TESTKEY1=
TESTKEY2=
SIGNAPKJAR=
These should be the full path to your testkeys and JAR file. I left mine in as examples.
Now your that environment is set up, let's do this.
How to Use:
First you are going to need a template for your ROM. I am a noob but as far as I can tell most people are distributing a theme template with their ROMs. This template contains a bunch of APKs with their res/drawable directories and such.
Extract this template to theme_dest. This tree/extraction is going to be your where your theme ends up.
If you are modifying the theme extract the template again to theme_src, this will be where you source your files from.
If you are porting a theme extract the old version of the theme to theme_src. This will be your source directory for your theme.
Now you will want to clean out any non-image files so that you don't overwrite some changed XML file or what-have-you. To do this run:
Code:
clean_template theme_src
This will extract all APKs into the full tree, and then delete all non-png/jpg/gif (please let me know if Android uses others) files from the directory tree. Please be careful when doing this.
If you are modifying the theme, now you will want to modify/replace files in the theme source directory.
Now assuming your directory structures are exactly the same, you can do:
Code:
update_apks theme_src theme_dest
This will only work if you have a structure like:
./theme_src/system/app/
./theme_src/framework/
./theme_dest/system/app
./theme_dest/framework
A theme I extracted came out like:
./theme_src/system/app/
./theme_src/framework/
./theme_dest/app
./theme_dest/framework
update_apks won't break anything if the directory tree styles don't match, but it won't update the icons in the mismatched trees. To get around this, in the example above you'd do:
Code:
update_apks theme_src/system/app theme_dest/app
update_apks theme_src/framework theme_dest/framework
Now that you have updated your APKs with the new files from theme_src you will want to resign the APKs and create an update.zip for your theme.
To do this run
Code:
sign_apks theme_dest
This will recursively sign all APKs and zips in the tree.
Now run
Code:
create_update theme_dest
This will create an update.zip from the tree below and sign it.
Now copy the update.zip and load as normal.
I hope this is useful to anyone trying to streamline their theme making, I will try to update it as improvements become apparent to me. If you have any questions or ways to improve the scripts please let me know.
Thanks,
Paulo
EXAMPLE USAGE:
This is a step-by-step walkthrough of how I got the BUUF theme onto CM 3.4.4:
[email protected]:~/tmp-workspace$ ls
BUUFbrownfinal.zip template-cm-3.4-signed.zip
[email protected]:~/tmp-workspace$ mkdir theme_src theme_dest
[email protected]:~/tmp-workspace$ ls
BUUFbrownfinal.zip template-cm-3.4-signed.zip theme_dest theme_src
[email protected]:~/tmp-workspace$ cd theme_src
[email protected]:~/tmp-workspace/theme_src$ unzip ../BUUFbrownfinal.zip
Archive: ../BUUFbrownfinal.zip
inflating: yada yada yada
[email protected]:~/tmp-workspace/theme_src$ cd ..
[email protected]:~/tmp-workspace$ cd theme_dest
[email protected]:~/tmp-workspace/theme_dest$ unzip ../template-cm-3.4-signed.zip
Archive: ../template-cm-3.4-signed.zip
inflating: blah blah blah
[email protected]:~/tmp-workspace/theme_dest$ cd ..
[email protected]:~/tmp-workspace$ clean_template theme_src
Extracting APKs
blah blah blah
Deleting non-image files
blah blah blah
Deleting empty directories.
Done!
[email protected]:~/tmp-workspace$ update_apks theme_src theme_dest
updating framework-res.apk
updates not found for packages: AlarmClock.apk Browser.apk BugReport.apk Calculator.apk Calendar.apk CalendarProvider.apk Camera.apk checkin.apk Clicker.apk com.amazon.mp3.apk com.android.term.apk Contacts.apk ... MediaProvider.apk MediaUploader.apk Mms.apk Music.apk NetworkLocation.apk PackageInstaller.apk PDFViewer.apk Phone.apk QxdmLog.apk Settings.apk SettingsProvider.apk SetupWizard.apk SoundRecorder.apk SpareParts.apk Street.apk Superuser.apk SystemUpdater.apk Talk.apk TelephonyProvider.apk TmoImPlugin.apk UserDictionaryProvider.apk Vending.apk VoiceDialer.apk VoiceSearch.apk YouTube.apk
--- Here we notice a large # of APKs did not update. It's possible that the directories do not line up in this case. As we see below they don't but we can work around this.
[email protected]:~/tmp-workspace$ ls theme_src
framework system
[email protected]:~/tmp-workspace$ ls theme_dest
app framework META-INF
--- The app directory in theme_src is under system, whereas it is directly in theme_dest, so we do:
[email protected]:~/tmp-workspace$ update_apks theme_src/system theme_dest
updating AlarmClock.apk
updating everything else..
updates not found for packages: framework-res.apk ... NetworkLocation.apk PDFViewer.apk QxdmLog.apk SpareParts.apk UserDictionaryProvider.apk
--- More packages that did not update, some of these were just not included in the Buuf theme (e.g. PDFViewer) whereas others were renamed across versions (e.g. Maps became GoogleMaps.
--- In the latter case you could rename theme_src/system/app/Maps to theme_src/system/app/GoogleMaps to update correctly.
[email protected]:~/tmp-workspace$ sign_apks theme_dest
signing framework-res.apk
signing all that other stuff..
[email protected]:~/tmp-workspace$ create_update theme_dest
creating update.zip
signing update.zip
done.
[email protected]:~/tmp-workspace$
You would now have a signed file theme_dest/update.zip with your theme applied to the template provided. At this point you can apply the theme to your mobile and see how it came out. In my case I noticed the GoogleTalk icon did not update and the IM icon was not the one I wanted, so I did this:
[email protected]:~/tmp-workspace$ mkdir theme_test
[email protected]:~/tmp-workspace$ cd theme_test
[email protected]:~/tmp-workspace/theme_test$ unzip ../template-cm-3.4-signed.zip
[email protected]:~/tmp-workspace/theme_test$ cd ..
[email protected]:~/tmp-workspace$ ls
BUUFbrownfinal.zip template-cm-3.4-signed.zip theme_dest theme_src theme_test
[email protected]:~/tmp-workspace$ clean_template theme_test
Now I have a directory theme_test with the fully extracted template, I can go browse the drawable directories in there and see what file names have changed or what file locations are different. For example one of the icons that used to be provided by IM was now provided by ImProvider, so I modified the theme_src files to match the template & updated my APKs again.
Sweet Script
Gonna try it!
I forgot to include the signing stuff in the original post, here it is.
You are a saving grace!
I'm on Xubuntu 9.04 and have been rolling around the idea of compiling a theme for the last week or so. This will make everything SO much easier. Thank you!
Will try later this week and get back to you with the results.
Rock on dude! This is exactly what I was looking for...and coincidentally you ported the same theme I'm interested in. I hate to sound like a lazy mooch, but think maybe you could post your update.zip? That is if it would work for JF 1.51.
4hed517 said:
Rock on dude! This is exactly what I was looking for...and coincidentally you ported the same theme I'm interested in. I hate to sound like a lazy mooch, but think maybe you could post your update.zip? That is if it would work for JF 1.51.
Click to expand...
Click to collapse
+1
Me to a bit lazy today
legend, I am off school now, so I am going to try and implement this. Thanks
I appreciate this... I hate booting into windows just to create/sign apk/themes/zip. this makes it easy have tested parts of it not an entire theme yet. Awesome work
Huge amount of work on your part, I'd like to maybe give this a go once I get a new template to work on...
error
I keep getting this when I try to do the apply sdcard : update.zip
"veryfing update package...
E:Wrong digest:
framework/framework-res.apk
E:Verification failed
Installation aborted."
kyleds said:
I keep getting this when I try to do the apply sdcard : update.zip
"veryfing update package...
E:Wrong digest:
framework/framework-res.apk
E:Verification failed
Installation aborted."
Click to expand...
Click to collapse
You aren't signing. Something isn't happening correctly for you.
What type of environment are you attempting to make your signing in?
4hed517 said:
Rock on dude! This is exactly what I was looking for...and coincidentally you ported the same theme I'm interested in. I hate to sound like a lazy mooch, but think maybe you could post your update.zip? That is if it would work for JF 1.51.
Click to expand...
Click to collapse
Hey, is there a JF 1.51 theme template? If there is I can make the update.zip but if not I would recommend to create it yourself. If there isn't a template the update.zip will contain the theme (icons, etc) and also all the applications.
In theory I believe someone could create a update.zip with malicious applications in addition to a theme you wanted, and you'd be installing their malicious apps over yours when you installed the theme.
Sorry I haven't kept up with this thread recently, I will keep checking it but if anyone needs anything urgently or finds an issue with the scripts please feel free to PM me & I will respond more quickly.
ported dthadamaja's Buuf 1.5 to CyanogenMod 4.0.1:
NOTE: this is a blind port (i.e. didn't fix any mixups)
I had template-cm-4.0.1-signed.zip and buuf3910.zip one directory below the workspace.
$ mkdir buuf-cm buuf-src buuf-src2
$ cd buuf-cm
$ unzip ../../template-cm-4.0.1-signed.zip
$ cd ..
$ cd buuf-src
$ unzip ../../template-cm-4.0.1-signed.zip
$ cd ..
$ cd buuf-src2
$ unzip ../../buuf3910.zip
$ cd ..
$ clean_template buuf-src
$ clean_template buuf-src2
$ cp -R buuf-src2/* buuf-src
$ update_apks buuf-src buuf-cm
$ sign_apks buuf-cm
$ create_update buuf-cm
You can get the update.zip I made here or redo this on your own machine:
http://rapidshare.com/files/268789905/update.zip
Thanks again to dthadamaja for his great theme and Cyanogen for his great mod!

[Q]auto brightness tweak

anyone knows "guide or how to" make auto brightness tweak?
kuklux said:
anyone knows "guide or how to" make auto brightness tweak?
Click to expand...
Click to collapse
if you're using Android Revolution HD, u might also consider this.
http://forum.xda-developers.com/showthread.php?t=947680
the mod including the auto brightness tweak
The concerned (system) app is : /system/framework/framework-res.apk
If you want to build your own custom change, you will have to use sdk+apktool to unbuild it, then edit framework-res/res/values/arrays.xml to change config_autoBrightnessLcdBacklightValues values. It seems that config_autoBrightnessLcdBacklightValuesUp and config_autoBrightnessLcdBacklightValuesDown are always set with the same values as config_autoBrightnessLcdBacklightValues.
The first value is used when the sensor value is under the first level value in config_autoBrightnessLevels, the 2nd when between 1st and 2nd level, 3rd between 2nd and 3rd level, etc.
Once changed, rebuild the apk using apktool, then do a zipalign -v -f 4 on the new apk.
To install, replace the original file in /system/framework/framework-res.apk (keep a copy of the original !!!), then do a wipe dalvik-cache (->long 1st reboot).
It is possible that it need to overwrite the file in recovery mode, so a simple way to install it is to take the zip from a mod which just replace that app (perhaps http://forum.xda-developers.com/showthread.php?t=947680 or http://forum.xda-developers.com/showthread.php?t=894837) and replace the apk in the zip with yours, so you can do a classic mod install (don't forget the dalvik wipe anyway).
You can keep the original levels which are logical for the real values returned by the DHD light sensor.
I am not sure if a will keep them as is, but actually i use these ones :
Code:
<integer-array name="config_autoBrightnessLevels">
<item>11</item>
<item>41</item>
<item>91</item>
<item>161</item>
<item>226</item>
<item>321</item>
<item>641</item>
<item>1281</item>
<item>2601</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>38</item>
<item>78</item>
<item>105</item>
<item>130</item>
<item>152</item>
<item>168</item>
<item>185</item>
<item>205</item>
<item>230</item>
<item>255</item>
</integer-array>
PS: if those explanations are not sufficient for you, then you should forget idea to build your own version, and use one of the existing mods as is...

[HOW TO][Windows]Extract Deodex Sign and Zipalign an official ROM

Hi,
Just want to share tools I found in order to :
- Extract SGS2 stock firmwares :
* Use sgs2toext4.jar Application from drphrozen to convert .img files to ext4.img
* Then MOUNT ans EXTRACT ext4.img with Diskinternals Linux Reader : Here
- Deodex, sign and zippalign :
with this deodex kit : _Kit_Deodexage.zip
- Create your CWM customROM (wype script)
using a Skeleton ROM : Custom_ROM GS2 by SicOpaT.zip
Click to expand...
Click to collapse
Nothing from me, just reporting for you
Links at the end of post (or in changeLog)
EDIT 16/08 :
1/ update of Kit_deodexage with last versions of smali/baksmali v1.2.7 to avoid LAG bug of browser
2/ add of Custom_ROM GS2 by SicOpaT_v2.zip with a new CWM script NON WIPE
To customise the CWM script, go to Custom_ROM GS2 by SicOpaT.zip\META-INF\com\google\android and edit updater-script with notepad ++
Step by step guide ​:
Preparation :
1/ Extract Custom_ROM GS2 by SicOpaT.zip in order to have a folder with the same name (your future customROM)
2/ Extract sgs2toext4.zip to sgs2toext4.jar and put it in C:\
3/ Extract _Kit_Deodexage.zip to a folder of the same name
4/ install Diskinternals Linux Reader : Here
5/ Install Java SE Development Kit (JDK) if not already installed : Here
Click to expand...
Click to collapse
Extracting the stock ROM :
1/ open your stock__firmware.tar with 7-zip or winRAR
2/ extract in C:\ :
factoryfs.img,
cache.img (if you have 3 tar files in your firmware, extract cache.img from CSC.tar)
modem.bin
zImage : your kernel
Click to expand...
Click to collapse
* Extracting KERNEL and PHONE part :
3/ put zImage and modem.bin in the root folder of : Custom_ROM GS2 by SicOpaT (next to META_INF)
Click to expand...
Click to collapse
* Extracting Factoryfs.img :
4/ Double click sgs2toext4.jar, a windows is opening :
{
"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"
}
5/ drag factoryfs.img in the sgs2converter.jar windows
factoryfs.ext4.img is created
6/ Open Diskinternals Linux Reader
Code:
> Drives > Mount Image > browse to your factoryfs.ext4.img > Mount
Then a new drive appears in the Diskinternals window, called Linux native Volume > double click on it
7/ Select all and press Save > Next > Browse to Custom_ROM GS2 by SicOpaT/System/ check for Save directory structure and then press Next > Next > Finish
8/ In Diskinternals click Back and then right click to your Linux volume and select unmount
Click to expand...
Click to collapse
* Extracting cache.img :
9/ Double click sgs2toext4.jar
10/ drag cache.img in the sgs2converter.jar windows
cache.ext4.img is created
11/ Mount cache.ext4.img in diskinternals
12/ In your linux drive goto \recovery and save sec_csc.zip
Don't save it in your Custom_ROM GS2 by SicOpaT folder
13/ Extract sec_csc.zip (same structure as an update.zip)
14/ Copy everything in /system exept /app to Custom_ROM GS2 by SicOpaT/system
like here :
Now you can unmount and close diskinternal, we have done with extracting the ROM
Click to expand...
Click to collapse
Now time to Deodex, sign and zipalign : with the _Kit_Deodexage script
1/ in Custom_ROM GS2 by SicOpaT/system/ MOVE everything in the app folder to _Kit_Deodexage/app
3/ in Custom_ROM GS2 by SicOpaT/system/ MOVE everything in the framework folder to _Kit_Deodexage/framework
4/ Press : Deodex_Gingerbread.cmd and it will
- deodex
- sign
- zipalign
4 bis/ edit after beginning of deodexing process the NePasSigner.txt and add samsung apps
5/ 2 folders are created : Deodex_framework and Deodex_app
6/ verify that the /app and /framework folders are empty
6/ Move everything from /Deodex_framework exept java.awt.jar to Custom_ROM GS2 by SicOpaT/system/framework
7/ Move everything from Deodex_app to Custom_ROM GS2 by SicOpaT/system/app
Click to expand...
Click to collapse
Buid your CWM update.zip :
With WinRAR : CTRL A in your custonROM root folder and Right Click > Add to Archive > ZIP and None or Normal compression
Click to expand...
Click to collapse
That's all ! You have a stock customROM fully deodexed, signed and zipaligned
PS : You should change the Kernel for the CF-Root Kernel (CWM Manager ...) changing the zImage with the zImage from ChainFire CF-Root
PS 2 : You can add some apps (like Titanium backup) in the /data/app folder of your customROM
EDIT 1 : The deodexed browser.apk obtained will be bugy : Lag scrolling
Since pulser_g2 found the FIX, DEVs used an old deodexed browser.apk (from KE2 ROM for example).
So pulser_g2 foung the FIX, in order to avoid this Lag trouble using the last deodexed browser.apk (KF2 for example). You can see the How To FIX yourself the laggy browser.apk following advices from pulser_g2 in the changeLog of 07/03/2011.
EDIT 2 : just added a zip of an META_INF folder witch can be used for update over a previous deodexed customROM with same signature (a previous ROM built with the same script).
With this META_INF, you will not loose any data/cache
Credits :
Thanks to drphrozen for sgs2toext4.jar and sgs2converter.jar tools
Thanks to xeudoxus for his custom java.awt.jar (deodexing some apks without errors)
Thanks to Okarin for his Deodex script
Thanks to Pulser-g2 for the laggy Browser Fix
Thanks to omrij for showing us an alternative to _Kit_Deodexage : AutoDeoTool (see below)
Click to expand...
Click to collapse
ChangeLog of the HOW TO :
07/04/2011 :
* Switch bugy sgs2converter.jar to new sgs2toext4.jar from drphrozen
* Re-Add the Convert_sgs2img.exe tool to extract .img to .ext4.img (end of post)
CMD command :
Code:
Convert_sgs2img.exe factoryfs.img factoryfs_ext4.img
07/02/2011 :
Modification of _Kit_deodexage.zip in order to add the custom java.awt.jar from xeudoxus
07/01/2011 :
Add the new version of drphrozen sgs2converter.jar, available HERE
Now you just need to double click on the sgs2converter.jar, without opening any CMD promt command.
You drag and drop your stock .img file and the tool will convert it in <inputname>.ext4.img in the same folder
06/30/2011 :
How to manually deodex Email.apk and MobilePrint.apk : (working for others APKs)
Code:
[QUOTE][B]1/[/B] In the same folder, you put :
[QUOTE]*Email.apk
*Email.odex
*MobilePrint.apk
*Mobileprint.odex
AND
all the content of the initial ODEXED framework folder (with all JAR files)
PLUS custom [B]java.awt.jar[/B]
AND
*smali.jar ---> found in _Kit_Deodexage/_binaires/
*baksmali.jar ---> found in _Kit_Deodexage/_binaires/[/QUOTE]
[B]2/[/B] Then open a [B]CMD promt[/B] in the target folder
[B]3/[/B] Then type :
[CODE]java -Xmx1024m -jar baksmali.jar -c :am.jar:android.policy.jar:android.test.runner.jar:bmgr.jar:bouncycastle.jar:com.android.location.provider.jar:com.google.android.maps.jar:com.samsung.device.jar:com.yamaha.android.media.jar:core.jar:core-junit.jar:ext.jar:framework.jar:ime.jar:input.jar:java.awt.jar:javax.obex.jar:libvtmanagerjar.jar:monkey.jar:pm.jar:sec_feature.jar:seccamera.jar:sechardware.jar:secmediarecorder.jar:services.jar:sqlite-jdbc.jar:svc.jar:twframework.jar -x Email.odex
You have a new OUT folder created
4/ Then type :
Code:
java -Xmx1024m -jar smali.jar out -o classes.dex
A classes.dex file is created
5/ Open (without extracting) Email.apk with 7-zip
Push classes.dex in Email.apk with 7-zip
6/ Put the new deodexed Email.apk in app folder, in _Kit_Deodexage
Press Deodex_Gingerbread.cmd
You now have a fully deodexed signed zipalligned Email.apk
Now Mobileprint.apk :
7/ DELETE classes.dex ans Out folder created before
8/ Same procedure, in CMD pompt, type :
Code:
java -Xmx1024m -jar baksmali.jar -c :am.jar:android.policy.jar:android.test.runner.jar:bmgr.jar:bouncycastle.jar:com.android.location.provider.jar:com.google.android.maps.jar:com.samsung.device.jar:com.yamaha.android.media.jar:core.jar:core-junit.jar:ext.jar:framework.jar:ime.jar:input.jar:java.awt.jar:javax.obex.jar:libvtmanagerjar.jar:monkey.jar:pm.jar:sec_feature.jar:seccamera.jar:sechardware.jar:secmediarecorder.jar:services.jar:sqlite-jdbc.jar:svc.jar:twframework.jar -x MobilePrint.odex
You have a new OUT folder created
9/ Then type :
Code:
java -Xmx1024m -jar smali.jar out -o classes.dex
A classes.dex file is created
10/ Open (without extracting) MobilePrint.apk with 7-zip
Push classes.dex in MobilePrint.apk with 7-zip
11/ Put the new deodexed MobilePrint.apk in app folder, in _Kit_Deodexage
Press Deodex_Gingerbread.cmd
You now have a fully deodexed signed zipalligned MobilePrint.apk[/CODE]
Important !! You should NOT have error while deodexing
Click to expand...
Click to collapse
06/27/11 :
added : old version of sgs2converter.jar from drphrozen get it HERE
How To :
Extract sgs2converter.zip to sgs2converter.jar
Put in the same folder : Stock .IMG file, sgs2converter.jar
Open CMD Promt in the folder
run command :
Code:
java -jar sgs2converter.jar factoryfs.img factoryfs.ext4.img
factoryfs.ext4.img is created in same folder. You can pen it with Diskinternals Linux Reader
*AutoDeoTool an alternative to the "kit_deodexage" from HERE thanks to omrij
[/QUOTE]
BONUS :
To personalise your customROM, you can change the name of the ROM shown in Parameters > Version number :
with Notepad++, open the file "\Custom_ROM GS2 by sicOpaT\system\build.prop" and look for the line beginning with : "ro.build.display.id=" (often the 4th). Example : ro.build.display.id=GINGERBREAD.XXKF2
Replace everything after the "=" with what you want. Example : ro.build.display.id=SicOpaT's ROM KF2
Then save the file
Thanks for the infor .. but what does the " - CWM GS2 Skeleton ROM (wype script) : Custom_ROM GS2 by SicOpaT.zip" do ??
anyway of getting a step by step guide.
Thanks
I've used Ubuntu until now... Testing this one
xinfinityoO said:
Thanks for the infor .. but what does the " - CWM GS2 Skeleton ROM (wype script) : Custom_ROM GS2 by SicOpaT.zip" do ??
anyway of getting a step by step guide.
Thanks
Click to expand...
Click to collapse
This is the begining oh a CWM update.zip with the structure folders and I just added : busybox, superuser an su.
I am going to add a step by step guide
nice thanks
Email.apk and MobilePrint.apk are leftover. Trying to do them manually but can't find superclass Ljava/awt/componet;
Mackzen said:
nice thanks
Email.apk and MobilePrint.apk are leftover. Trying to do them manually but can't find superclass Ljava/awt/componet;
Click to expand...
Click to collapse
got the same problem, i took deodexed ones from other deodexedROM
Couldn't flash using cwm (maybe battery low, don't know)
better luck tomorrow I guess
How does the script take care of the Linux file permissions in Windows?
Thanks for the info.
That was some info which i was looking for the last few weeks, but mostly ended in apps that didn't work for everything.
Gonna give it a shot tomorrow.
Thnx for the info.
very well defined and this will sure help some newcomers to build thier own custom roms. you deserve a star from me !!
Thanks for this Guide!
1.) The last step would be to put the new CustomRom Folder to a Zip and flash via CWM?
...or is it a problem with signing then?
EDIT: you have to put the files back into the original ZIP!
2.) why do we have to put cache.img and modem.bin to the customrom root folder?
Thanks
Flashed via cwm 4.0.2 -> Bootloop :/
No modifications done at the moment
walda said:
Thanks for this Guide!
1.) The last step would be to put the new CustomRom Folder to a Zip and flash via CWM?
...or is it a problem with signing then?
EDIT: you have to put the files back into the original ZIP!
Click to expand...
Click to collapse
Yes you have to create an update.zip archive with all in your CustomROM root folder
walda said:
2.) why do we have to put cache.img and modem.bin to the customrom root folder?
Thanks
Click to expand...
Click to collapse
No you have to put :
- zImage (your kernel)
- modem.bin (phone part in ODIN)
Mackzen said:
Couldn't flash using cwm (maybe battery low, don't know)
better luck tomorrow I guess
Click to expand...
Click to collapse
walda said:
Flashed via cwm 4.0.2 -> Bootloop :/
No modifications done at the moment
Click to expand...
Click to collapse
I have forgotten wype.sh in the /system folder of the skeleton customROM.
The wype.sh will wype everything in the /data folder in order to prevent bootloops
I reuploaded the CustomROM GS2 with the wipe.sh
Thanks! Works now
walda said:
Thanks! Works now
Click to expand...
Click to collapse
You're welkome
Sorry for the forgotten wype.sh
thanks for this!
i am running per instructions, trying to deodex KF2 rom. but i face problem at the deodex/sign/zipalign. after running the script file, there are still a lot of files in the "app" and "frameworks" directory. what am i doing wrong?
edit: 2nd round works, no idea why?? but left email and mobileprint, and as per you suggestion get it from another deodex rom.
This is EXACTLY the thing i was looking for since getting my SGS2 this week.
Wanted this since the Hebrew/RTL routine fixing i did on other devices needed deodexed ROMs to work (modifies framework.jar/libwebcore.so).
I'll give it a shot today or tomorrow and report back.
Either way, THANK YOU very much for the effort!
I know this is a stupid question, but where can i find my factoryfs_out.img iv done the cmd bit but cannot find the factoryfs_out.img to mount??

[GUIDE] How to Customize a ROM

I made this guide because I've found that a lot of us doesn't satisfied with our current custom ROM. Please don't bully the dev to make a rom with our personal preference. You may follow this guide instead to modify the custom rom to suit with your personal taste. I hope I could make it as simple as possible so all of us so even a new android user could understand. Please make sure you've read this guide throughly before make any modification.
Please note that this is just a simple guide. You won't find any guide about theming a rom here. Please refer to another guide about uot kitchen or apk modification.
Click to expand...
Click to collapse
tools:
1. a custom rom (to be customized) or stock rom.
2. 7zip or another similar program
3. apk files
4. dsixda kitchen (not mandatory)
5. apktools (not mandatory)
6. titanium backup (not mandatory)
7. CWM.
First of all, extract your custom rom. You'll see that the custom rom's zip file contain several files and folders. Some of them are common and could be find in almost all custom rom. The files and folders are:
1. meta-inf : contain the script needed to install the rom (don't touch it if you don't understand about scripting nor dsixdia kitchen).
2. system : contain the system files and folder of the custom rom
3. boot.img : the kernel used in the custom rom
4. additional file : (eg:install-busybox, check-data and bmlunlock) additional file contain scripts needed to install additional feature (eg: busybox, additional app in data/app, and install custom kernel) in the custom rom.
NOTE: you can start from either stock or custom rom. If you start from stock rom, use CWM to make nandroid backup, then extract the system.rfs.tar. That's the system folder that we need later. You'll need installer script from other custom rom to make your rom installable to other device. In my past experience, the script form hybrid 2.1 or myss 3.4 is easy to use. I'd like suggest use them if you only want a light customization (without custom kernel, init.d script, or a2sd support.)
Click to expand...
Click to collapse
If you don't know much about them, don't touch anything but system folder. now, open the the system folder. You'll see a lot of folders and some common files. Leave CSC files and SWconfiguration intact if you don't know about them. You can edit build.prop to insert more build.prop setting or modify the content if you understand how to do it. To change the rom's name, edit the value for 'ro.build.display.id'. You may also change the value for 'ro.build.version.release' to any number like 9.9.9 if you want to show off your modified custom rom
I'll give a quick explanation about the folders in /system.
1. app : contain all the system's app
2. bin : contain the command and bin files for the rom (don't touch it)
3. cameradata : camera files
4. csc : csc files. contain dictionary for the keyboard
5. etc : additional setting and files for the rom
6. font : the fonts
7. framework : system's framework
8. lib : drivers, modules, kernel related files for the rom
9. media : media files-ringtones, notification
10. sd : folder created by a2sd darktremor. (don't touch it)
11. usr : files needed for keyboard, bluetooth, etc.
12. xbin : additional command and bin files (busybox is normally installed here)(don't touch it)
13. T9DB: dictionary and language database for swype and stock keyboard
NOTE: if you start from stock rom, copy all the files under /system folder (the one from system.rfs.tar) except /system/bin and system/xbin. don't touch them.
Click to expand...
Click to collapse
now, you're ready to customize the rom. I'll divide the guide into several section. pass the section if you don't want to modify it.
>>> SYSTEM APP-CUSTOMIZATION <<<
Click to expand...
Click to collapse
DEODEX VS ODEXED ROM. Most of custom rom available is deodexed rom while our stock rom is half deodexed rom. I'll try to explain it in most simple way. First of all, we should understand that mostly every app in android consist of three part, *apk files, *dex/odex files, and lib files.
ODEXED rom means that *dex file needed to run the app is extracted from the apk file and placed in same folder with the apk files (/system/app). the positive side, it consume less internal memory and a execute faster. the negative side, it makes the app uncostumizable (cannot apply custom themes) and need more space in system partition.
DEODEXED rom means that *dex file needed to run the app is extracted from the apk file and placed in /data/dalvik-cache. the positive side, the app can be themed (full customizable) and consume less system partition. we could put more app in /system/app in deodexed rom. the negative side, it consume a lot of internal memory. please be cautious with the internal memory space if you use deodexed rom. (NOTE: if you start from stock rom, you may use dsixdia to convert odexed to deodexed rom).
system app customization is easy. you can add or remove any app in /system/app folder as long as it fit with the space in sistem partition (220MB). if you start from stock rom, please be cautious to not remove essential app from the folder. you may see the app in hybrid rom v.2.1 to see which app is safe to remove or not (the spreadsheet document in this forum is gone. sorry). having ~20mb free space in system partition is a good thing if you want to make the rom more customizable.
NOTE:
1. not all apk could be placed in /system/app (especially keyboard app)
2. tw launcher file is named tw'xxxxx'launcher.apk. you may remove it if you have another launcher.
3. not all custom launcerh could be placed in /system/app. you may put the launcher from other custom rom to minimalize the risk.
4. for the app info reference, please refer to this link
https://docs.google.com/spreadsheet/pub?key=0AulpDQBL_oTOdDRIbnV5b0UyQTd0TDNZSFBKYXJ1blE&output=html
if anyone want to edit it please contact me.
Click to expand...
Click to collapse
>>> THEME-CUSTOMIZATION <<<
Click to expand...
Click to collapse
Basicly, theme is easily changed by replacing systemUI.apk in /system/app and framework-res.apk in /system/framework. You may put theme from another custom rom or make for yourself from uot kitchen or make it by yourself with apktool. A high modified theme like dysmenorrhea is also modify some part in setting.apk and jobmanager.apk. and another app. Don't forget to delete the *odex file (for all changed app only)from /system/app if you start from stock rom.
NOTE: please be aware with the base firmware of the rom. make sure that systemUI.apk and framework-res.apk files are from exact firmware version. I've found that theme for DXLA, DXLB, DXLC are exchangeable but you can't put theme from DXKL2 to DXLA or the reverse. to minimize any risk, please use themes only from exact same firmware.
>>> PERFORMANCE-TUNING <<<
Click to expand...
Click to collapse
Performance tuning could be done in several ways. the easiest (proven works but risky) method is by edit build.prop file. I won't give you all the script. Feel free to search and apply the script with your personal preference. you can found in this forum or just copy from another rom. these script below is used to increase gprs/hsxdpa speed. this script is a common script and proven to be works in a lot of device. (I forgot the original source. sorry)
Code:
ro.ril.enable.dtm=1
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.3g.prefix=1
ro.ril.hsdpa.category=8
ro.ril.hsupa.category=6
ro.ril.hsxpa=2
ro.ril.enable.a53=1
there are also some common tweaks for build.prop file. these are the one I always using in my rom.
Code:
#mod battery kats
debug.performance.tuning=1
pm.sleep_mode=1
video.accelerate.hw=1
windowsmgr.max_events_per_sec=150
ro.ril.disable.power.collapse=1
wifi.supplicant_scan_interval=150
#mod performance
dalvik.vm.execution-mode=int:jit
persist.sys.purgeable_assets=1
dalvik.vm.dexopt-flags=m=y
ro.media.enc.jpeg.quality=100
ro.telephony.call_ring.delay=0
video.accelerate.hw=1
ro.kernel.android.checkjni=0
ro.HOME_APP_ADJ=1
======
the second way, (little bit harder, but its still proven works) by create or modify some file in /system/etc. I'll give you some of them.
1. sysctl script-to increase internet speed.
make a new file in system/etc, name it 'sysctl.conf' (or edit if it already exist). put this script inside.
Code:
net.ipv4.tcp_wmem = 4096 39000 187000
net.ipv4.tcp_rmem = 4096 39000 187000
net.ipv4.tcp_mem = 187000 187000 187000
net.ipv4.tcp_rfc1337 = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_fack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_ecn = 0
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_moderate_rcvbuf = 1
net.ipv4.route.flush = 1
net.ipv4.ip_no_pmtu_disc = 0
net.core.rmem_default = 524288
net.core.rmem_max = 524288
net.core.wmem_default = 524288
net.core.wmem_max = 524288
its a common sysctl mod for linux based OS (I found it in another mod for another device but I forgot the source). you'll need busybox, and terminal emulator. to run it, type:
'su
'sysctl -p
in your terminal emulator (without ' symbol).
2. GPS mod-to make the GPS lock faster
this mod is based on zeusseuz's guide. please see this page for further information (the script is quite long) http://forum.xda-developers.com/showthread.php?t=1552076
======
the last way...by init.d script. it only works in custom kernel. I won't put any script here. you should find by yourself. you can use make a file in init.d with there script to check if your kernel support init.d script.
Code:
#!system/bin/sh
touch data/kurotsugi_test.txt
set the both init.d folder and the file's permission to rwxrwxrwx (777)
if the script work, you'll find kurotsugi_test.txt in /data.
======
>>> ADDITIONAL CUSTOMIZATION <<<
Click to expand...
Click to collapse
I'll only put the one I've tested and proven to be works.
1. beats audio
this is the old version but doesn't have FC issue. get the file from here http://forum.xda-developers.com/showthread.php?t=1526643
unzip. copy all the files into their respective folder
2. bravia engine
put be_photo and be_movie in system/etc folder then edit the build.prop file doesn't seems work. The real bravia engine mod is consist of
- be_photo, be_movie in /system/etc
- com.sonyericsson.android.SwIqiBmp.xml in /system/etc/permission
- com.sonyericsson.android.SwIqiBmp.jar in /system/framework
my megabassbeat mod contain these files. you can get it from there.
3. boot animation
download or get custom boot animation file from another custom rom or another source. rename it to bootanimation.zip, put it on /system/media.
you may check this out http://forum.xda-developers.com/showthread.php?t=1548479
please note that DXLB rom doesn't support bootanimation. you need to put bootanimation and samsungani files from another rom (like hybrid) in /system/bin and replace all file in /system/lib with lib files from older firmware (DXLA or older)
4. boot sound
make or download boot sound. please make sure the format is *ogg. rename it to poweron.ogg then put it in /system/etc.
5. custom ringtones, notification,
make or download the sound file (in ogg format). put it in /system/media/audio/(respective folder)
6. disable boot animation (for quick boot)
put 'debug.sf.nobootanimation=1' in build.prop.
7. megabassbeats (better than beat bass)
you can get the file from this link http://forum.xda-developers.com/showthread.php?t=1646406. you'll need to copy the files into its respective folder.
If you've done with the customization, enter the custom rom folder. select all the files then create zip file. to install the rom, copy to your sdcard, flash it either by stock recovery or CWM after wipe /data. PLEASE MAKE SURE THAT ALL THE FILES DOESN'T EXCEED THE LIMIT 220MB BEFORE ZIPPED.
This guide can be used if you want to make your own rom. if you start from stock rom, you may use this script (its from myss v.3.4) to install the rom. please make note that it will only install the rom, not the kernel. you'll still need the bin and xbin folder from custom roms in order to make it work.
http://www.mediafire.com/download.php?skw1ytt37mklb4o
DISCLAIMER:
1. do it with your own risk
2. please note that NOT ALL YOUR MODIFICATION WILL WORK. ROM modification is seriously hard thing. its not easy. thats why we should give the dev proper respect to them. you'll need a lot of research to make it work.
3. this guide is made for personal use only. don't publish the customized rom without permission from the original dev.
Click to expand...
Click to collapse
All credits for the dev who make the rom, the one I've used the guide here, and all XDA member. no need to say thanks or press it for me. give that to the real dev. I'm just a noob here. Feel free to correct me if I'm wrong.
ADDITION STUFFS
==============
Click to expand...
Click to collapse
1. dualboot
this mod actual intent is to make developing a rom a lot more easier without risking our native rom. I was using it a lot when customizing my rom. you can get the original link for dualboot here: http://forum.xda-developers.com/showthread.php?t=1598803 and for a little more detailed step how to use it http://forum.xda-developers.com/showthread.php?t=1600973.
you can find another dualboot kernel here. http://www.mediafire.com/download.php?gkb33aktyf7wbbh
this one have init.d support. all credits goes to irfanbagus
2. data2sd
this mod is used to increase data partition size. you can find the complete guide here http://forum.xda-developers.com/showthread.php?t=1622052
Noob guide: Light theming
just for addition...this guide is only about change minor aspect in your theme. please don't expect any hard modification. we'll only change some of the picture used by the app.
what you need:
1. 7zip
2. any graphic editor program
3. systemUI.apk and framework-res.apk
the steps:
1. extract both apk files
2. open /res/drawable-ldpi. you'll see the graphic files used by the app.
3. replace any graphic files with yours. please make sure the resolution size and the name are same.
4. open the apk file. right klik>7zip>open archive
5. drag n drop /res folder (from the extracted one) to 7zip.
6. push it to your rom
7. cross your finger...reboot your device.
IF YOU WANT TO CHANGE THE SETTING BACKGROUND, CHECK THIS LINK.
http://forum.xda-developers.com/showpost.php?p=25061115&postcount=90
it's a tranlated version of this post:http://www.kaskus.us/showpost.php?p=649687134&postcount=5784
all credits for heriawan.fx who make the original post.
m only translated it and post it to here.
CAUTION:
some user have found that this background setting mod cause a problem in deskclock.apk. if this happen, you can replace the deskclock.apk with this one http://www.mediafire.com/download.php?w5vchbdyj2k9837
please delete deskclock.odex if you're using a stock odexed rom.
Click to expand...
Click to collapse
NOTE:
- don't forget to make backup
- you may use the files attached in this post to push the file into your ROM. put systemUI in app and framework in framework.
here are some pic from my customized rom. its an odexed rom with a slight customized repencis v.2.5 theme.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
the launcher is downloadable here
http://forum.xda-developers.com/showthread.php?t=1596280
Hmm, gonna read this later. It's a wall of text on phone lol. Hope I don't forget.
Anyway thumbs up for the effort.
Sent from my GT-S5360 using xda premium
reserved
good work dude
have done a lot of homework lol
excellent work bro !!
very informative.....really appreciate your work
thanks alot .
Wonderful thread. Can you give tutorials on how to recompile framework-res.apk with apktools? I always end up with lots of warnings regarding translations and end up with an apk which is about half the size as the original. And lots of force closes once it is pushed
Sent from my GT-S5360 using Tapatalk
bumslayer said:
Wonderful thread. Can you give tutorials on how to recompile framework-res.apk with apktools? I always end up with lots of warnings regarding translations and end up with an apk which is about half the size as the original. And lots of force closes once it is pushed
Sent from my GT-S5360 using Tapatalk
Click to expand...
Click to collapse
Sorry...I'm just a chemistry student and consider my self as a noob here. I never use apktool before and only use 7zip, notepadd++ and simpel graphic editor program to modify an apk files (only light theming). its a lot of simpler and easy for a mid user like me.
you may follow this guide instead
http://forum.xda-developers.com/showthread.php?t=1466100
Noted bro. I already took a peek at the link you gave. Thanks anyway.
Sent from my GT-S5360 using Tapatalk
bumslayer said:
Wonderful thread. Can you give tutorials on how to recompile framework-res.apk with apktools? I always end up with lots of warnings regarding translations and end up with an apk which is about half the size as the original. And lots of force closes once it is pushed
Sent from my GT-S5360 using Tapatalk
Click to expand...
Click to collapse
hey
I can provide you the tutorial for framework and system ui apks
with apktool for sgy
I think you are trying to make your themes
if that is I will provide the tutorial tommorow
if you need it
why don't you PM repencis? the setting.apk in repencis v3 changed a lot from the original one. I thought he could help you.
EDIT: thedeadlycoder seems already have the solution for you
Hahaha indeed he does! @deadlycoder I am anticipating your pm soon
Sent from my GT-S5360 using Tapatalk
I think I'll put a light theming tutorial in my reserved post...
Thanks for saving us dude! You rawk!
Sent from my AURORA ULTRA GT-S5360 through XDA Premium Customized by Androhacker Xavier
Very useful thread.Thanks
How can i confirm my init.d is working?is there any specific command for terminal emu :
su
init.d check (myb?) or with init.rc etc installed would be enough to prove it is working?
previously i tried init d-autorun-stock to my stock rom but not confident with tht method.Found [Script] init.d for STOCK ROM thread n member report its worked.
Thanks in adv.
thats a good question. please note that some of init.d script doesn't work in our device even if the script is running. stamatis's battery n performance script is one example. because of some script in init.rc (in kernel) it never change the value for RAM setting. to check the init.d script you may make a new file in init.d script. name it stest, put these script
\system\etc\init.d\99test
#!/system/bin/sh
touch /data/local/tmp/init.d_log_test.txt
echo "done" >> /data/local/tmp/init.d_log_test.txt
these script is made by doky73. if the init.d script works, you'll find 'init.d_log_test.txt' file in /data/local/tmp/ . init.d scipts need busybox don't forget to install it in your device
Kurotsugi
What is the correct permission for 99test?is it same like the others=777?
no problem if i change through root explore right?my device deny the latest version
of busybox 19.4 is this due to old su binary?19.3 will do right?
yup...thats fine. as long as the system could read it, the script will run at boot (if only it really support init.d scipt). any busybox version is OK as long as you have the binary files needed (in this case echo and touch). in my past experience, only vivek's kernel proved to support init.d script. I forgot the version. but its the last version without CWM integration.
kurotsugi said:
only vivek's kernel proved to support init.d script.
Click to expand...
Click to collapse
Kurotsugi..Thank u so much.I agree with u.Init.d script will only work with some kernel only.It is kernel dependent.My 1st attempt with stock kernel failed then
i change with stock kernel modify by blooper1 and succeed..Are u really a chemist
student ...Today is my off day n im gonna create all ur provided script.Thanks
again..
well...thanks for everyone here and this forum which help me learned a lot of stuff about android much faster. sgy is my first android device and I've only been using it for three months. with everyone help and information here I could make my own custom rom about one month ago. it sure nice to share about our sgy here :3
Wow! This seems really helpful and very useful thread. It gives me an eye opener.. Thanks!

[TOOL][v1.2.0] Batch Deodexing Tools using Android Device

[Tool/Utility][v1.2.0]Apktool Mobile Batch Deodexing - Run Batch Deodex Jobs Using Your Android Device!
*** Disclamer
Your device is shipped without root for a reason. Modifying system files that are normally off limits carries the risk of being caught in a situation where you will be unable to fix the damage unless you plan ahead.
It is wise to not proceed unless you have a means of restoring your device in the event of a catastrophic event and that you are confident in your ability to restore any issues you create.
I am not and will not be responsible for any harm that may come to your device or to your sanity as a result of **** up.
For more on what's expected, new members should help themselves to the video below.
Description
A toolset for performing batch deodexing straight from your device. Comes installable as a flashable zip and can easily be modified by advanced users to suit their needs. Just drop all your odex and corresponding archives into a folder and run one simple terminal command (or use Linux Script Handler within your File Manager) and deodezed versions will be outputted to a separate folder.
I wrote this because Apktool Mobile lacks any batch features.
COMPATIBLE FOR ALL ANDROID DEVICES RUNNING ICS OR LATER!
Project is just listed here because I had to choose a location specific to a certain device when creating the project. Mods, feel free to move if desired.
Learn more about deodexing and the differences between an odexed system and deodexed system
Installed Files/Directories:
/sdcard/bdt - Directory with our smali and baksmali jars as well as directories to place batch jobs in as well as output folders. There is a readme in each folder describing it's function.
/data/misc/bdt - Directory which contains the Java Runtime Environment as well as all dependent libraries.
/system/bin - Two scripts are installed here. The first is "bdt" and contains all path variables in case you need to edit a path (ex. you download newer smali/baksmali versions to use, or change the name of the bdt directory on your /sdcard). This also contains wrapper functions athat do all the work. The second file is "batch-deodex" and once you have placed your odex (and corresponding apk/jar) files into the /sdcard/bdt/files-to-deodex folder open a command prompt and run this script to deodex all the odex files into dex files and then insert into the corresponding archive.
{
"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"
}
Installation Instructions and Usage
Download the latest version from one of the hosts in the downloads section and simply flash it in recovery. You could always manually extract the contents but then you'd also have to chmod quite a bit to set the permissions.
To uninstall, flash the uninstall zip that's also in the downloads section, or manually delete /system/bin/bdt, /system/bin/batch-deodex, /data/misc/bdt folder, and /sdcard/bdt folder.
Batch baksmali/smali
To run a batch decompile, move your odex (or deodexed apk or jars) files into /sdcard/bdt/files-to-deodex and fire a command prompt up and type:
Code:
su
. /system/bin/bdt # Import paths and functions
batch-baksmali
The source folders will be outputted to /sdcard/bdt/smali-source.
To compile a batch of deodexed source folders we just do essentially the same thing. Open up a command prompt and type:
Code:
su
. /system/bin/bdt
bbdth-smali
Doing so will create a dex file for each source folder and this will be outputted to /sdcard/bdt/dex-out.
Batch deodexing
Performing a batch deodex works much the same way. Copy all the odex files and their corresponding apk or jar into /sdcard/bdt/files-to-deodex then open a command prompt up and type:
Code:
su
# no need to import anything for this
batch-deodex
Just that easy. The script may take a while depending on how many files you're deodexing just as with the other scripts so if running a lot be patient.
The deodex script moves all odex files to ../files-to-baksmali and then calls batch-backsmali. Then the script calls batch-smali to create the dex files. After that's done it enumerates through the dex files and finds each one's corresponding archive and once it does it uses the
Code:
zip -jq {archive} classes.dex
to insert classes.dex into the archive without extracting anything or changing any compression settings, etc.
Once complete you'll have your deodexed archives and the script cleans up all other directories. The other two scripts don't do this.
Known Issues
-- Discovered that some ROMs are telling me that my scripts don't exists when they very well do, so of you are seeing a "sh: {scriptname}: The file or directory cannot be found" then just run by using the Linux Script Handler within your File Manager until I figure this out or until the ROM dev gets in touch.
-- I just discovered this error while preparing these test screenshots. It didn't effect the deodexing process though but I'll look into fixing this tomorrow. UPDATE: Haven't looked into this yet as it has no effect on the outcome. I think it's occurring because on the final loop when running a batch and when all is finished it still runs one last time, thinking it's looking for a jar file. Once I get these other minor details done I'll publish on github. Actually there is published code there now, but ir needs to be removed and updated.
Downloads
Batch Deodex Tools 1.2.0 - Box
Batch Deodex Tools 1.2.0 - Dropbox
Uninstall ZIP for 1.1.0
Changelog
Code:
1.2.0 Released: -- 08/21/14
-- fixed an issue causing the /sdcard/BDT folder to not be properly flashed
-- some editing made to the scripts in preparation for uploading to github
1.1.0 Released: -- 06/26/14
-- turned into a stand alone project
-- optimized the scripts
-- flashable in recovery
-- also created flashable zip to uninstall
1.0.1 Released: -- 06/21/14
-- initial release
TO DO
-- Migrate the JRE off /data/... to prepare for Android L. Was going to move to /data/app-lib where it probably should have been to begin but no point now, so will remain in /data/misc/bdt for the time. Rwas more in the Addendum in second post
-- Add Box, Dropbop, and Mega hosts as well. Well having just a Drive and Box host should accommodate the demand. If the demand increases I'll adjust accordingly.
-- Publish code to github.
-- Scratched making this into an APK... Having it as is makes it easier for advanced users to make modifications (use custom files, etc) on the fly
Thanks To/Credits
Code:
* Brut.all for giving us apktool and much more
*
XDA:DevDB Information
Batch Deodex Tools - Android, Tool/Utility for the LG G2
Contributors
MidnightHarvester
Version Information
Status: Stable
Current Stable Version: 1.2.0
Stable Release Date: 2014-08-21
Created 2014-06-22
Last Updated 2014-08-21
Reserved
APPENDUM
Consider this a diary. Dates are when the thoughts or discoveries hit me, not release dates
Aug 15 - After modifying the tookset so it"s Android L ready by moving the JRE to /system/{wherever}, after flashing now the BDT directory doesn't get flashed to the sdcard. I'll need to do a little fiddling with the updater script, then release it once it's working. Granted you can just manually extract and copy that directory over easily but I'd prefer a fully working flaahable..
Aug 19 - Noticed there has been updated smali and baksmali jars, so either an incremental update and most likely just a patch will be worked I n and releaaed. Because of the update I'm also looking at any other files that may have been updated.
Aug 20 - I've discovered that on some devices (specifcally, CloudyG3 1.3), that t
here arr some issues running the scripts via terminal as apparently ... they don't exist. Executing them via Linux Script Handler within a File Manager should work until I figure this out)
Aug 20 - Releases will be migrated over time to my Box account, probably Dropbox account, as well as Mega. Archived releases will also be uploaded, and the OP will be updated as each is moved.
Aug 21 - Fixed a bug preventing the /sdcard/bdt directory from being installed on flash. Also made a few revisions to the code, nothing spectacular. Also uploaded to Box and Dropbox and ditched the Drive host. Incremental update to 1.2 0.
Good job buddy. Keep it up. Will give a try it soon.
Sent from my GT-I9100 using Tapatalk 2
Thanks! I'll be publishing an update in a day or so. I'm creating a stand alone project that won't require root. Right now root is required because the scripts need to access the JRE bin that's located in the data directory of apktool. I'm moving JRE lib (and Java binary) and smali and baksmali jars into a flashable zip.
It'll also be a lot easier to maintain this way. I completely killed my phone yesterday while cleaning up the scripts. After doing a batch deodex as it is now it will clean up the working directories and delete
everything except the deodexed archives.
I modified the paths hoping to create less work in the long run and after testing the modified script by phone rebooted back up and I got "unable to find setup" message and a blank screen. I must have left a "/" off of a path and ended up wiping everything in /sdcard/ ?
The error on boot was caused by the fact I always delete the LG setup app as I never anticipate deleting my SD card. So I was stuck at a black screen with nothing to restore since I wiped the SD card.
Eventually I realized I could pull the notification bar down still, and make it into settings by long pressing a quick toggle. Once I discovered I could open Google Now after enabling it in search settings I was in my way since I could use that to open Chrome and Root Explorer, etc.
I ended up restoring my system back and just wiped /data as well since I already wiped my SD card. Then spent the rest of the day restoring my device and luckily I had most everything backed up onto Drive.
Needless to say no changes were published in yesterday. I can imagine the backlash I would have gotten if I did lol. If I had a penny for each time I've mucked my device up while working on something I'd have, well maybe a dollar but still that's a lot
It shouldn't take long to get the standalone build out. I don't plan on turning the standalone build into an apk though as its easy enough to run via terminal emulator or file manager and take up far less space.
Sent from my VS980 4G using Tapatalk
I'll find another host to upload the install zip to as well as the Drive host in the OP. The zip is too large to attach here. I hope this simplification over installation appeals to more ?
Version 1.1.0 is now live. Installation boils down to just flashing the install zip in recovery. Read OP for additional information on how to use it.
Dang man! You beat me to it hahaha! I had started on this as a personal project for myself earlier today. However, I am wanting to just implement the process strictly through the recovery and by locating/finding all .odex files in my system to later deodex and place back accordingly all without me touching a thing but just running the script. I'm currently digging through your work right now to see if anything may be helpful for what I am aiming to do. Nevertheless, greatly appreciate you sharing this project.
How do you make an odexed apk into am installable apk? I wanna take the LG QVoice apk from an odexed rom and be able to install it like a normal app without having to add it to /system/app or /system/priv-app. Would just deodexing the apk do that?
Skizzy034 said:
How do you make an odexed apk into am installable apk? I wanna take the LG QVoice apk from an odexed rom and be able to install it like a normal app without having to add it to /system/app or /system/priv-app. Would just deodexing the apk do that?
Click to expand...
Click to collapse
You would most likely need to deodex that app and then install it via /data/app.
Make sure that system app you are referring to doesn't use any lib files or other dependencies. Some system apps do and it would be needed to port them over to your device for them to work (and possibly some work on the app itself once decompiled).
Sent from my C525c using Tapatalk
Modding.MyMind said:
You would most likely need to deodex that app and then install it via /data/app.
Make sure that system app you are referring to doesn't use any lib files or other dependencies. Some system apps do and it would be needed to port them over to your device for them to work (and possibly some work on the app itself once decompiled).
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
Yea I didn't think of lib files for that app. It makes sense it would need it. Thanks.
Modding.MyMind said:
Dang man! You beat me to it hahaha! I had started on this as a personal project for myself earlier today. However, I am wanting to just implement the process strictly through the recovery and by locating/finding all .odex files in my system to later deodex and place back accordingly all without me touching a thing but just running the script. I'm currently digging through your work right now to see if anything may be helpful for what I am aiming to do. Nevertheless, greatly appreciate you sharing this project.
Click to expand...
Click to collapse
That's an awesome idea bro. You'd need the jre in /data/misc/jdr somewhere. You may be able to run it off the scars in recovery since you can set permissions to the /sdcard mount there but not sure.
Create a script that 'finds' all odex files system wide and corresponding archive files and use the run_program edify script command to run the script so that you can deodex everything from recovery with one slide of a button.
There's not too much that would have to be changed in the script other than changing some of working directory variables as you go. Be careful in the batch-deodex script if borrowing from that as that deletes all odex, apk, and jar files in the /BDT/*/ except for the readme files.
Edit: If you need any advice or help on that project hit me up, as I could probably get it working by the end of the day. Well sooner not this day as my son is here but tomorrow.. Sorry I didn't comment the script that much but there wasn't really much to comment, so I mainly just commented the paths.
MidnightHarvester said:
That's an awesome idea bro. You'd need the jre in /data/misc/jdr somewhere. You may be able to run it off the scars in recovery since you can set permissions to the /sdcard mount there but not sure.
Create a script that 'finds' all odex files system wide and corresponding archive files and use the run_program edify script command to run the script so that you can deodex everything from recovery with one slide of a button.
There's not too much that would have to be changed in the script other than changing some of working directory variables as you go. Be careful in the batch-deodex script if borrowing from that as that deletes all odex, apk, and jar files in the /BDT/*/ except for the readme files.
Click to expand...
Click to collapse
Thanks. I had already set up my project folder along with my deodex script before I came across this thread (what were the odds lol). Was having issues getting the script to work at all until I looked at yours and notice you were exporting the LD_LIBRARY path. I implemented that idea in my script and now I'm getting a few failures for linking executables based on certain commands such as grep for example.
The script is a combination of premade works from different people which I have put together as followed. Currently, the script is a bit rough on what I am aiming to do but my goal for now is to get it to successfully find and deodex all necessary files. Once accomplished, I will proceed forward.
Script:
PHP:
#!/sbin/sh
cd $(dirname "$0")
DEODEXED_APK="/data/DEODEXED.log"
if [ ! -f $DEODEXED_APK ]; then
busybox touch $DEODEXED_APK;
fi;
prop="/system"
smalibaksmali_dir="/data/local/tmp/smali"
java_dir="/data/local/tmp/jvm/java-7-openjdk-armhf/jre/bin/java"
#tmp="$(dirname "$1")"
export LD_LIBRARY_PATH="/data/local/tmp/jvm/java-7-openjdk-armhf"
# Deodexes every .odex file
DEODEX() {
local API="$(busybox grep "ro.build.version.sdk" "$prop/build.prop" | busybox cut -d'=' -f2)"
echo "Detected API level $API" >> $DEODEXED_APK
busybox find "$prop" -type f -iname "*.odex" | while read line; do
local FILE="$(basename "$line")"
local FILEDIR="$(dirname "$line")"
echo "Deodexing $FILE" >> $DEODEXED_APK
echo "Disassembling $FILE..." >> $DEODEXED_APK
$java_dir -Xmx512m -jar $smalibacksmali_dir/baksmali-2.0.2.jar -a "$API" -d "$prop/framework" -x "$FILEDIR/$FILE"
if [[ $? -ne 0 ]]; then
echo "ERROR DEODEXING $FILE, ABORTING!" >> $DEODEXED_APK
rm -rf out
return 1
fi
echo "Assembling into classes.dex..."
$java_dir -Xmx512m -jar $smalibacksmali_dir/smali-2.0.2.jar -a "$API" -o classes.dex out
if [[ ! -e classes.dex ]]; then
echo "ERROR DEODEXING $FILE, ABORTING!" >> $DEODEXED_APK
rm -rf out
return 1
fi
FILE="$(busybox echo "$FILE" | busybox rev | busybox cut -d'.' -f2- | busybox rev)"
local FOUND=0
for EXTENSION in "jar" "apk"; do
if [[ -e "$FILEDIR/$FILE.$EXTENSION" ]]; then
echo "Packing back into $FILE.$EXTENSION..."
zip -rq "$FILEDIR/$FILE.$EXTENSION" classes.dex
rm -f classes.dex
FOUND=1
break
fi
done
if [[ "$FOUND" -eq 0 ]]; then
echo "ERROR, No output found?!"
rm -rf out
rm -f classes.dex
return 1
fi
rm -f "$line"
rm -rf out
done
echo "Deodexing finished"
}
# Start Processing Here
DEODEX
Sent from my C525c using Tapatalk
Saved while I read script after kid stops jumping on me lol
LD_LIBRARY_PATH threw me off to. Somewhere in java or bad small or small expects it to point to the data/data/per.pqy.apktool/lix files.
MidnightHarvester said:
Exporting LD_LIBRARY_PATH and pointing that to wherever you have the lib files stored which in apktool are in /data/data/per.pqy.apktool/lix is key cause either java or baksmali or small reference that Android environment variable.
That took me a while too until I realized what I needed to do. You can cut down on size quite a bit and copy the lib files in /data/misc/bdt in my project as those are the only ones needed for smali and baksmali. With that figured out you'll have it done in no time. You could always flash these tools and then make a script like
Code:
# import my 'bdt' script
. /system/bin/bdt
# copy all odex, apks, and jars into files-to-deodex - could
# use lath variables instead of full pathnames
cp /system/app/. *odex /sdcard/BDT/files-to-deeodex
cp /system/app/. *apk /sdcard/BDT/files-to-deeodex
cp /system/priv-app/. *odex /sdcard/BDT/files-to-deeodex
cp /system/priv-app/. *apk /sdcard/BDT/files-to-deeodex
cp /system/framework/. *odex /sdcard/BDT/files-to-deeodex
cp /system/framework. *apk /sdcard/BDT/files-to-deeodex
# call batch-deodex function
batch-deodex
Then make sure all the deoxed archives are in the deodexed-out directory and if check a few make sure classes. dex are in them lol. Then if running from recovery, copy the new deodexed archives into appropriate places and set permissions (recursively unless you're insane ).
Sounds a lot like what you're doing though. Also gives me an idea for version 2 which also gives the option to deoxed the entire system and then create a flushable zip with all the deodexed archives inside. Will probably work on that tomorrow after my son is gone. Keep me posted ed on the progress on your work though as I haven't had much in out back regarding this.
Click to expand...
Click to collapse
I like your idea about making a flashable zip once it is done. I have it working now.
I made a small typo which resolved my earlier problem.
I used "smalibaksmali_dir" as my variable which pointed to the smali directory.
However, later in my script I spelled 'bak' with a 'c' - smalibacksmali_dir.
I will keep you posted man. I was shocked when i found your thread because prior to I had spoken with a relative about my project and how it appeared no one had done this. Then I found you lol. Kudos for your work bro.
Sent from my C525c using Tapatalk
---------- Post added at 07:54 PM ---------- Previous post was at 06:58 PM ----------
Here is a screenshot with my personal script/project running.
Sent from my C525c using Tapatalk
@MidnightHarvester, my script is working great now. However, I noticed that this bogs down the device greatly. To deodex the Rom from the device will take WAY TOO LONG then if you were to do so using a descent computer. However, if merely deodexing an app here or an app there then it's fine and tolerable but not for all *.odex files at once lol.
There has to be some way to make this move along faster. Otherwise, the wait begins for phones with better processors and more ram.
Sent from my C525c using Tapatalk
Modding.MyMind said:
@MidnightHarvester, my script is working great now. However, I noticed that this bogs down the device greatly. To deodex the Rom from the device will take WAY TOO LONG then if you were to do so using a descent computer. However, if merely deodexing an app here or an app there then it's fine and tolerable but not for all *.odex files at once lol.
There has to be some way to make this move along faster. Otherwise, the wait begins for phones with better processors and more ram.
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
I'm pretty sure that the scripts are only utilizing one thread (unless I'm mistaken). Is there a way in bash to start a new thread or at least call on a binary and pass over a callback function? I'll have to look into it.
When I deodexing my /system/priv-app folder I just let it run overnight. There isn't anything really in the script I can do to speed things up much as the majority of the work is being used during the baksmali and smali calls.
That's one reason I didn't echo any output like your script did which I really wanted to but I've found that things tend to run faster without output being sent to stdout. Might not be a huge hit but...
Maybe if I an get it to deodex in recovery nobody would be competing for resources? Definitely keep updated on the thread as this isn't anywhere near done yet.
I'm glad I found somebody else working on this. For a while I thought no one was that interested since there has been PC tools to do this for ages. Problem is for some (like myself) is that THIS is my PC .
I'm trying to think on how to speed things up and drawing a blank. There aren't enough odex files in all of /system for there to be issued with looping. I think the baksmaling and smaling just take time. Take a look at Matt's old Privacy Blocker app (same Matt that developed xUltimate deodex tools on PC). It takes ages to baksmali and smali there as well.
My first early version though was even worse. I actually was decompiling resources as well in the archive and creating a smali folder and moving the decompiler source as well into there and recompiling the entire apk/jar lol. Don't ask me why.
I need to borrow an idea from you as well and let the user set API level. Normally omitting it should be fine (defaults to latest doesn't it?) but having the choices might help of anyone comes across a picky app.
In the meantime if deodexing am entire folder I'd recommend just doing it at night while you sleep. If you can, use a tool to enable all four cores and set all cores to performance mode and leave the Ax plugged in. *shrugs* I have AIDE installed so if I can get into the baksmali/smali source code maybe I can at least have a look.
Edit: I'm running a multithreading test now. You can run a command in another thread by placing '&' after the command. If it works I'll update.
@MidnightHarvester, I too use my device as it were my own computer which is why I make up the things which I do lol. Seems we have much in common. I actually learned about the idea of using multithreads with '&' just the other night as I was researching for ways to optimize my script. Another method is to use 'wait' which will put any future commands on hold until the current one is finished. That should out less stress on the cpu. Another idea is to limit the use of pipes. The more pipes being implemented the more usage the cpu has to dish out.
I believe flashing and running this in the recovery may speed this up as you mentioned that it would required less resources being used during operations, but the question is how much would the improvement be lol.
Keep me updated with using multithreads and feel free to take away whatever you find to be useful from my deodex script.
Expect many future changes to it to optimize it as much as possible.
In addition, using 'while read line' can increase the performance on speed if the following commands afterwards are not causing an overhaul.
Sent from my C525c using Tapatalk
---------- Post added at 03:10 PM ---------- Previous post was at 03:04 PM ----------
I will be pushing my project to my github later on today. Will be easier to keep up with any changes I make. Will take note in README.md that the project is still in development and to use with GRAVE caution lol.
Sent from my C525c using Tapatalk
---------- Post added at 03:13 PM ---------- Previous post was at 03:10 PM ----------
It's ashame I don't currently have any way to build the smali/baksmali sources from my phone.
Need to look in to it and see if any flags could optimize the final build to produce a more proficient workload in performance.
Sent from my C525c using Tapatalk
So, I am working on getting my project to work in the recovery. Looks like some troubleshooting is in store.
From my recovery.log:
Code:
about to run program [/tmp/deodex.sh] with 1 args
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "busybox"; caused by library "libc.so" not found
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "busybox"; caused by library "libc.so" not found
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "busybox"; caused by library "libc.so" not found
Detected API level
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "busybox"; caused by library "libc.so" not found
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "sort"; caused by library "libc.so" not found
Deodexing finished
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "busybox"; caused by library "libc.so" not found
run_program: child exited with status 1
Sent from my C525c using Tapatalk
---------- Post added at 05:33 PM ---------- Previous post was at 05:00 PM ----------
Resolved my problem. Export path for sbin was being overwritten by the script so it prevented busybox from being used. To resolve it you just need to insure that sbin is included to the path as well.
Edit: this was tested with TWRP
PHP:
export LD_LIBRARY_PATH="/sbin":"/tmp/jvm/java-7-openjdk-armhf"
Sent from my C525c using Tapatalk
:cyclop
Modding.MyMind said:
I like your idea about making a flashable zip once it is done. I have it working now.
I made a small typo which resolved my earlier problem.
I used "smalibaksmali_dir" as my variable which pointed to the smali directory.
However, later in my script I spelled 'bak' with a 'c' - smalibacksmali_dir.
I will keep you posted man. I was shocked when i found your thread because prior to I had spoken with a relative about my project and how it appeared no one had done this. Then I found you lol. Kudos for your work bro.
Sent from my C525c using Tapatalk
---------- Post added at 07:54 PM ---------- Previous post was at 06:58 PM ----------
Here is a screenshot with my personal script/project running.
Sent from my C525c using Tapatalk
Click to expand...
Click to collapse
No probs cyclops. Between family I don't get a chance to get on hereuch but that's all changing here Very soon. I really glad you're taking off where i left off. I saw that there's a GUI out now I haven't read the thread yet so not sure if it's your work or not, but I'm glad others are running with it. Beauty of open source. I rewrote a lot and published to github under GPL but unfortunately during the rewriting I broke something and haven't been back to fox it yet.
I need to as yje code is streamlined as well as being on github open where all can see and make commits. I would get on that but it seems the GUI version has taken off and this is more for legacy but who knows
I also noticed someone else had a btch deodex script published on github though no as robust but I should have borrowed off him instead of reinventing the wheel. Too bad I didn't see that until later.
Inteied my luck at multithreading the shell commands but that would require a LOT of counters keeping track of example which processes are still decompiling and which are recompiling to avoid collisions, so I lwdr it be for now. And now that the GUI is out maybe ibcan lend a hand there if needed.
Is the GUI just a command line GUI or an actual app?I'll look when done reading. If it's an actual app multithreading would be much easier and i wouldn't mind helping out on the team. If its a shell GUI like old Windows apktool versions I commend you. Takes patience to mundnely write out the interface
Either way glas there's interest and happy others with more time to devote can carry on.
@MidnightHarvester
Hello sir,
I'm trying to decompile settings.apk with apktool for android. It won't do it correctly, and I'm wondering if it's because it should be deodexed first. The only 2 I've been able to recompile are htc-resources.apk and framework-res.apk on HTC Evo 3D 4.0.3ics
That's first question, will be able to recompile settings after deodex?
I don't understand this command,
. /system/bin/bdt
bbdth-smali
Are these on one line, separate?
I'm fairly new to modding, will you help me please?
The commands listed, when pasted into terminal, errors a lot. Using SManager to run works, but what is got from it isn't a deodexed app.-
When running batch-deodex(I'm using bdt from v.1.1.0 because it throws out several errors with bdt from v.1.2.0, I haven't looked through it, so I'm not sure if it's just not echo ing them), well, first I put the settings.apk in files-to-deodex folder, create odex of it in apktool(is this right thing to do?) Settings.odex is created in same folder, then ran batch-deodex.
The exact same settings.odex is placed into files-to-baksmali. And same settings.apk is placed in deodexed-out. In the dex-out folder are same 2 files called classes.dex and Settings.dex. and in the smali-source is Settings folder with a boat load of smalis.
After it's done:
exec sh '/system/bin/batch-deodex'
in/batch-deodex' <
rm failed for -rf, No such file or directory
rm failed for -f, No such file or directory
cp: can't stat '/sdcard/BDT/files-to-deodex/*.jar': No such file or directory
rm failed for -f, No such file or directory
rm failed for -f, No such file or directory
rm failed for -f, No such file or directory
rm failed for -f, No such file or directory
rm failed for -f, No such file or directory
And here's the log
Error occured while loading boot class path files. Aborting. org.jf.util.ExceptionWithContext: Cannot locate boot class path file /system/framework/conscrypt.odex at org.jf.dexlib2.analysis.ClassPath.loadClassPathEntry(ClassPat h.java:217) at org.jf.dexlib2.analysis.ClassPath.fromClassPath(ClassPath.jav a:161) at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:59) at org.jf.baksmali.main.main(main.java:274)
What am I doing wrong?
How do I get to having deodexed app?
Sent from above using xparent tapatalk blue

Categories

Resources