Index
Edify or Updater-Script tutorial in 1st Post
Device specific fixes for vision in first post
Build.prop tweaks in 1st Post
MIUI Porting Guide In 1st Post
Sense 4.0/3.5 prting Guide in 2nd Post
Icecoldsandwich port | LewaOS Port | AOKP Port in 3rd Post
Hi,
First of all this thread is a compilation of all possible resources I am able to find from all possible sources.
Big credits to proxuser for his general MIUI rom porting guide, thanks to cjward for helping me out fix the Autorotation issue, Autobrightness Levels and for adding additional symbols to the "sym" key and big thanks to dekky to help me fix the "libandroid.runtime.so" error.
I've tried to cover all the basic aspects of ROM porting and modding including using smali/backsmali and modding apks with the help of apktool. I hope it will help those who are wiling to learn.
I request all the devs around there to take a look and suggest what else I can add there to make it more friendly.
Ok so there it is:
Here is the Updater-Script tutorial : Credits to Edify scripting from E. Pete Karelis and Free your android for original guides from where I learnt this.
Code:
[B]Function Name: mount[/B]
Function Syntax: mount(fs_type, partition_type, location, mount_point)
Parameter Details:
fs_type = "yaffs2" | "ext4"
partition_type="MTD" | "EMMC"
location = partition | device
mount_point = target folder to mount FS.
Action: Mounts a filesystem to the defined mount point
Returns: The mount point if successful, null if failed
[B]Function Name: is_mounted[/B]
Function Syntax: is_mounted(mount_point)
Parameter Details: mount_point = string, mount point to check if is mounted
Action: Checks if a filesystem is mounted.
Returns: The mount point if mounted, otherwise, returns null
[B]Function Name: unmount[/B]
Function Syntax: unmount(mount_point)
Parameter Details: mount_point = string, mount point to unmount
Action: Unmounts the filesystem
Returns: The mount point that was dismounted if successful, otherwise it returns null
[B]Function Name: format[/B]
Function Syntax: format(fs_type, partition_type, location)
Parameter Details:
fs_type = string,"yaffs2" | "ext4"
partition_type= string, "MTD" | "EMMC"
location = string, partition | device
Action: Formats a filesystem as specified
[B]Function Name: delete[/B]
Function Syntax: delete(file1, file2, ..., fileN)
Parameter Details: string, file to delete
Action: Deletes a file. Must specify at least one file; multiple files can be specified as multiple arguments
[B]Function Name: delete_recursive[/B]
Function Syntax: delete_recursive(dir1, dir2,...,dirN)
Parameter Details: string, directory to recursively delete
Action: Deletes a folder and all of its contents. At least 1 directory must be specified; multiple directories can be specified as additional arguments.
[B]Function Name: show_progress[/B]
Function Syntax: show_progress(frac, sec)
Parameter Details:
frac = fraction of progress completed
sec = total seconds
Action: Displays flashing progress in the recovery system
[B]Function Name: set_progress[/B]
Function Syntax: set_prograss(frac)
Parameter Details: frac=fraction of progress
[B]Function Name: package_extract_dir[/B]
Function Syntax: package_extract_dir(package_path, destination_path)
Parameter Details:
package_path = string, directory in package to extract
destination_path = string, target point to extract files to
Action: Extract the all of the files in a directory in the package to the target specified.
[B]Function Name: package_extract_file[/B]
Function Syntax:
package_extract_file(package_path)
or
package_extract_file(package_path, destination_path)
Parameter Details:
package_path = string, file in the package you want to extract
destination_path, target folder to extract the file to.
Action: Extracts a single file from your update package to the target specified
[B]
Function Name: file_getprop[/B]
Function Syntax: file_getprop(file, key)
Parameter Details:
file = string, filename to check
key = string, key in file to return the value of
Action: Checks for a value in a file?
[B]Function Name: symlink[/B]
Function Syntax: symlink(target, src1, src2, ..., srcN)
Parameter Details:
target = string, the target of the symbolic link
srcX = the symbolic link to create that points to the target
Action: Unlinks any existing symbolic links before creating the new symbolic links.
[B]
Function Name: set_perm[/B]
Function Syntax: set_perm(uid, gid, mode, file1, file2, ..., fileN)
Parameter Details:
uid = user id
gid = group id
mode = permission mode
fileX = file to set permission on
Action: Sets permissions of a file or set of files specified. At least one file must be specified (the first four parameters are required)
[B]Function Name: set_perm_recursive[/B]
Function Syntax: set_perm_recursive(uid, gid, dirmode, filemode, dir1, dir2, ...dirN)
Parameter Details:
uid = user id
gid = group id
dirmode = permission to set to directories contained within the specified directory
filemode = permission to set to files contained within the specified directory
dirX = directory to set permission on
Action: Set permissions of a directory or set of directories and all files and folders within them. At least one directory must be specified (The first 5 parameters are required)
[B]Function Name: getprop[/B]
Function Syntax: getprop(key)
Parameter Details: key = string, the property you want the system to return
Action: This function returns the value of the property specified. This is used to query platform information from the build.props file.
[B]Function Name: write_raw_image[/B]
Function Syntax: write_raw_image(file, partition)
Parameter Details:
file - string, the source .img file to be read from
partition - string, the destination partition to write the .img file to
Description: This function writes an img file to a partition.
[B]Function Name: apply_patch[/B]
Function Syntax: apply_patch(srcfile, tgtfile, tgtsha1, tgtsize, sha1_1, patch_1, ..., sha1_x, patch1_x)
Parameter Details:
srcfile - string, source file to be patched (file to read in)
tgtfile - string, destination file to write the patched file to
tgtsha1 - string, sha1 hash of the target file as it should hash out after the patches apply properly
sha1_x - string, sha1 hash of the patch data that's to be written to the target file
patch1_x- string, actual patch to apply to the target file
Action: This function is used to apply patches to a file.
[B]Function Name: apply_patch_check[/B]
Function Syntax: apply_patch_check(file, sha1_1, ..., sha1_x)
Parameter Details:
file - string, file to check
sha1_x - hash to check for?
Action: Either checks if a file has been properly patched, or checks if a file can be patched. Need to check the source code of the "applypatch_check" function that is called from here.
[B]Function Name: apply_patch_space[/B]
Function Syntax: apply_patch_space(bytes)
Parameter Details: bytes = number of bytes to check for
Action: Checks the cache to verify that there is enough space to write the patched files to it and returns something. Need to test this function to verify.
[B]Function Name: read_file[/B]
Function Syntax: read_file(filename)
Parameter Details: filename - string, the filename to read the contents of
Action: This function returns the contents of a file.
[B]Function Name: sha1_check[/B]
Function Syntax:
sha1_check(data)
or
sha1_check(data, sha1_hex, ..., sha1_hexN)
Parameter Details:
data - the contents of file to calculate the sha1 hash of - must be in the read_file format
sha1_hexN - A particular sha1_hex string that you want the file data to match
Action: If only data is specified, then the function returns the sha1_hex string of the data. The optional parameters are used if you want to verify that the file you are checking for is one of a list of hashes. It reutrns the hash it matches, or returns nothing if it doesn't match any of the mentioned hashses.
[B]Function Name: ui_print[/B]
Function Syntax: ui_print(msg1, ..., msgN)
Example : ui_print("===============================================");
to print ===============================================
Parameter Details: msg - String, message to be outputted to the user during the patch process
Action: This function prints/echos a message to the console while the script is running. At least 1 parameter needs to be specified, you can specify additional msg parameters and they will be concatenated to the output.
Function Name: run_program
Function Syntax: run_program(prog, arg1, .., argN)
Parameter Details:
prog - string, program to execute
argN - string, arguments for the program that is being executed
Description: Executes a program with the arguments specified. Returns a string, I assume it is the buffer of the stdout of the program executed, need to test.
[B]Function Name: ifelse[/B]
Function Syntax: ifelse(condition, truecondition, falsecondition)
Parameter Details:
condition - an expression to evaluate
truecondition - Edify script block to execute if true
falsecodnition - Edify script block to execute if false
Description: This is the if-then construct of the Edify scripting language. The truecondition or falsecondition arguments can be a single edify command or a script block. Script blocks can be formed by enclosing the parameter with parenthesis, and seperating the commands with semicolons\
[B]Function Name: abort[/B]
Function Syntax: abort()
Parameter Details: no paremeters
Description: Aborts script execution.
[B]Function Name: assert[/B]
Function Syntax: assert(condition)
Parameter Details: condition - boolean
Description: If condition evaluates to false, stops script execution, otherwise continues processing.
Here is some device specific instructions :
mmcblk0p25 refers to system partition of the device
mmcblk0p26 refers to data partition of the device
mmcblk0p27 refers to cache partition of the device
Refer to following if you get error during flashing in recovery :
Error 6 : The updater-script is not in proper unix format (Happens when you edit file in windows)
More to come
Keyboard Fix:
Since Desire Z has a keyboard, we need to modify the android.policy.jar to tell it the lid open state.
Here's what you need to do (thanks cjward):
FIX KEYBOARD ROTATION AND AUTO ROTATE :
Go into android.policy.jar\smali\com\android\internal\poli cy\impl\PhoneWindowManager.smali
Code:
ORIGINAL
.line 1094
const/4 v1, 0x1
CHANGE TO
.line 1094
const/4 v1, 0x0
ORIGINAL
.line 1096
const/4 v1, 0x0
CHANGE TO
.line 1096
const/4 v1, 0x1
These line number need not be same, but what you need to notice is that these states will differ with a value of 2 and it should have a comment :
<------------ mLidOpen .....
To search this line, hit "ctrl + f" and type "const/4 v1, 0x1", probably in one or two hits, you will get to this.
If it doesn't gets fixed by this then you need to make one more modification:
(thanks NeverGone\RU for pointing this out)
Change the following line in framework-res/res/values/bools.xml:
<bool name="config_forceDisableHardwareKeyboard">true</bool>
Setting this value to false fixed the keyboard issue completely.
Trackpad Wake : (big thanks to lms24 for pointing this out):
Open libinput.so with a hex editor and search for these 4 numbers: A1 F5 88 72. Change the 88 to 89 and save it.
Decompile android.policy.jar. open keyguardviewmediator.smali and fo down to method "isWakeKeyWhenKeyguardShowing(IZ)Z"
You need to modify the 0x18 and 0x19 values to enable tp wake.
If you want volume rocker wake also then just delete the lines of 0x18 and 0x19.
I haven't been able to figure out exactly what you need to do to enable only tp wake and not the volume rocker, so for time being just swap the above listed method from a rom which has got working tp-wake, like Sabsa bliss by lms24 for sense 3.6 and Gen.Y R3 for Sense 4 roms.
The method should look like this:
Code:
.method public isWakeKeyWhenKeyguardShowing(IZ)Z
.locals 3
.parameter "keyCode"
.parameter "isDocked"
.prologue
const/4 v2, 0x0
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "tweaks_lockscreen_volumekey"
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-nez v0, :cond_0
.line 1242
sparse-switch p1, :sswitch_data_0
goto :goto_0
.line 1273
:cond_0
sparse-switch p1, :sswitch_data_1
:goto_0
const/4 v0, 0x1
move p2, v0
.line 1269
.end local p2
:goto_1
:sswitch_0
return p2
.line 1265
.restart local p2
:sswitch_1
sget-short v1, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S
const/16 v2, 0x1c
if-eq v1, v2, :cond_1
sget-short v1, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S
const/16 v2, 0x89
if-ne v1, v2, :cond_2
.line 1269
:cond_1
move p2, v0
.line 1263
goto :goto_1
.line 1265
:cond_2
const/4 p2, 0x0
goto :goto_1
.line 1238
nop
.line 1242
:sswitch_data_0
.sparse-switch
0x18 -> :sswitch_0
0x19 -> :sswitch_0
0x1b -> :sswitch_1
0x4f -> :sswitch_1
0x55 -> :sswitch_1
0x56 -> :sswitch_1
0x57 -> :sswitch_1
0x58 -> :sswitch_1
0x59 -> :sswitch_1
0x5a -> :sswitch_1
0x5b -> :sswitch_1
0x7e -> :sswitch_1
0x7f -> :sswitch_1
0x82 -> :sswitch_1
0xa4 -> :sswitch_0
0xe4 -> :sswitch_1
.end sparse-switch
.end method
Build.prop Common Tweaks : Credits blindnumb
Code:
# Fast Reboot
persist.sys.purgeable_assets=1
# Increasing The Video Recording Quality
ro.media.enc.hprof.vid.bps=8000000
# Screen Rotate To 270 degree
windowsmgr.support_rotation_270=true;
# Increase VM Heap Size(resolve some fc's)
dalvik.vm.heapsize=64m
# Render UI With GPU
debug.sf.hw=1
# Increasing It Will Make Mobile Smoother
windowsmgr.max_events_per_sec=150
# Video Acceleration Enabled
video.accelerate.hw=1
# Increase Performance
debug.performance.tuning=1
# Disable Sending Usage Data
ro.config.nocheckin=1
# Deeper Sleep/Better battery life
ro.ril.disable.power.collapse=1
pm.sleep_mode=1
# Ringing Will Start Immediately
ro.telephony.call_ring.delay=0
# Disable Error Checking
ro.kernel.android.checkjni=0
# Increase Quality Of MediaStreaming
media.stagefright.enable-meta=true
media.stagefright.enable-scan=true
media.stagefright.enable-http=true
media.stagefright.enable-record=false
# Disable BootAnimation
debug.sf.nobootanimation=1
#Force To Remain Launcher In Memory
ro.HOME_APP_ADJ=1
# Disable Waking Up Of Phone By Volume Buttons
ro.config.hwfeature_wakeupkey=0
# Off The Proximity Quiclky After Call
mot.proximity.delay=25
# Signal Tweaks
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5
# NetSpeed Tweaks
net.tcp.buffersize.default=4096,87380,256960,4096, 16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,163 84,256960
# Google DNS Tweak
net.rmnet0.dns1=8.8.8.8
net.rmnet0.dns2=8.8.4.4
net.dns1=8.8.8.8
net.dns2=8.8.4.4
# Photo And Video Quality
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
ro.media.enc.jpeg.quality=100
# Touch Responsiveness
debug.performance.tuning=1
video.accelerate.hw=1
# Scrolling Responsiveness
windowsmgr.max_events_per_sec=500
# Power Save Tweaks
ro.ril.disable.power.collapse=1
pm.sleep_mode=1
# Disables Debug Icon On Status Bar
persist.adb.notify=0
For a more complete list, Visit his website, click here.
Its a huge collection of resources and tutorials so do visit it.
Step 1:
You need to choose you base and the rom you want to port. Prefer to choose a rom which shares the same brand or if possible shares the same chipset as HTC Vision. So, choose any MIUI v4 rom from "Desire HD" if possible and If you are not able to get one, Choose one from "Desire S" or "Nexus One" or "Desire".
I would recommend MIUI-Au, since I found their english translations are best but it is not getting updated regularly, so you are free to choose your base rom.
Here is the link to some MIUI ICS roms which you could port:
MIUI-Au for HTC Desire
Dekky's MIUI ICS for Desire HD
MIUI-us ICS for Desire HD
MIUI-us ICS for Nexus One
Choose any cm9 or ics AOSP or AOKP rom as your base for the port here are a few roms you could use as your base are :
Andromadus Audacity Beta 2
Virtuous Quattro RC3
Virtuous Quattro RC4 leak
So, you grabbed some or all of these roms, lets get to the next step.
Step 2 :
Replace complete folders (those noted below) of your base rom with the MIUI one :
system/app
system/framework
Step 3:
Go to /system/lib :
copy "libandroid_runtime.so" lib from miui 4 (rom you port). without this file rom will not boot. if you get bootloop, try with base "libandroid_runtime.so" file.
If it still doesn't boot, then look at the end of the post, you need to add some modifications to your framework.jar which i'll take at the end of the post.
copy "liblbesec.so" from miui 4 to /system/lib and open the updater-script of your base rom with "notepad++" on windows or with "gedit" on linux and add the following line to it :
set_perm(0, 0, 0755, "/system/lib/liblbesec.so");
(for superuser app from miui work)
copy "content-types.properties" file to /system/lib
Step 4:
replace /system/media folder with base rom (that themes, wallpaper, audio from miui work)
Step 5:
copy "telocation.db" and "yellowpage.db" to /system/etc folder.
Step 6:
copy "invoke-as" from miui4 rom to /system/xbin and give it permissions on updater-script
set_perm(0, 0, 06755, "/system/xbin/invoke-as");
(for backup & themes app work)
Step 7:
change values from build.prop (edit with notepad ++)
ro.build.id=MIUI
ro.build.display.id=MIUI
ro.build.version.incremental=2.x.x (version number)
ro.config.ringtone=MI.ogg
ro.config.notification_sound=FadeIn.ogg
ro.config.alarm_alert=GoodMorning.ogg
ro.config.sms_received_sound=FadeIn.ogg
ro.config.sms_delivered_sound=MessageComplete.ogg
Step 8 :
SInce Desire Z has a keyboard, we need to modify the android.policy.jar to tell it the lid open state.
Here's what you need to do (thanks cjward):
FIX KEYBOARD ROTATION AND AUTO ROTATE :
Go into android.policy.jar\smali\com\android\internal\poli cy\impl\PhoneWindowManager.smali
Code:
ORIGINAL
.line 1094
const/4 v1, 0x1
CHANGE TO
.line 1094
const/4 v1, 0x0
ORIGINAL
.line 1096
const/4 v1, 0x0
CHANGE TO
.line 1096
const/4 v1, 0x1
These line number need not be same, but what you need to notice is that these states will differ with a value of 2 and it should have a comment :
<------------ mLidOpen .....
To search this line, hit "ctrl + f" and type "const/4 v1, 0x1", probably in one or two hits, you will get to this.
If you have no idea what I'm talking about then read carefully.
You need to extract android.policy.jar from MIUI rom and decompile it using backsmali.
Go here and download "smali-1.3.2.jar" and "backsmali-1.3.2.jar".
Put them in the same folder you put your extracted android.policy.jar. Then open cmd.exe and browse to that folder and hit the command:
Code:
java -jar baksmali.jar -a 15 -x android.policy.jar -o classout
It'll give you a folder named "classout" once it has finished decompiling. Now open that folder and browse to the file mentioned above.
Edit the values and then return back to your command windows and hit the command:
Code:
java -Xmx512M -jar smali.jar -a 15 classout -o classes.dex
It'll give you a file named classes.dex.
Now open "android.policy.jar" with 7zip:
Right click on the file --> hit 7zip --> Open archive.
Then drag the classes.dex you created into the window which appeared.
It'll replace the old classes.dex in android.policy.jar
Now use this file for your port.
Step 9:
Now we need to add some modifications to "framework.jar" to add more symbols to the "sym" key and to get the rom boot in case it gets into bootloop with all the available "libandroid.runtime.so" from both MIUI roms and the base rom.
EXTRA SYMBOLS ON "SYM" KEY
Again as explained above, decompile framework.jar and browse to the file mentioned below:
framework.jar\smali\android\text\method\QwertyKeyListener.smali
Code:
ORIGINAL
const-string/jumbo v2, "\u2026\u00a5\u2022\u00ae\u00a9\u00b1[]{}\\|"
CHANGE TO
const-string/jumbo v2, "$\u00a5\u2022\u00ae\u00a9\u00b1[]{}<>`^\\|"
This will add some extra symbols on the "sym" key.
Now to get the rom boot in case it is not booting with available "libandroid.runtime.so".
Use the "libandroid.runtime.so" from the base rom and do the following modifications:
decompile you base rom "framework.jar" and MIUI "framework.jar" and do the following:
swap Power.smali, Paint.smali, MediaRecorder.smali, GLES20Canvas.smali, PowerManager*.smali... from base framework.jar to MIUI framework.jar
Then recompile it as mentioned above how to recompile jar files and use it in your port. (If it's still not booting then get a logcat to know the error)
Step 10 :
Now to fix the autobrightness values to the correct level, you need to do the following:
Obtain framework-res.apk from the MIUI rom and decompile it using apktool. If you don't know how to do that then read below or skip to next section.
Here is the link to different apktools:
apktool used by cjward : Click here
apktool used by lyapota : Click here
I use a different technique to get things done (thanks to galaxynexusforums):
Download the package of different apktools from here.
Extract these files and the apk you want to mod in the same folder.
Open cmd.exe and browse to that folder.
Install the latest android sdk and grab the latest "aapt.exe" from it. For me, the folder is : C:\Android\android-sdk\platform-tools
Now hit the follow command :
Code:
java -jar apktool_1_4_2.jar if framework-res.apk
(you need to rename apktool.jar.1.4.2 to apktool_1_4_2.jar and similarily apktool.jar.1.4.3 to apktool_1_4_3.jar)
Code:
java -jar apktool_1_4_2.jar d framework-res.apk
Now do the modding as stated below:
AUTO BRIGHTNES AND KEYBOARD LIGHTS FIX:
browse to the file "framework-res.apk\res\values\arrays.xml"
Code:
ORIGINAL
<integer-array name="config_autoBrightnessLevels">
<item>200</item>
<item>400</item>
<item>1000</item>
<item>3000</item>
CHANGE TO
<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>
ORIGINAL
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>35</item>
<item>55</item>
<item>70</item>
<item>70</item>
<item>250</item>
CHANGE TO
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>89</item>
<item>89</item>
<item>126</item>
<item>164</item>
<item>164</item>
<item>164</item>
<item>187</item>
<item>210</item>
<item>233</item>
<item>255</item>
ORIGINAL
<integer-array name="config_autoBrightnessButtonBacklightValues">
<item>255</item>
<item>255</item>
CHANGE TO
<integer-array name="config_autoBrightnessButtonBacklightValues">
<item>30</item>
<item>30</item>
<item>30</item>
<item>30</item>
<item>0</item>
<item>0</item>
<item>0</item>
ORIGINAL
<integer-array name="config_autoBrightnessKeyboardBacklightValues ">
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
CHANGE TO
<integer-array name="config_autoBrightnessKeyboardBacklightValues ">
<item>255</item>
<item>255</item>
<item>255</item>
<item>255</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
<item>0</item>
After changing these values, hit the following command in the command window:
Code:
java -jar apktool_1_4_3.jar b framework-res
It'll take a while to complete. If it gives you error, try with different versions of apktool.
Once you are done:
Go to "framework-res\dist" and right click on the framework-res.apk you find there.
Now ---> 7zip ---- > Open archive
Now copy the resource.arsc from there to your desktop.
Open you original framework-res.apk via 7zip in the same manner as stated above and replace the default resource.arsc file with the once from your desktop.
Use this modded framework-res.apk in your port.
Step 11:
Now you have completed you port. Now zip the file and sign it with the help of dsixda kitchen.
If you don't know how to do so, go there.
If you don't want to get you hands dirty with dsixda kitchen, then just open your base rom with "winrar" or "7zip" and swap the files and mods stated above.
Your ROM is now ready to be flashed.
Credits :
proxuser
cjward
dekkyy
galaxynexusforums
lyapota for his apktool
Sense 4.0 and 3.5 Porting Guide
Use this guide written by proxuser to Port Sense 4.0 roms :
http://forum.xda-developers.com/showpost.php?p=24021776&postcount=3
and this guide for porting Sense 3.5 roms :
http://forum.xda-developers.com/showpost.php?p=24021769&postcount=2
If you are porting a rom from Desire HD, all the files which need to be swapped can be found at:
http://elektro-instal.com/napior/3.5 port tools.zip
This will give you unity kernel.
Use IceZSense or IceSenseWich for device files.
The following device specific changes are needed:
Use android.policy.jar from IceZSense or IceSenseWich for now as a base for Sense 4.0. I'll add directions on how to mod it manually later.
Instead of choosing gps.saga.so use gps.vision.so
lights.saga.so --> lights.vision.so
sensors.saga.so ----> sensors.vision.so
Swap modules folder from IceZSense or IceSenseWich.
Follow the guide and instead of saga files, copy vision files from IceZSense or IceSenseWich.
I'll add any further device specific changes if needed later.
Till then If you get stuck, ask in the thread and I'll try to answer it.
Similar steps are needed for porting Sense 3.5 too.
I recommend following roms to port, since they look good to me but you are free to choose yours.
CoolDroid 3.0
Primo-S 3.4
Credits :
proxuser
cjward
blk_jack for keymap fix (Will soon add my own fix for sense roms as soon as my exams get over)
Icecoldsandwich port | LewaOS Port | AOKP Port
First of all use cyanogenmod 9 RC 0 as base because andromadus is cause bootloops.
IceColdSandwich Port:
Take CM9 as base..
Remove app , media and framework folder from base rom..
Copy above folders from IceColdSnadwich to base ROM
Now Tough Thing !!
Sit Patiently and see what lib modules(*****.so) files are missing from base rom..
Copy all missing libraries to base ROM from IceColdSnadwich.
You need to make similar changes to android.policy.jar as suggested above for MIUI rom to fix autorotation.
If you can't get it to work. Then first get the rom booting then post the android.policy.jar you are using in your port, I'll make the required changes for you.
Similar steps are needed for LewaOS and AOKP project.
You can use the following roms to port:
IceColdSandwich
BlindLewa
AOKP (BlindIce)
If the above process doesn't works for you, try the following :
Code:
extract icecold sandwich content with kitchen.
Now swap these files :
Overwrite /system/etc with that from cm9 one
now look for files which are not in cm9 and add them manually from Icecold sandwich.
Swap /system/bin from cm9 one
Swap /system/lib
swap boot.img
swap /system/usr
chnage the following lines in build.prop:
ro.product.model=
ro.product.brand=
ro.product.name=
ro.product.device=
ro.product.board=
ro.product.cpu.abi=
ro.product.cpu.abi2=
ro.product.manufacturer=
ro.product.locale.language=
wifi.interface=
debug.sf.hw=1 (ALWAYS =1)
windowsmgr.max_events_per_sec=
with vision one.
In init.d folder delete all files except sysctl and 00banner...
Credits :
Blindnumb for helping port BlindIce
vampire36 for helping port IcecoldSandwich
Is this to port audacity as well?
Sent from my HTC Vision using XDA
jspina said:
Is this to port audacity as well?
Sent from my HTC Vision using XDA
Click to expand...
Click to collapse
I've tested till audacity beta 1, don't know about beta 2. Test and see, if you get stuck in bootloop, try to get a logcat.
ajhavery said:
I've tested till audacity beta 1, don't know about beta 2. Test and see, if you get stuck in bootloop, try to get a logcat.
Click to expand...
Click to collapse
Ok. Thanks I tried it with proxusers guide which is basically this without getting into any jar files or anything like that. I will try tonight and let you know but I wouldn't post the Rom if it works because I think you are working on it.
Sent from my HTC Vision using XDA
studying ,thank you. ^_^
YESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYESYES!!
<3 ajhavery
Wow. Thank you for the guide! This is more what I imagine XDA being like: a public forum for sharing knowledge, not keeping arcane secrets. Not pointing any fingers, of course. Our device has always had great and helpful devs.
This will not only help many aspiring devs to learn much about porting, but it also gives the users great perspective on the work involved in getting stuff working.
Awesome.
Sent from my HTC Vision using XDA
jspina said:
Ok. Thanks I tried it with proxusers guide which is basically this without getting into any jar files or anything like that. I will try tonight and let you know but I wouldn't post the Rom if it works because I think you are working on it.
Sent from my HTC Vision using XDA
Click to expand...
Click to collapse
I have written this guide to let someone take the development for the time being because I'm having my exams from monday till may 1st, after that I'm going on vacation for a week with my friends and after that I've to go for my summer internship. So, due to extremely busy schedule of mine, I would love to see any work from you.
I have got the rom booting with audacity beta 1, my last port is based on that, so I would recommend working on audacity beta 2 and If it is very hard then you can use files from my last release of MIUI-Au port, to get the rom booting.
It you get stuck, try to get a logcat so that I could help you.
Soon, when I find time, I'll try to add a sense rom porting guide for those who want to learn.
A suggestion : Look into development forums to learn more about porting.
Those who seriously want to learn should go through this link and read everything at least twice:
http://www.kandroid.org/online-pdk/guide/index.html
ajhavery said:
I have written this guide to let someone take the development for the time being because I'm having my exams from monday till may 1st, after that I'm going on vacation for a week with my friends and after that I've to go for my summer internship. So, due to extremely busy schedule of mine, I would love to see any work from you.
I have got the rom booting with audacity beta 1, my last port is based on that, so I would recommend working on audacity beta 2 and If it is very hard then you can use files from my last release of MIUI-Au port, to get the rom booting.
It you get stuck, try to get a logcat so that I could help you.
Click to expand...
Click to collapse
OK Thanks! I may look into it but I forgot I have to draw a card for my brothers 7th birthday tomorrow(It is a tradition in my family of 5 kids to draw birthday cards), so I wont be able to look into it until way late tonight or night time tomorrow.
I really appreciate that and would love any help as I am not that great with all of this. But I will try my best
Thanks for the great guide. I already started porting MIUIv4 with proxusers guide and figured out that I need to modify the jars to get it to work. Now this will save me a lot of time to fix some bugs that I still had. This guide comes perfectly timed for the weekend.
I would really appreciate a guide to port a sense rom as I'd like to learn more about this whole thing. Thanks again and good luck for your exam.
So long
Ciddy
i hope one of u guys gets a rom ported for us soon. i miss miui and my attempt at porting it failed
Once we get a more stable ICS base, me and a friend of mine will try porting MIUI. I'm not sure which MIUI v4 port to choose from though.
magic_android said:
Once we get a more stable ICS base, me and a friend of mine will try porting MIUI. I'm not sure which MIUI v4 port to choose from though.
Click to expand...
Click to collapse
I'm in for porting but i've exams too .... can't wait till my summer vactions start on may 15th
strawmetal said:
I'm in for porting but i've exams too .... can't wait till my summer vactions start on may 15th
Click to expand...
Click to collapse
Well, i'm going to have to try and make the port before my exams in june/july. It'll be my first port but i'm pretty interested in trying it out. If i think it's daily driver material and is worth releasing, i'm gonna go for it.
---------- Post added at 04:41 PM ---------- Previous post was at 03:45 PM ----------
Well, i realised i had some free time today, so i started trying to port thishttp://forum.xda-developers.com/showthread.php?t=1512565 to our phones.
I got up to step 8 and then ended up with a whole bunch of values that i couldn't find or match in the way that the guide instructed. I have no prior experience in porting or developing, but i am willing to learn. So if anyone knows how to help me, feel free to PM me. Btw, i managed to decompile the android.policy.jar file but from that point, when i went to edit PhoneWindowManager.smali, i couldn't find any matching values between what was listed in the guide and what i was seeing on my screen in notepad++, so i didn't know what to change in there.
magic_android said:
Well, i'm going to have to try and make the port before my exams in june/july. It'll be my first port but i'm pretty interested in trying it out. If i think it's daily driver material and is worth releasing, i'm gonna go for it.
---------- Post added at 04:41 PM ---------- Previous post was at 03:45 PM ----------
Well, i realised i had some free time today, so i started trying to port thishttp://forum.xda-developers.com/showthread.php?t=1512565 to our phones.
I got up to step 8 and then ended up with a whole bunch of values that i couldn't find or match in the way that the guide instructed. I have no prior experience in porting or developing, but i am willing to learn. So if anyone knows how to help me, feel free to PM me. Btw, i managed to decompile the android.policy.jar file but from that point, when i went to edit PhoneWindowManager.smali, i couldn't find any matching values between what was listed in the guide and what i was seeing on my screen in notepad++, so i didn't know what to change in there.
Click to expand...
Click to collapse
That is what I have been porting unsuccessfully. Did you get it booting?
magic_android said:
Well, i'm going to have to try and make the port before my exams in june/july. It'll be my first port but i'm pretty interested in trying it out. If i think it's daily driver material and is worth releasing, i'm gonna go for it.
---------- Post added at 04:41 PM ---------- Previous post was at 03:45 PM ----------
Well, i realised i had some free time today, so i started trying to port thishttp://forum.xda-developers.com/showthread.php?t=1512565 to our phones.
I got up to step 8 and then ended up with a whole bunch of values that i couldn't find or match in the way that the guide instructed. I have no prior experience in porting or developing, but i am willing to learn. So if anyone knows how to help me, feel free to PM me. Btw, i managed to decompile the android.policy.jar file but from that point, when i went to edit PhoneWindowManager.smali, i couldn't find any matching values between what was listed in the guide and what i was seeing on my screen in notepad++, so i didn't know what to change in there.
Click to expand...
Click to collapse
Editing android.policy.jar is not responsible to get the rom booting though. In PhoneWindowManager.smali search for the term I've told you : const v.....
and look at the results you get.
The one you need has its counterpart after 2 line number what I mean is that, if you find const/4 v1, 0x1 at .line 1097, then you should look for its counterpart const/4 v1, 0x0 after two line numbers, i.e. at .line 1099.
If you have found it, the it is the value you need to change.
Also it should have a comment including work mLidOpen.
It's easy if you look thoroughly 2-3 line above and below it. It'll let you know if you are at correct position or not.
@jspina: Just a thought, try using the base framework.jar smali instead of MIUI one, I've never tried it but might be worth a try to get the rom booting. I mean first try using base framework.jar file in your port, if you don't find success, If you don't find success, use search in classout directory of MIUI and swap everything with media or power in its filename by their base rom framework.jar counterparts.
Post if you get stuck.
ajhavery said:
Editing android.policy.jar is not responsible to get the rom booting though. In PhoneWindowManager.smali search for the term I've told you : const v.....
and look at the results you get.
The one you need has its counterpart after 2 line number what I mean is that, if you find const/4 v1, 0x1 at .line 1097, then you should look for its counterpart const/4 v1, 0x0 after two line numbers, i.e. at .line 1099.
If you have found it, the it is the value you need to change.
Also it should have a comment including work mLidOpen.
It's easy if you look thoroughly 2-3 line above and below it. It'll let you know if you are at correct position or not.
@jspina: Just a thought, try using the base framework.jar smali instead of MIUI one, I've never tried it but might be worth a try to get the rom booting. I mean first try using base framework.jar file in your port, if you don't find success, If you don't find success, use search in classout directory of MIUI and swap everything with media or power in its filename by their base rom framework.jar counterparts.
Post if you get stuck.
Click to expand...
Click to collapse
got stuck.
should I post a log? Although I think that it just wont work. I dont really know what they did or what I am doing wrong but I dont think audacity b2 will work as a base unless I were to actually update each file individually...
Hello everyone,
It has been quite a time on xda and i found that there are a number of tweaks availble for our mini GALAXY Y especially for the status bar.
But the problem is that all these tweaks are located in different threads which makes them a lot more messy.
Therefore I present you a compilation of the common but most used tweaks for galaxy y.
THREADS WILL BE UPDATED.........SO LOOK OUT FOR NEW AMAZING TWEAKS !!!!!!!!!!!!!!
Click to expand...
Click to collapse
PLEASE PM ME IF YOU FIND ANY OTHER TWEAKS FOR OUR GALAXY Y AND I WILL ADD IT HERE
CREDITS :--
@marcussmith2626
@dcsms
@jpdesuasido
[Guide] [Mod] How to make any gingerbread or cm7 status bar transparentThere's two ways to make the statusbar bar Transparent and I'll post them both
One way works with any gingerbread rom (deodex & rooted) and one with cyanogen 7.
I have not tried it on ics or jelly bean but you can try (for people who stumble across this thread who are not galaxy y users) ..
Please dont ask for support unless you are using a custom rom on galaxy y.:good:
Any other phones please goto your own phone forum for support.
You also need a launcher that is capable of transparency .:angel:
Adw works but you need to disable wallpaper hack in settings .
Holo launcher works.
any other launcher if it doesn't work look in it's settings & try & disable wallpaper hack or manage internally .
1-)Method one for non cm
You need apk tool installed - if you don't know how to use it see marcussmith2626's guide here --
http://forum.xda-developers.com/showthread.php?t=2206938
Once you have decompiled SystemUI.apk using apk tool goto res/layout Open status_bar.xml in notepad
1.Find the following line
Code:
<com.android.systemui.statusbar.StatusBarView android:orientation="vertical" [COLOR="Red"]android:background="#000000"[/COLOR] android:focusable="true" android:descendantFocusability="afterDescendants"
Notice android:background is normally a hexadecimal value or it could be an @drawable value
either way change it to the following
Code:
<com.android.systemui.statusbar.StatusBarView android:orientation="vertical" [COLOR="Red"]android:background=" [user=3944923]@drawab[/user]le/nameofpng" [/COLOR]android:focusable="true" android:descendantFocusability="afterDescendants"
Notice that android:background is now a @drawable value
2.Detete the space between the " and the @
(the is because the forum has changed the @ to mentions and I cant work out how to stop it doing it)
3.Change nameofpng to the name of your transparent background image (just the name - do not include the file extension .png)
4.Place this image with the same name as the @drawable value in res/drawable-ldpi
(of course other devices might be in mdpi or hdpi)
5.Recompile and sign apk
Put in a flashable zip and flash with system mounted
6.You can download and use the pngs in the attachment (for ldpi like galaxy y) or create your own
To create a transparent status bar image just take a non Transparent one and edit it in a photo application to make it Transparent (make sure image dimensions stay the same and is for your phone resolution)
2-)Method two for cm7
Note you will need apk tool installed and notepad++ installed
1.Download the patcher tool by Z25
2.Unzip the contents to a folder
3.Place your SystemUI.apk and framework-res.apk in files_to_patch
4.Run patcher.bat
5.Select status bar tweaks and enable only transparent status bar
6.Edit the smali file as described in the text file that pops up
7.Select option build and sign
8.Select option to create zip files
You now have a zip file called patch.zip
Flash this in cwm to enable transparency
To actually make it Transparent you need to apply a theme with a transparent status bar
First disable wallpaper hack from adw launcher settings
Then either download a transparent Theme from playstore for theme chooser and apply in theme chooser
Or create your own theme
Goto UOT kitchenhttp://uot.dakra.lt/kitchen
Code:
1.Take cyanbread.apk from the app folder of your cm7 rom & place on pc (or any other Theme Chooser Theme you wish to make transparent)
2.Rename it to what you want to call theme
3.Upload it to kitchen (under cm7 theme in file upload)
I4.n status bar tweaks set background transparency to around 70% Transparent and any other settings you need like carrier or footer - don't forget to generate preview once done
5.Make sure you have selected ldpi in statusbar tweak settings and ldpi/mdpi for theme chooser preview in file upload (other devices may vary) and in file upload change update binary to galaxy
6.Then goto summary section
7.If everything is green create the theme
8.If not make sure you have clicked generate preview on status bar tweaks
kitchen will then create theme for you
Once it's done download it flash in cwm with system mounted & then apply it in theme chooser
here are some of the statusbar my marcussmith2626--
http://forum.xda-developers.com/showthread.php?t=2123899
r
[GUIDE]How to add EDT Tweak support on your SystemUI
Hi guys
This time I will make a tutorial on how to add "EDT" tweak support on your SystemUI:fingers-crossed::fingers-crossed:
Features of EDT Tweaks
1.Battery Options
Show/Hide Battery Icon (Doesn't work)
Battery Text Style (Regular,Hide and Small %)
Prepend/Append Battery Text
Change Charging Color (For Battery Text)
Change Regular Color (For Battery Text)
Change Medium Level Color (For Battery Text)
Change Low Level Color (For Battery Text)
2.Clock Options:laugh:
Show AM/PM
Small AM/PM
Hide AM/PM
Hide Clock
3.Signal Options
Show Signal Bars (Doesn't work)
Show Signal Strength (Not available yet)
Show dBm Text (Not released)
Bug List
1.Show/Hide Battery Icon
2.Show Signal Bars
3.Show Signal Strength
4.Show dBm Text
Click to expand...
Click to collapse
Requirements
1.EDT Files (download in attachment)
2.EDT Tweaks apk (download in attachment)
3.SystemUI.apk
4.Apktool or similar
Click to expand...
Click to collapse
How to Install
1.Download the EDT Files zip package on your Computer and extract it anywhere in your desktop
2.Now on your phone, Pull your SystemUI.apk and paste it on your sd card
3.Now connect your phone to your Computer and Connect USB Storage
4.Copy the pulled SystemUI.apk and paste it on your apktool folder
5.Decompile your SystemUI.apk (You know how to do it right?)
6.Now copy the extracted smali from the EDT Files zip package and paste it on smali/com/android/systemui/statusbar/. Replace if asked
7.Go to res/layout/ and open status_bar.xml
8.Copy this code
Code:
[COLOR="Purple"]<com.android.systemui.statusbar.BatteryText android:textAppearance="@*android:style/TextAppearance.StatusBar.Icon" android:gravity="center_vertical" android:orientation="horizontal" android:paddingRight="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" />[/COLOR]
9.Paste it belowabove this code
Code:
[COLOR="Purple"]com.android.systemui.statusbar.Clock[/COLOR]
10.Compile the SystemUI.apk (You know how to do it right?)
11.On your phone, push the SystemUI.apk to system/app using Root Explorer or similar.
12.Now install EDT.apk and you can now use it's features
rr
[GUIDE]How to add lidroid 14 statusbar toggle buttons for Galaxy YAll Credits belongs to dcsms
Please refers to lidroid original thread below
http://forum.xda-developers.com/showthread.php?t=1289896
Requirements :--
1. A Computer with JAVA DEVELOPMENT KIT [JDK] installed
2. Apktool
3. Notepad++ / other UNIX editor
4. Knowledge about how to compile/decompile apk (dont ask me.. just use the search bar.. there a bunch of tuts how to do that)
Click to expand...
Click to collapse
firstly download this file :
1. lidroid-res
http://forum.xda-developers.com/attachment.php?attachmentid=750399&d=1318661697
2. LidroidSystemUI
http://forum.xda-developers.com/attachment.php?attachmentid=750756&d=1318701014
3. QuickPanelSettings
http://forum.xda-developers.com/attachment.php?attachmentid=751238&d=1318747162
Click to expand...
Click to collapse
Procedure :--
1. Download LidroidSystemUI.apk and decompile it with apktool, then you get LidroidSystemUI dir.
2. Pull and Decompile your SystemUI.apk, copy LidroidSystemUI/smali/* into SystemUI/smali.
3. Open SystemUI/smali/com/android/systemui/status/StatusBarService.smali. Find(Ctrl + F) QuickSettingsView, change codes below
Code:
.local v3, qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
const v7, 0x7f030002
invoke-static {p1, v7, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v3
.end local v3 #qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
check-cast v3, Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
.line 352
.restart local v3 #qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
with
Code:
const v7, 0x3030003
invoke-static {p1, v7, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v3
check-cast v3, Lcom/lidroid/systemui/quickpanel/PowerWidget;
.line 352
.local v3, qsv:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v3}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
4. Compile SystemUI with apktool,
5. open up your SystemUI.apk with winrar or 7zip
6. locate to SystemUI/build/apk/ and find classes.dex onto the winrar/7zip
7. Then Push it into /system/app/
5. push lidroid-res.apk in /system/framework/, push QuickPanelSettings.apk in /system/app, reboot.
Click to expand...
Click to collapse
More mod :
Originally Posted by [email protected]
To have 6 visible toggles : edit : SystemUI/smali/com/lidroid/systemui/quickpanel/PowerWidget.smali
change :
Code:
.field private static final LAYOUT_SCROLL_BUTTON_THRESHOLD_PORT:I = 0x5
to
Code:
.field private static final LAYOUT_SCROLL_BUTTON_THRESHOLD_PORT:I = 0x6
Code:
div-int/lit8 v2, v2, 0x5
to
Code:
div-int/lit8 v2, v2, 0x6
Note: i skip editing androidmanfest.xml (cuz when we do this... we should sign all of the apk in /system/app and /system/framework. ..but if u insist.. please see the original thread above how to do that...unless if u dont do editing androidmanifest.xml u'll got FC when pressing Flashlight button. anyway i dont need it.. so its not a big deal)
DONT FORGET TO PRESS ATHANKS :laugh::laugh::laugh:
[GUIDE]BRIGHTNESS SLIDER IN STATUS BAR
UPDATE ZIP FILES FOR JELLY BLAST ND HYPERION ADDED CHK AT THE END OF POST
GUYS THOSE WHO ARE TRYING IT AFTER COMPILNG UR APP PLZ DECOMPILE AND CHK WHETHER TAT ""in"" FOLDER IS IN SMALI FOLDER
REQUIREMENTS :--
1> DECOMPILING/ COMPILING TOOL (LIKE VTS OR APKTOOL OR APKMULTITOOL OR ANY OF UR CHOICE
2>UR SYSTEMUI.APK
3>STATUSBARGREEPER( PLZ SEARCH XDA FOR ITS DOWNLOAD LINKS)
Click to expand...
Click to collapse
STEPS
1) DECOMPILE UR SYSTEMUI.APK
2)NAVIGATE TO res/layout/status_bar_expanded.xml
3) OPEN IT FOR EDITING
4) SEARCH FOR THE FOLLOWING CODE
Code:
<FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
[COLOR="Indigo"]
[/COLOR]
5) PLACE THE FOLLOWING CODE ABOVE CODE U SEARCHED ABOVE
Code:
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:paddingTop="20.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content">
<in.jmkl.dcsms.statusbargreper.SlideBrightness android:layout_width="fill_parent" android:layout_height="wrap_content" />
</LinearLayout>
6) ADD THE FOLLOWING FOLDER IN smali/*here*
DOWNLOAD HERE--
IN.ZIP
7)RECOMPILE THE THE SYSTEMUI APP ND PUSH IT........
8) RESTART UR DEVICE ND UR DONE..:
9) ND YADO INSTALL STAUSBARGREEPER APK
Click to expand...
Click to collapse
FOR JB FLASH VIA CWM--
1)HYPERION----HERE
2)JB--->>>HERE
DO VISIT THIS POST TOO
http://forum.xda-developers.com/showthread.php?t=2084127
Its much better to actually link to the orig thread and just have an index type thread instead of just posting the entire guide here
this is because threads are updated and its also much eaiser for people to get support from the person who wrote the thread then just having spam "help me" stuff here
also you didnt seek permission to repost all these guides - well at least you didnt ask me
creating a thread which indexes guides is fine and links to the thread but just copy and past the entire guide is not good
you can get an idea of what an index thread is by clicking on the link in my signature as that will take you to my index thread
Bro You Could give Links to original thread instead of re posting all guides..its look messy
Thread Closed as it is nothing but duplication of existing work present in the device forum.
A.cid
Forum Moderator
Sorry it took so long for me to write this up.
Following these steps will allow you to add the full split window implementation from the GPro2 and G3 KK roms that for whatever reason LG decided to leave (mostly) out of the stock G2 4.4.x roms. This guide is geared more towards rom devs or people that are familiar with using smali/baksmali and doing minor dalvik/smali edits.
Prerequisites:
Get smali/baksmali v2.0.3
Get a copy of the framework directory for the rom you're implementing this on
Download the source files/zip linked below
Quick notes on smali/baksmali usage:
If you're running baksmali on an odex your basic command to use for this guide is baksmali -a 19 -b -d <path/to/framework/dir> -o <path/to/baksmali/outdir> - x filename.odex
If you're working with an extracted classes.dex (i.e. from from roms that support art) it's just baksmali -a 19 -b -o <path/to/baksmali/outdir> classes.dex
The basic smali command to use for these purposes is smali -a 19 -o classes.dex <path/to/baksmali/outdir>
Step 1:
Baksmali telephony-common (from your framework dir) and find the following line in generated/ConfigBuildBase.smali:
Code:
sput-boolean v0, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z
and change the boolean to true like so:
Code:
sput-boolean v1, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z
Step 2:
Smali that file back to a new classes.dex and zip it back into telephony-common.jar
Step 3:
Baksmali com.lge.frameworks and find the same line in generated/ConfigBuildBase.smali:
Code:
sput-boolean v0, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z
and change the boolean to true like so:
Code:
sput-boolean v1, Lgenerated/ConfigBuildBase;->CAPP_SPLITWINDOW:Z
Step 4:
Open up com/lge/loader/splitwindow/SplitWindowCreatorHelper.smali and add the following to your static fields declarations:
Code:
.field private static TAG:Ljava/lang/String;
so that it will now appear as:
Code:
# static fields
.field private static SPLITWINDOW_INSTANCE:Lcom/lge/loader/splitwindow/ISplitWindow;
.field private static TAG:Ljava/lang/String;
Step 5:
In the same smali file a few lines down, you'll need to add the following to your direct methods:
Code:
const-string v0, "SplitWindowCreatorHelper"
sput-object v0, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;
so that it will now apprear as:
Code:
sput-object v0, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->SPLITWINDOW_INSTANCE:Lcom/lge/loader/splitwindow/ISplitWindow;
const-string v0, "SplitWindowCreatorHelper"
sput-object v0, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;
return-void
.end method
Step 6:
Again, in the same smali scroll all the way down as you'll need to add the following public method at the end of the file:
* keep in mind you'll need to keep a blank line between the .end method above and this new method below
Code:
.method public static recoverService()Lcom/lge/loader/splitwindow/ISplitWindow$ISplitWindowPolicy;
.registers 4
const/4 v3, 0x0
sget-object v1, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;
const-string v2, "recoverService"
invoke-static {v1, v2}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;)I
sget-object v1, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->SPLITWINDOW_INSTANCE:Lcom/lge/loader/splitwindow/ISplitWindow;
if-eqz v1, :cond_20
sget-object v1, Lcom/lge/loader/RuntimeLibraryLoader;->SPLIT_WINDOW:Ljava/lang/String;
invoke-static {v1}, Lcom/lge/loader/RuntimeLibraryLoader;->getCreator(Ljava/lang/String;)Lcom/lge/loader/InstanceCreator;
move-result-object v0
if-eqz v0, :cond_1e
invoke-virtual {v0, v3}, Lcom/lge/loader/InstanceCreator;->setDefaultInstance(Ljava/lang/Object;)V
sget-object v1, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->TAG:Ljava/lang/String;
const-string v2, "Set default InstanceCreator as null to make NEW instance"
invoke-static {v1, v2}, Landroid/util/Slog;->v(Ljava/lang/String;Ljava/lang/String;)I
:cond_1e
sput-object v3, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->SPLITWINDOW_INSTANCE:Lcom/lge/loader/splitwindow/ISplitWindow;
:cond_20
invoke-static {}, Lcom/lge/loader/splitwindow/SplitWindowCreatorHelper;->getPolicyService()Lcom/lge/loader/splitwindow/ISplitWindow$ISplitWindowPolicy;
move-result-object v1
return-object v1
.end method
Step 7:
Open up com/lge/loader/splitwindow/ISplitWindow$ISplitWindowPolicy.smali and add the following public method after the getMinimumScreenSize public method (again, minding your blank lines)
Code:
.method public abstract getRecentStackBoxes()Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/List",
"<",
"Landroid/app/ActivityManager$StackBoxInfo;",
">;"
}
.end annotation
.end method
Step 8:
Smali all of that to a new classes.dex and zip it back into com.lge.frameworks.jar
Step 9:
Put your newly modified com.lge.frameworks.jar and telephony-common.jar into place (I also re-odex them and copy the original signatures over)
Step 10:
Put all of the files contained in the download provided below into their respective directories with the proper permissions (644 all around)
Step 11:
Add the following two lines to your build.prop
Code:
ro.lge.capp_splitwindow=true
persist.splitwindow.support_all=true
* if you don't want all apps showing up in the selection window, change support_all to false
That's it...you should be good to go. There's always the possibility that your framework will be slightly different, but that's the general idea and you should be able to make small changes to adjust to your particular variant
Feel free to include this in your roms (that's why I posted it). Just give credit in your OP.
Downloads:
SplitWindow Files - G Pro 2
SplitWindow Files - G3
The only real difference between them is the color of the outline box
wow. definitely not for noobs.
thanks for sharing though. I'll try messing with it soon.
good job. thanks
if i will modify my installed pardus rom in my phone with that guide,
is it will work after xposed installer or it will cause trouble to use them both..
xposed and your guide..
should i disable xposed, modify by your guide and ten install xposed again or no need for that?
+If you could, post here a 1 or 2 screenshots..
Hope someone will make an apk installer ( like your camera) to make it working easily on stock roms!
Good job m8
Thanks mate ?
Sent from my LG-D802 using Tapatalk
Awesome sauce man, going to learn some smali now
@xdabbeb and @bender_007 brothers, please help us with either a flashable version or an apk please
Press thanks button if I was of any help / assistance to you
Apk and i make a statue in your honor
I got still stock recovery on 20b.. only rooted
rastigo said:
@xdabbeb and @bender_007 brothers, please help us with either a flashable version or an apk please
Press thanks button if I was of any help / assistance to you
Click to expand...
Click to collapse
will look into it. - but getting "your" framework directory is hard
Can't create installer for all versions. It's possible to provide for most common or these I do own. CloudyG3 for example.
bender_007 said:
will look into it. - but getting "your" framework directory is hard
Can't create installer for all versions. It's possible to provide for most common or these I do own. CloudyG3 for example.
Click to expand...
Click to collapse
Apk for stock rom 80220d and/or for cloudystock, please ? thank you
Inviato dal mio LG-D802 utilizzando Tapatalk
Dont work for me, and MagixRom
https://www.dropbox.com/s/28zrjwr1gj3ci8r/MagixWindon.zip
Enviado desde mi LG-D802 mediante Tapatalk
There would not be a feasible way to make this mod work via an apk installer without serious risk as it requires direct replacement of core framework files. This is a pretty low-level mod so if you want it, you'll have to be rooted with a custom recovery. I do not want people to put their phones into an unusable state by attempting to do this without a recovery. It's just too risky.
As for making flashable zips: this requires modification of framework that is variant/firmware specific and would need to be odexed in most situations (as there are few if any deodexed stock LG roms). This means one would need to create a large number of zips to cover every possible variant/firmware combination. A few devs had asked me to write up a guide detailing how I accomplished this so that they could incorporate it into their own roms. I had already responded to one of rastigo's PMs regarding making flashable zips. I may consider making a couple for the more popular bases (F320K21p & D80220D), but this really should be handled by your individual variant/rom devs. If they run into problems they can get in touch with me and I will help them as soon as I am able to.
I realize that this is a fairly involved guide/mod with multiple chances to make small mistakes, but when followed exactly it does work. There has even been an individual with a LG GPad who followed the guide and got it working.
xdabbeb said:
There would not be a feasible way to make this mod work via an apk installer without serious risk as it requires direct replacement of core framework files. This is a pretty low-level mod so if you want it, you'll have to be rooted with a custom recovery. I do not want people to put their phones into an unusable state by attempting to do this without a recovery. It's just too risky.
As for making flashable zips: this requires modification of framework that is variant/firmware specific and would need to be odexed in most situations (as there are few if any deodexed stock LG roms). This means one would need to create a large number of zips to cover every possible variant/firmware combination. A few devs had asked me to write up a guide detailing how I accomplished this so that they could incorporate it into their own roms. I had already responded to one of rastigo's PMs regarding making flashable zips. I may consider making a couple for the more popular bases (F320K21p & D80220D), but this really should be handled by your individual variant/rom devs. If they run into problems they can get in touch with me and I will help them as soon as I am able to.
I realize that this is a fairly involved guide/mod with multiple chances to make small mistakes, but when followed exactly it does work. There has even been an individual with a LG GPad who followed the guide and got it working.
Click to expand...
Click to collapse
Totally agree.
I will help in any way on that....
Thank you for your efforts..
how can i open the splitwindow by lmt or tasker, can you @xdabbeb make us an launcher apk for open the splitwindow and not only from the recent activity..
like that one for jb:
3rd party navigation bar support (Provided BY BlackDino) Simply point to this app
SplitViewLauncher.apk
Click to expand...
Click to collapse
source @bigfau http://forum.xda-developers.com/showthread.php?t=2544206
xdabbeb said:
There would not be a feasible way to make this mod work via an apk installer without serious risk as it requires direct replacement of core framework files. This is a pretty low-level mod so if you want it, you'll have to be rooted with a custom recovery. I do not want people to put their phones into an unusable state by attempting to do this without a recovery. It's just too risky.
As for making flashable zips: this requires modification of framework that is variant/firmware specific and would need to be odexed in most situations (as there are few if any deodexed stock LG roms). This means one would need to create a large number of zips to cover every possible variant/firmware combination. A few devs had asked me to write up a guide detailing how I accomplished this so that they could incorporate it into their own roms. I had already responded to one of rastigo's PMs regarding making flashable zips. I may consider making a couple for the more popular bases (F320K21p & D80220D), but this really should be handled by your individual variant/rom devs. If they run into problems they can get in touch with me and I will help them as soon as I am able to.
I realize that this is a fairly involved guide/mod with multiple chances to make small mistakes, but when followed exactly it does work. There has even been an individual with a LG GPad who followed the guide and got it working.
Click to expand...
Click to collapse
When I try to launch splitview I see dualwindows fc ?
Inviato dal mio LG-D802 utilizzando Tapatalk
Matt927 said:
When I try to launch splitview I see dualwindows fc ?
Inviato dal mio LG-D802 utilizzando Tapatalk
Click to expand...
Click to collapse
provide a logcat ..
can someone make an apk shortcut for the dualwindows operation, i have LMT launcher and i want to open dualwindows from the lmt..
thanks!
As said above.
Without framework core files no.
Its not so dangerous mod after all.
Just 2 jars to modify and one more to add.
If i find some time i will make a flashable zip for it tonight and a flashable revert if anything goes wrong
) ) ) G2 On Air ( ( (
Firstly I credit Urix2003 on 4pda forum for the explanation of what is wrong and how to fix it.
The problem may not be universal to all MIUI releases but the majority suffer from the same issue. I have personally proven the fix to work on 7550, 8030 and 61110.
The error is in services.jar whereby the light sensor values for autobrightness control are inadvertently reduced to just three values: 0 lux, 120 lux, 2000 lux hence, the lack of Auto Brightness Adjustment.
DEFINITELY NOT FOR NOOBS............ This thread is to provide the knowledge to skilled people to help themselves and maybe to then help others by providing their fixed files to others:fingers-crossed:
I ask that anyone providing edited files clearly states the exact version of MIUI (both date code and variant - SU, MR, EU, Stock, Global, China etc) and also provide the table values as code in their post.
To fix: Decompile Services.jar with something like TickleMyAndroid:good:
Edit services\com\android\server\display\AutomaticBrightnessController$1.smali to fix the restriction of light sensor values as follows:
find text:
Code:
iget-object v1, p1, Landroid/hardware/SensorEvent;->values:[F
const/4 v4, 0x0
aget v0, v1, v4
Add this line below the text:
Code:
goto :goto_0
Note: Label: goto_0 should lead a few lines down to: const-string v1, "AutomaticBrightnessController"
To fix the slow response time:
Edit services\com\android\server\display\AutomaticBrightnessController.smali to halve the response time to changes in brightness
find text 0xfa0, replaced by 0xfa0 (example reduces 4sec to 4sec)
iget v5, p0, Lcom/android/server/display/AutomaticBrightnessController;->mBrighteningLuxThreshold:F
cmpg-float v4, v4, v5
if-gtz v4, :cond_1
:cond_0
const-wide/16 v4, 0xfa0
find text 0x1f40, replaced by 0xfa0 (example reduces 8sec to 4sec)
iget v5, p0, Lcom/android/server/display/AutomaticBrightnessController;->mDarkeningLuxThreshold:F
cmpl-float v4, v4, v5
if-ltz v4, :cond_1
:cond_0
const-wide/16 v4, 0xfao
You can also play around with these settings with caution:
You can also mess around with these settings with caution:
# static fields
.field private static final BRIGHTENING_LIGHT_DEBOUNCE:J = 0xfa0L
.field private static final BRIGHTENING_LIGHT_HYSTERESIS:F = 0.1f
.field private static final DARKENING_LIGHT_DEBOUNCE:J = 0x1f40L (reduce to 0xfa0L 8sec --> 4sec)
.field private static final DARKENING_LIGHT_HYSTERESIS:F = 0.2f (reduce to 0.12f)
.field private static final LIGHT_SENSOR_RATE_MILLIS:I = 0xc8 (increase to 3f8 200ms --> 1sec)
To fix the brightness response to ambient light changes:
Decompile framework-res.apk then edit framework-res\res\values\arrays.xml
Edit the table to values below for a good starting point:
Code:
<integer-array name="config_autoBrightnessLevels">
<item>1</item>
<item>11</item>
<item>31</item>
<item>81</item>
<item>121</item>
<item>226</item>
<item>321</item>
<item>551</item>
<item>801</item>
<item>1251</item>
<item>2001</item>
<item>3001</item>
<item>5001</item>
<item>7501</item>
<item>13000</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>25</item>
<item>28</item>
<item>34</item>
<item>40</item>
<item>42</item>
<item>43</item>
<item>44</item>
<item>46</item>
<item>48</item>
<item>51</item>
<item>55</item>
<item>60</item>
<item>69</item>
<item>88</item>
<item>137</item>
<item>255</item>
</integer-array>
<integer name="config_screenBrightnessSettingMinimum">15</integer>
<integer name="config_screenBrightnessSettingDefault">50</integer>
Valid autoBrightnessLevels are: (add 1 for the transition to above the value)
0, 5, 10, 30, 80, 120, 225, 320, 550, 800, 1250, 2000, 3000, 5000, 5500, 7500, 13000, 24000
autoBrightnessLevels can be probed here (in hex): /sys/bus/platform/drivers/als_ps/als but it is much better to use an app that displays value in lux
LcdBacklightValues can be probed here: /sys/class/leds/lcd-backlight/brightness
WARNING: The 2 altered files are absolutely unique to every release version of MIUI so a single fix package cannot be offered.
Also, there are 3 different LCD panels used in the RN2 (but only 1 ALSPS sensor - the LTR559) which may have different brightness characteristics so values that work for 1 display, may not be ideal for another.
Thank me by all means but don't ask for help on how to decompile / recompile
O.K now you have replaced services.jar with a fixed version and maybe also a framework-res.apk with a modified brightness table.
What if you want some more adjustments?
1. Hassle the kind person who uploaded the files until they get really annoyed
or
2. Help yourself..... :good:
Here's how:
1. Create a zip file called framework-res.zip
2. Copy the attached file, theme_values.xml
3. Edit the file with your new values
4. Copy the file into framework-res.zip
5. Remove the .zip extension leaving the filename as just framework-res
6. Copy this file to /system/media/theme/default
7. Reboot
8. Re-edit theme_values.xml as many times as it takes until you have the perfect values for your phone:victory:
Attached a useful spreadsheet for planning out your values and revised values in theme_values.xml to be closer to ideal
Fix specifically for EU MIUI 8.1.30 attached. It is not a flashable zip and it contains instructions......
I have done a second version that has modified hysteresis and sampling timings as per the first post amendments to give a much more fluid feel.....
Updated with more info
jajk said:
Updated with more info
Click to expand...
Click to collapse
Hello friend it would be possible to do for the global MIUI 8.1 stable version 8.1.2.0 LHMMIDI I'm waiting for you now thanks :good:
@jackjt3 Can you post your services.jar file and I will post a dedicated 8120 version. Is this an EU or MR ROM or stock Xiaomi release?
jajk said:
@jackjt3 Can you post your services.jar file and I will post a dedicated 8120 version. Is this an EU or MR ROM or stock Xiaomi release?
Click to expand...
Click to collapse
Hello friend .... I just installed the ROM MIUI 8.1.3.0 LHMCNDI I will make the adjustments and I will run what you did ... anyway thank you very much:good:
Thank you. It works! Finally I can use Automatic brightness !
@vetriolo Yeah, it it a novelty to walk into bright sunlight and not panic trying to wind up the brightness by guesswork to see who is calling
The big question is why would Xiaomi never fix such an obvious error in more than just our phone and keep releasing version after version without ever fixing errors?
Hello @jajk, can you make this for MIUI EU?
@rafix96 If you tell me what version it is
Sorry, 6.12.15.
Wysłane z mojego Redmi Note 2 przy użyciu Tapatalka
@rafix96 See attached file. Only for EU version of 61215.
Enjoy
Thanks @jajk but framework-res file have too small size compare to original file, it's ok?
Edit:
Thanks, it's working ! Great work!
Before anybody asks, attached for EU 61222
jajk said:
Before anybody asks, attached for EU 61222
Click to expand...
Click to collapse
YEY Too Speed man :good:
O.P updated with better recommended values that are not as bright in darker conditions.
Modify the values yourself as per the instructions if you are wanting a different outcome - I don't have 3 phones with the different LCD panels to test
Fixes may not have latest values included.
EU 8020 autobrightness fix:
https://drive.google.com/open?id=0BwdRTuyj12_yNmFLZjk3NWlKY3c
EU61229 autobrightness fix:
https://drive.google.com/open?id=0BwdRTuyj12_yQ3B0MWdVLUVLdXM
is a solution akin to this one http://en.miui.com/thread-293853-1-1.html possible? I've tried out it out on my Redmi Note 4 and it seems to be working (autobrightness values working properly). Thanks in advance
@asusm930 That is only half of the fix and is included in the zip already. If the author actually tried the solution, they would find it doesn't work (on RN2 or RN3 at least). The net is full of "experts" that grab onto a small snippet of info, claim it as their own and try to increase hits to their complete loser blogs.
For autobrightness to function correctly, the services.jar file also has to be edited to make things work as they were meant to since it was beyond Xiaomi. That is the other half of the fix I provide and why it is specific for each ROM version.
Are you sure you have 16 steps of brightness control from pitch black to direct sunlight on RN4? All other Xiaomi phones only get 3 levels with the broken code in services.jar.
jajk said:
@asusm930 That is only half of the fix and is included in the zip already. If the author actually tried the solution, they would find it doesn't work (on RN2 or RN3 at least). The net is full of "experts" that grab onto a small snippet of info, claim it as their own and try to increase hits to their complete loser blogs.
For autobrightness to function correctly, the services.jar file also has to be edited to make things work as they were meant to since it was beyond Xiaomi. That is the other half of the fix I provide and why it is specific for each ROM version.
Are you sure you have 16 steps of brightness control from pitch black to direct sunlight on RN4? All other Xiaomi phones only get 3 levels with the broken code in services.jar.
Click to expand...
Click to collapse
For me the problem was auto brightness wouldn't work or workes erratically and this fixed it. What you say does make sense, though
Also happy to report that your modded camera works on my 6.12.22 rom