[GUIDE] [15-11-12] [Sense 3.*/4.0 | Ultimate Rom Porting Guide | Desire Z] - G2 and Desire Z Android Development

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...

Related

[MODS][HOW-TO] Random SGS3 Mods

This thread started out as my attempt to give back to the community by sharing some of my mods. But I think it would be nice if we could turn this in to a community effort. Kind of a one stop shopping for simple mods. Mods that would generate tons of discussion, like loserskater's AOSP MMS or lockscreen music controls, would probably be best served with their own threads (of course they would be welcome here).
Anyway, the choice is yours. Feel free to post your mods here if you want.
Be sure to limit your contributions to editing smali or xml. Nothing to do with device settings.
_______
Devs and Cooks: Feel free to use the mods in your ROMs.
Be sure to click thanks give credit to the dev that posted the mod.
_______
These mods are geared toward devs, cooks, and advanced users.
It is assumed you already know how to compile/decompile apks and jars. If not, there is tons of info available elsewhere.
If you need help with any of these mods go here.
_______
Index (by post #):
2) Add more wallpapers to SecWallpaperChooser
3) Disable page looping in launcher
4) Rendering Colors Properly in Aroma
14) TouchWiz Group Messaging and Backup / Restore SMS
15) Easy CSC feature edits
23) Remove AT&T Subscriber popup when opening contacts
39) Status bar Transparency
45) Disable Browser EdgeZoom
46) Disable Browser EdgeZoom with Toggle
50) Adding Custom Boot Animation Support (ICS/JB)
53) Adding more languages
*****
Add More Wallpapers
First you need to gather the wallpapers you want to use.
You will need two copies of each wallpaper. Resize to the following dimensions (I use Paint) and save as .jpg.
Code:
1280x1280 pixels
213x189 pixels
Name the wallpapers as you see in res/drawable-xhdpi. If you keep the original stock wallpapers (you can replace them too), start naming the wallpapers as:
Code:
hd_06.jpg
hd_06_small.jpg
hd_07.jpg
hd_07_small.jpg
hd_08.jpg
hd_08_small.jpg
etc.
Decompile SecWallpaperChooser.apk
Place the wallpapers in res/drawable-xhdpi
Go to res/values-xhdpi/arrays.xml.
You will see this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="wallpapers">
<item>hd_01</item>
<item>hd_02</item>
<item>hd_03</item>
<item>hd_04</item>
<item>hd_05</item>
</string-array>
</resources>
Add an item for each wallpaper you added. This a recent example when I added 20 more wallpapers:
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="wallpapers">
<item>hd_01</item>
<item>hd_02</item>
<item>hd_03</item>
<item>hd_04</item>
<item>hd_05</item>
<item>hd_06</item>
<item>hd_07</item>
<item>hd_08</item>
<item>hd_09</item>
<item>hd_10</item>
<item>hd_11</item>
<item>hd_12</item>
<item>hd_13</item>
<item>hd_14</item>
<item>hd_15</item>
<item>hd_16</item>
<item>hd_17</item>
<item>hd_18</item>
<item>hd_19</item>
<item>hd_20</item>
<item>hd_21</item>
<item>hd_22</item>
<item>hd_23</item>
<item>hd_24</item>
<item>hd_25</item>
</string-array>
</resources>
Recompile and push to your device.
Disable Page Looping in Launcher
Decompile SecLauncher2.apk
Go to smali/com/android/launcher2/PagedView.smali
Find this line of code:
Code:
.method protected isLoopingEnabled()Z
A few lines below it change this:
Code:
const/4 v0, [COLOR="Red"]0x1[/COLOR]
To this:
Code:
const/4 v0, [COLOR="red"]0x0[/COLOR]
Recompile and push to your device.
That's it!
"Really?"
I said that's it fool!
Rendering Colors Properly in Aroma
Our device does not render colors properly in Aroma. Normally you would just force a colorspace at the very beginning of the aroma-config then the problem is solved. But on this device forcing a colorspace will often cause the Aroma installer to hang. This is how I solved the problem.
1) You have two choices for this step:
a) Deal with the (hideous) default color rendering until a theme has been chosen.
b) Create a theme that works with the default colorspace. Unfortunately, you don't have many color choices here. And figuring out which colors will work is just trial and error. None of the colors render properly. For example, green PNG images render as blue on the display. Orange (or maybe pink - can't remember) renders as neon yellow.
I created a theme called "start" which is my start up theme which works with the default colorspace.
2) Force the rgba colorspace before each theme in aroma-config. This gives true color rendering. Below are the relevant lines from my aroma-config.
Code:
### LICENSE:
#
# Copyright (C) 2011 Ahmad Amarullah ( http://amarullz.com/ )
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#CSROM SGS3
#upndwn4par
#
theme("start");
fontresload( "0", "ttf/Roboto-Regular.ttf;ttf/DroidSansArabic.ttf;ttf/DroidSansFallback.ttf;", "12" );
loadlang("langs/en.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" );
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" );
ini_set("rom_name","CSROM SGS3");
ini_set("rom_version","v1.3");
ini_set("rom_author","upndwn4par");
ini_set("rom_device","Multi-Carrier");
ini_set("rom_date","21 Jan 2013");
#
selectbox(
"Aroma Installer Setup",
"Aroma Theme Options",
"@theme",
"theme.prop",
"Please Select a Theme","",2,
"<#selectbg_g>CSROM</#>",
"",1,
"<#selectbg_g>ICS</#>",
"",0,
"<#selectbg_g>MIUI</#>",
"",0,
"<#selectbg_g>Sense</#>",
"",0
);
#
if
file_getprop("/tmp/aroma-data/theme.prop","selected.1") == "1"
then
ini_set("force_colorspace","rgba");
theme("csrom");
endif;
if
file_getprop("/tmp/aroma-data/theme.prop","selected.1") == "2"
then
ini_set("force_colorspace","rgba");
theme("ics");
endif;
if
file_getprop("/tmp/aroma-data/theme.prop","selected.1") == "3"
then
ini_set("force_colorspace","rgba");
theme("miui");
endif;
if
file_getprop("/tmp/aroma-data/theme.prop","selected.1") == "4"
then
ini_set("force_colorspace","rgba");
theme("sense");
endif;
#
Mine 4
Mine 5
Mine 6
Mine 7
Mine 8
Mine 9
Done
Got some stuff coming...
...just grabbing another.
TouchWiz Group Messaging and Backup / Restore SMS
This is how to enable the Group Messaging and Backup / Restore SMS features found in the stock TouchWiz Messaging app
First decompile SecMms.apk
Now navigate to smali/com/android/mms/MmsConfig.smali
To enable the Group Messaging feature
Fnd:
Code:
.method public static getEnableGroupMessage()Z
.locals 1
.prologue
.line 766
const/4 v0, 0x0
Change to:
.
Code:
method public static getEnableGroupMessage()Z
.locals 1
.prologue
.line 766
const/4 v0, 0x1
To enable backup / restore SMS messages
Find:
Code:
.method public static getEnableSaveRestoreSDCardMessage()Z
.locals 1
.prologue
.line 774
const/4 v0, 0x0
Change to:
Code:
.method public static getEnableSaveRestoreSDCardMessage()Z
.locals 1
.prologue
.line 774
const/4 v0, 0x1
Now compile with changes.... Easy Pezy
Enjoy Group Messaging...
enewman17
CSC / Feature.xml edits
Easy CSC freature edits.
Editing the csc/feature.xml can unlock certain features
Enter as new line in Messaging
Code:
<CscFeature_Message_ReplaceCRToNewLine>true</CscFeature_Message_ReplaceCRToNewLine>
Increase Image Sizes... This is pushing the limits of the network as is...
Code:
<CscFeature_Message_MaxMessageSize>5242880</CscFeature_Message_MaxMessageSize>
<CscFeature_Message_MaxImageWidth>1280</CscFeature_Message_MaxImageWidth>
<CscFeature_Message_MaxImageHeight>720</CscFeature_Message_MaxImageHeight>
Increase Recipients limit
Code:
<CscFeature_Message_RecipientLimit>50</CscFeature_Message_RecipientLimit> Increase Recipients limit
Increas MMS video recording size and quality.... This is pushing the limits of the network as is...
Code:
<CscFeature_Message_MaxMmsSize>5242880</CscFeature_Message_MaxMmsSize> <!-- 5242880 for 5.0MB -->
<CscFeature_Message_MmsModeCaptureVideoMaxSize>5033164</CscFeature_Message_MmsModeCaptureVideoMaxSize> <!-- 5033164 for 4.8MB -->
<CscFeature_Message_MmsModeCaptureVideoBitRate>128000</CscFeature_Message_MmsModeCaptureVideoBitRate> <!-- 256000 for 256Kbps -->
<CscFeature_Message_MmsModeCaptureVideoMaxDuration>60</CscFeature_Message_MmsModeCaptureVideoMaxDuration> <!-- 60sec -->
<CscFeature_Message_MmsModeCaptureVideoResolution>320x240</CscFeature_Message_MmsModeCaptureVideoResolution> <!-- "" = use camcorder default value-->
Other MMS tweaks, Single view MMS (no slideshow) blocking, alias, Call back#, Text Template Button, MultiLock, Re-combine SMS
Code:
<CscFeature_Message_EnableSegmentedSMS>true</CscFeature_Message_EnableSegmentedSMS>
<CscFeature_Message_DisableMenuSMSC>false</CscFeature_Message_DisableMenuSMSC>
<CscFeature_Message_EnableBlackList>true</CscFeature_Message_EnableBlackList>
<CscFeature_Message_EnableAlias>true</CscFeature_Message_EnableAlias>
<CscFeature_Message_EnableSmsCallbackNumber>true</CscFeature_Message_EnableSmsCallbackNumber>
<CscFeature_Message_ImageResizeQualityFactorWhenAttach>high</CscFeature_Message_ImageResizeQualityFactorWhenAttach>
<CscFeature_Message_EnableTextTemplateButton>true</CscFeature_Message_EnableTextTemplateButton>
<CscFeature_Message_EnableMmsOnePageViewer>true</CscFeature_Message_EnableMmsOnePageViewer>
<CscFeature_Message_DisableSaveRingtoneMenu>false</CscFeature_Message_DisableSaveRingtoneMenu>
<CscFeature_Message_EnableMultiLockMenu>true</CscFeature_Message_EnableMultiLockMenu>
<CscFeature_Message_UseAddrWithinMMSWhenSendACK>true</CscFeature_Message_UseAddrWithinMMSWhenSendACK>
Disable the FOTA / Carrier Updates setting under about phone.
Code:
<CscFeature_Settings_FOTA>false</CscFeature_Settings_FOTA>
Enable Find My Mobile in security settings
Code:
<CscFeature_Settings_FindMyMobile>true</CscFeature_Settings_FindMyMobile>
<CscFeature_Setting_DisableMenuFindMyMobile>false</CscFeature_Setting_DisableMenuFindMyMobile>
Set the Default Homepage to anything you want
Code:
<CscFeature_Web_SetHomepageURL>http://www.google.com</CscFeature_Web_SetHomepageURL>
Add exit button to stock web browser
Code:
<CscFeature_Web_AddOptionToTerminate>true</CscFeature_Web_AddOptionToTerminate>
TW E-mail -Dark-
Code:
<CscFeature_Email_UseFixedBgColorAsWhite>false</CscFeature_Email_UseFixedBgColorAsWhite>
Enable Call/Message block in settings menu
Code:
<CscFeature_Setting_EnableMenuBlockCallMsg>true</CscFeature_Setting_EnableMenuBlockCallMsg>
There are more that could be edited...
How about disabling the TW Downloads app without having the "download complete" notification re-apparing after every reboot. Only way to get rid of the notification is to open Downloads app and manually clear the list. I've tried every thing to disable this, removing app, disabling downloads notification under app manager, etc.
Even possible on TouchWiz, or is it to intergreated in the framework???
Sent from my SGS III
Swiftks said:
How about disabling the TW Downloads app without having the "download complete" notification re-apparing after every reboot. Only way to get rid of the notification is to open Downloads app and manually clear the list. I've tried every thing to disable this, removing app, disabling downloads notification under app manager, etc.
Even possible on TouchWiz, or is it to intergreated in the framework???
Sent from my SGS III
Click to expand...
Click to collapse
Should be doable. Do you mean the notification drawer or status bar notification?
What ROM are you running? My notification goes away after I clear it once.
upndwn4par said:
Should be doable. Do you mean the notification drawer or status bar notification?
What ROM are you running? My notification goes away after I clear it once.
Click to expand...
Click to collapse
Notification drawer.
Yeah, the message will disappear after I hit clear, but on a reboot, its back... Until I clear it in Downloads. This is only downloads from Chrome.
Ruining a modded version of 4.1.1 at the moment with custom theme & lean kernel.
Sent from my SGS III
Is there any chance you guys want to work with me to get CRT-off working on our device? I've been trying to crack at it for 2 days now. I have decompiled, made changes, recompiled, and flashed more times than I want to share but I can't get it. I've been following the i9300 thread here because the smali files are quite similar to ours, but something (I believe changes in SystemUI.apk) is causing a ruckus where the boot animation keeps looping (properly albeit) and won't boot into the OS further than that. Take a look at this thread. Maybe it's a lost cause for now, but I was pulling my hair out. And yes I manually made the changes in the smali files. http://forum.xda-developers.com/showthread.php?t=1935588
Swiftks said:
Notification drawer.
Yeah, the message will disappear after I hit clear, but on a reboot, its back... Until I clear it in Downloads. This is only downloads from Chrome.
Ruining a modded version of 4.1.1 at the moment with custom theme & lean kernel.
Sent from my SGS III
Click to expand...
Click to collapse
I just tried it with chrome and mine still cleared fine even after reboot. Do you have Chrome synched to your Google account (I don't)? I wonder if that could be part of the problem.
Still shouldn't be a tough mod.
stratatak7 said:
Is there any chance you guys want to work with me to get CRT-off working on our device? I've been trying to crack at it for 2 days now. I have made changes, decompiled, recompiled and flashed more times than I want to share but I can't get it. I've been following the i9300 thread here because the smali files are quite similar to ours, but something (I believe changes in SystemUI.apk) is causing a ruckus where the boot animation keeps looping (properly albeit) and won't boot into the OS further than that. Take a look at this thread. Maybe it's a lost cause for now, but I was pulling my hair out. And yes I manually made the changes in the smali files. http://forum.xda-developers.com/showthread.php?t=1935588
Click to expand...
Click to collapse
Sure. I've had that on my list of things to do.

[GUIDE]Project Rookie II - How to build ROMs, kernels, etc for LS970 [WIP]

{
"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"
}
Welcome
This is a guide for all those who want to build for their LGOG but do not neccesasarily have the knowledge or experience.
This is an unofficial guide for the building of custom ROMs and other mods for the Sprint LG Optimus G (LS970). This is a work in progress, with additions being made as often as possible. This thread has already grown with the help of the devs established in this forum. I began this project a year ago when I was using a Samsung GS II Skyrocket. I have moved on to a new device, but the thread remains to this day, maintained by a good friend of mine, Car vs Driver. The point is this: everyone who uses this site has a desire for modding, customizing, and/or otherwise altering their device. Unfortunately, many have no idea how to go about doing these things for themselves. As such, there is a lot of dissatisfaction among developers about receiving constant demands, suggestions, and requests for updates. This thread is meant to give those who want to step up and build for themselves the means to do so. It is an ever-changing thread, with all assistance welcomed.
READ ME:
On one hand, it should go without saying that if you have no knowledge and/or experience with building, java, C++, and various other tools, you probably shouldn't begin here. At the same time, it is possible to learn to build, provided you can read, follow directions, and aren't too lazy to RESEARCH.
OH YEAH, and you better have patience. This isn't easy. It will be work. The quickest way to get flamed is to show yourself to be lazy. If you think that with a couple clicks, you can have your own flashy ROM, forget it. But, if you do want to learn, this is a good place to get started. I have no ego about this, and I want to help everyone learn to build their own ROM. But, everyone will struggle to get to a successful point, and lazy, unmotivated people just irritate those who have had to learn from scratch too. Tutorials will be posted for any new thing learned and built as time and space allow. ALL ARE WELCOME AND ALL QUESTIONS ARE TOO. But, seriously, if it's a really ridiculous one, I/we reserve the right to screw with you about it.
Thread Disclaimer:
The instructions and extras posted here are to be used at your own risk. I am working hard to provide good, workable tutorials that will make successful building much easier. Nevertheless, I am not responsible if you lose your files, brick your device, or inadvertently cause a nuclear war. If you are seeking absolute perfection, RUN NOW WHILE YOU STILL CAN!!
Building instructions are in post #1 - Extras are in post #2 - All relevant tutorials are in post #3 - Porting guide is in Post #4
GETTING STARTED
Setting up your environment :
This is a combination of the steps offered in the threads 'Compile JB on Ubuntu' and TeamChopsticks CyanogenMod.
Special thanks to dastin1015 and TeamChopsticks.
Tip: Allocate at least 75 gigs of space for the building of ONE ROM. If you install ccache, you will want 90. A complete build directory can use as much as 100 gigs, so make sure you have plenty of room. One of the ways to fail out a build is too use all of your partition before acquiring all the necessary files.
Here are the steps from those 2 tutorials in correct order:
1) You need the following:
-JDK 6 if you wish to build Jellybean.
Code:
[COLOR="Black"]$ sudo apt-get install openjdk-6-jdk
-Python 2.4 -- 2.7, which you can download from python.org.[/COLOR]
Or:
Code:
[COLOR="black"]$ sudo apt-get install python
-Git 1.7 or newer. You can find it at git-scm.com.[/COLOR]
Or:
Code:
[COLOR="black"]$ sudo apt-get install git-core[/COLOR]
-Android SDK:
Download the SDK here: http://developer.android.com/sdk/index.html
Extract the SDK and place it in your home directory.
I renamed my SDK to android-sdk to make it easier to navigate to – this tutorial assumes you've done that as well.
Go to your home folder, press Ctrl+H to show hidden files, and open up your .bashrc file.
Add these lines at the bottom of the file:
Code:
[COLOR="black"]# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
export PATH=${PATH}:~/bin[/COLOR]
Find your .profile file and add this at the bottom of the file:
Code:
[COLOR="black"]PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"
You have now successfully installed the Android SDK.[/COLOR]
To check for updates issue this into your terminal:
Code:
[COLOR="black"]$ android[/COLOR]
2) Install required packages. 64-bit (recommended)
Code:
[COLOR="black"]$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils lzop schedtool[/COLOR]
On newer versions of Ubuntu such as 11.10 you may need to do the following:
Code:
[COLOR="black"]$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so[/COLOR]
Code:
[COLOR="black"]$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so[/COLOR]
3) Configure your USB.
Code:
[COLOR="black"]$ gksudo gedit /etc/udev/rules.d/51-android.rules[/COLOR]
Inside of this blank text file insert:
Code:
[COLOR="black"]#Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"
#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"
#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"
#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"
#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"
#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"[/COLOR]
4) Save the file and close it and then issue this command:
Code:
[COLOR="black"]$ sudo chmod a+r /etc/udev/rules.d/51-android.rules[/COLOR]
5) Install the repo:
Code:
[COLOR="black"]$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo[/COLOR]
Create your work directory:
Code:
[COLOR="black"]mkdir ~/"your directory name here" For example: mkdir ~/cm11
cd ~/cm10[/COLOR]
Setup local manifest:
Code:
[COLOR="Black"]mkdir .repo/local_manifests
touch .repo/local_manifests/local_manifest.xml
nano .repo/local_manifests/local_manifest.xml[/COLOR]
A local manifest is your chance to remove/add packages to the repo before you sync.
This is what you need for your build environment. From here, the various types of ROM styles can be built with a few additions and commands.
Unofficial
To get started with Android/CyanogenMod, you'll need to get familiar with Git and Repo.
To initialize your local repository using the CyanogenMod trees, use a command like this:
Code:
[COLOR="black"]repo init -u https://github.com/CyanogenMod/android.git -b cm-11.0[/COLOR]
Then to sync up:
Code:
[COLOR="black"]repo sync[/COLOR]
Please see the CyanogenMod Wiki for building instructions.
For more information on this Github Organization and how it is structured, please read the wiki article.
Create and edit roomservice.xml in .repo:
Code:
[COLOR="black"]gedit /.repo/local_manifests/roomservice.xml[/COLOR]
Add this to the roomservice.xml:
Code:
[COLOR="Black"]
<manifest>
<project name="TeamLGOG/android_vendor_lge_gee" path="vendor/lge/gee" remote="github" revision="cm-11.0"/>
<project name="TeamLGOG/android_device_lge_gee-common" path="device/lge/gee-common" remote="github" revision="cm-11.0"/>
<project name="TeamLGOG/android_device_lge_geehrc4g_spr_us" path="device/lge/geehrc4g_spr_us" remote="github" revision="cm-11.0"/>
<project name="TeamLGOG/lge-kernel-geem" path="kernel/lge/geem" remote="github" revision="cm-11.0"/>
</manifest>[/COLOR]
then
Code:
[COLOR="Black"]repo sync[/COLOR]
Code:
[COLOR="black"]. build/envsetup.sh (notice the period and space)
vendor/cm/get-prebuilts
repo sync -j16[/COLOR]
then
Code:
[COLOR="Black"]CM_EXTRAVERSION=mycustombuild CM_SNAPSHOT=1 brunch cm_geehrc4g_spr_us-userdebug[/COLOR]
Unofficial
Special thanks to spleef and sharkboy0901 for putting this together -
First you must initialize a repository with RootBox sources:
Code:
[COLOR="black"]repo init -u git://github.com/Root-Box/platform_manifest.git -b jb-mr1[/COLOR]
then
Code:
[COLOR="black"]repo sync[/COLOR]
*This might take a few hours depending on your internet connection. *If you want to build for Android 4.1.2: Sync with -b jb-4.1.2
then add in your local_manifest to rootbox/.repo ( yeah i know usually is in its own local_manifest folder but for some reason it doesn't work like that for rootbox )
after it syncs you will have to manually edit several files in vendor/rootbox
in rootbox/vendor/rootbox:
you will need to add gee folder to rootbox/vendor/rootbox/overlay which should include the same overlay files found in your device overlay folder (ie.. frameworks and packages folders)
so create new folder call it gee inside it copy/paste the contents of rootbox/device/lge/geehrc4g_spr_us/overlay
now for next step
then you will need to add in some changes to rootbox/vendor/rootbox/products
in rootbox/vendor/rootbox/products
so once in rootbox/vendor/rootbox/products open up your androidproducts.mk and add this in to it either at the bottom or can be placed inline within the alphabet either way is fine...save and close it
so now we need to create a geehrc4g_spr_us.mk...
so create a new document called geerhc4g_spr_us.mk then open it and add these lines:
Code:
[COLOR="black"]# Inherit AOSP device configuration for geehrc4g_spr_us.
$(call inherit-product, device/lge/geehrc4g_spr_us/full_geehrc4g_spr_us.mk)
# Inherit CDMA common stuff.
$(call inherit-product, vendor/rootbox/configs/cdma.mk)
# Inherit RootBox common bits
$(call inherit-product, vendor/rootbox/configs/common.mk)
# geehrc4g_spr_us Overlays
PRODUCT_PACKAGE_OVERLAYS += vendor/rootbox/overlay/gee
# PA OVERLAY_TARGET
OVERLAY_TARGET := pa_xhdpi
# Setup device specific product configuration.
PRODUCT_NAME := rootbox_geehrc4g_spr_us
PRODUCT_BRAND := LGE
PRODUCT_MODEL := LG-LS970
PRODUCT_MANUFACTURER := LGE
#Set build fingerprint / ID / Prduct Name ect.
PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_NAME=geehrc4g_spr_us BUILD_FINGERPRINT=lge/geehrc4g_spr_us/geehrc4g:4.1.2/JZO54K/LS970ZVB.1360739022:user/release-keys PRIVATE_BUILD_DESC="geehrc4g_spr_us-user 4.1.2 JZO54K LS970ZVB.1360739022 release-keys"
# Copy Bootanimation
PRODUCT_COPY_FILES += \
vendor/rootbox/prebuilt/bootanimation/bootanimation_1280_768.zip:system/media/bootanimation.zip[/COLOR]
Save and close
So now next part
Go to rootbox/vendor/rootbox and click on the vendorsetup.sh and open it up and add in this line to either the bottom or inline with the alphabet either way is fine
Code:
[COLOR="Black"]add_lunch_combo rootbox_geehrc4g_spr_us-userdebug[/COLOR]
Save and close
After that is done make sure your everything else in your rootbox/device/lge/geehrc4g_spr_us .mk files match up to each other (ie.make sure everything says geehrc4g_spr_us and not geehrc4g
......not sure if this will be optional or not for you wouldnt build for me without doing it ....you can go from here and use the build script or continue on and try the kernel edits i had to make
Now you will have to manualy edit some files in rootbox/kernel/lge/geem ( or gee_mako depending on if your building the tlgog kernel or the bitbucket one )
these are the links for the fixes:
copy the lines that im linking in the exact location to look exactly like the the files in the links
Code:
[COLOR="black"]https://github.com/trailblazerz/lge-kernel-mako/commit/9e3dda2874eca3d8553e5cc74d79db23490a3dd7[/COLOR]
Code:
[COLOR="black"]https://github.com/trailblazerz/lge-kernel-mako/commit/ba5160c3f3f40d87321cc473003f64f6be5c4a31[/COLOR]
Code:
[COLOR="black"]https://github.com/trailblazerz/lge-kernel-mako/commit/72bbc15e45c778d4f2206c4309e25aaa5a98939c[/COLOR]
Code:
[COLOR="black"]https://github.com/trailblazerz/lge-kernel-mako/commit/9e87b59f33780894f02a1c56921c7d7d7ce0cb15[/COLOR]
Code:
[COLOR="black"]https://github.com/trailblazerz/lge-kernel-mako/commit/88b963032cf49c9628dafff76ec67f01f6255bdf[/COLOR]
Code:
[COLOR="black"]https://github.com/trailblazerz/lge-kernel-mako/commit/544788c2ef479ea9c333427720b61b8ee1411665[/COLOR]
Unofficial
Special thanks to scott.hart.bti for his hard work -
From terminal
1. type
Code:
[COLOR="black"]cd[/COLOR]
.
This will bring you to your root folder.
2. type
Code:
[COLOR="black"]mkdir beanstalk[/COLOR]
.
This will create a folder named beanstalk.
3. type
Code:
[COLOR="black"]cd beanstalk[/COLOR]
.
This will take you to the beanstalk directory created from previous step
4. type
Code:
[COLOR="black"]repo init -u git://github.com/scotthartbti/android.git -b cm-10.1[/COLOR]
.
This will setup the folders to be synced.
5. type
Code:
[COLOR="black"]repo sync[/COLOR]
.
This will sync the folders to your beanstalk directory. Note - This will take some time depending on internet connection. Be patient!
6. After the repo sync finally finishes, all you need to do is add your device, kernel, vendor specific files for the device you are building for. (You must know what these are, dont bother asking me if your not sure.)
7. Make sure all your device specific files are setup as if you were going to build for CM.
8. Outside of terminal, navigate to beanstalk/vendor/cm. Double click on the get-prebuilts file and select run in terminal. This will fetch necessary files needed to build and place them where they need to be.
9. Type
Code:
[COLOR="Black"]. build/envsetup.sh && brunch geehrc4g_spr_us[/COLOR]
10. Previous step will start building beanstalk for your device. The process takes anywhere from 1 - 3 hours depending on your computer.
11. Once completed, it will say package complete and you will have a beanstalk named zip file in your out folder.
Unofficial
Special thanks to spleef for laying this out -
First:
Code:
[COLOR="Black"]mkdir aokp[/COLOR]
then
Code:
[COLOR="black"]cd aokp[/COLOR]
then
Code:
[COLOR="black"]repo init -u https://github.com/AOKP/platform_manifest.git -b jb-mr1[/COLOR]
after it does its thing
Code:
[COLOR="black"]mkdir .repo/local_manifests
touch .repo/local_manifests/local_manifest.xml
nano .repo/local_manifests/local_manifest.xml[/COLOR]
then add these lines to the aokp local manifest:
Code:
[COLOR="black"]
[/COLOR]
save and exit then
Code:
[COLOR="black"]. ./platform_manifest/manual_add_kernel_manifest.sh[/COLOR]
which adds the kernel lists
then
Code:
[COLOR="black"]repo sync[/COLOR]
after everything syncs
Code:
[COLOR="black"]nano vendor/aokp/vendorsetup.sh[/COLOR]
and add this to the bottom:
Code:
[COLOR="black"]add_lunch_combo aokp_geehrc4g_spr_us-userdebug[/COLOR]
save and exit.. then i
Code:
[COLOR="black"]touch vendor/aokp/products/geehrc4g_spr_us.mk[/COLOR]
Code:
[COLOR="black"]nano vendor/aokp/products/geehrc4g_spr_us.mk[/COLOR]
then add in these lines:
Code:
[COLOR="black"]# Inherit AOSP device configuration for geehrc4g_spr_us
$(call inherit-product, device/lge/geehrc4g_spr_us/full_geehrc4g_spr_us.mk)
# Inherit AOKP common bits
$(call inherit-product, vendor/aokp/configs/common.mk)
# Inherit CDMA common stuff
$(call inherit-product, vendor/aokp/configs/cdma.mk)
# Setup device specific product configuration
PRODUCT_NAME := aokp_geehrc4g_spr_us
PRODUCT_BRAND := google
PRODUCT_DEVICE := geehrc4g_spr_us
PRODUCT_MODEL := Optimus G
PRODUCT_MANUFACTURER := LGE[/COLOR]
save and exit.. then
Code:
[COLOR="black"]nano vendor/aokp/products/AndroidProducts.mk[/COLOR]
and add this
Code:
[COLOR="black"]$(LOCAL_DIR)/geehrc4g_spr_us.mk \[/COLOR]
save and exit ( making sure it lines up correct like the rest of the lines in the file before saving )
then
Code:
[COLOR="black"]. build/envsetup.sh[/COLOR]
Code:
[COLOR="black"]lunch[/COLOR]
Code:
[COLOR="black"]make otapackage[/COLOR]
Building with Linaro 4.8 toolchain
Go into Terminal and navigate to the root folder of your source tree, then:
Code:
[COLOR="Black"]prebuilts/gcc/linux-x86/arm/[/COLOR]
Run:
Code:
[COLOR="black"]wget http://releases.linaro.org/13.06/components/toolchain/gcc-linaro/4.8/gcc-linaro-4.8-2013.06.tar.bz2[/COLOR]
Run:
Code:
[COLOR="black"]bunzip2 *.tar.bz2[/COLOR]
Run:
Code:
[COLOR="black"]tar -xvf *.tar[/COLOR]
Using your file manager, navigate to the root folder of your source tree again.
Navigate To "/build", in your root folder.
Run:
Code:
[COLOR="black"]gksudo gedit envsetup.sh[/COLOR]
change the line in bold, to look exactly like this one:
Code:
[COLOR="black"]case $ARCH in
x86) toolchaindir=x86/i686-linux-android-4.6/bin
;;
[B]arm) toolchaindir=arm/gcc-linaro-4.8-2013.06[/B] [COLOR="Red"]<--------[/COLOR]
;;
mips) toolchaindir=mips/mipsel-linux-android-4.6/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
[/COLOR]
Exit out and open new. Initialize and build. That's it! Makes you wonder why you never did it before, right?
Not so fast. You may have build issues, you may not. I had a few lengthy sets of errors in gsm calltracker and another .java file that was solved by using Meld and making it look exactly like a successful build's file. More as I learn.......
Thanks to infected_ for this tut; his post can be found here:
http://forum.xda-developers.com/showpost.php?p=42976693&postcount=12
Camera tweaks, patches, and apks:
As we all know, the camera is the one stain on an otherwise nearly perfect device. I am asked constantly about new ways to get better functionality out of this cam, and rightly so. I will include a section here with all relevant 'fixes' and update as I can.....
Camera fix tweak - http://forum.xda-developers.com/showthread.php?t=2393667
Cam fix for JB - http://forum.xda-developers.com/showthread.php?p=37965814
Moto X camera apk. -
Camera: http://d-h.st/66D
Gallery: http://d-h.st/7Na
Thread: http://forum.xda-developers.com/showthread.php?t=2380199
4.3 Camera apk. - http://db.tt/66HWiwVs
Thread: http://forum.xda-developers.com/showthread.php?t=2343621
Focal Camera apk. - https://copy.com/XUqyOvUwKecD
Thread: http://forum.xda-developers.com/showthread.php?p=44093525
These are just the ones that I have time to hunt down right now. Post here any alternatives or PM me with them.
Thanks to:
CyanogenMod
TeamLGOG
Shelnutt2
Rlasalle15
scott.hart.bti
xboxfanj
Crwolv
spleef
Haze028
AdhvanIt
AdriVelazquez
car vs driver
M4570D0N
sharkboy0901
[/COLOR]
​
KERNEL BUILDING and other EXTRAS
Building your first kernel
(this is non-device-specific; tweaks will be required to produce an LS970 kernel) :
This is a set of steps to get you building your first kernel. Special thanks to thewadegeek for putting this tutorial together. His thread can be found here: http://forum.xda-developers.com/showthread.php?t=1748297
Step 1. Build Environment
A. Install Ubuntu 12.04(Not holding your hand here, if you can't do this you shouldn't be messing with kernels)
B. Required packages: git-core, gnupg, flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev, build-essential, zip, curl, libncurses5-dev, zlib1g-dev, ia32-libs, lib32z1-dev, lib32ncurses5-dev, gcc-multilib, g++-multilib, and Adb.
C. Open a terminal
D. Type
Code:
[COLOR="black"]mkdir android[/COLOR]
E. Type
Code:
[COLOR="black"]cd android[/COLOR]
G.Type
Code:
[COLOR="black"]mkdir kernel[/COLOR]
Step 2. Your Source
A. Open your Terminal Prompt
B. Type
Code:
[COLOR="black"]cd android/kernel[/COLOR]
C. Type
Code:
[COLOR="black"]git clone git://github.com/DooMLoRD/android_prebuilt_toolchains.git toolchains[/COLOR]
D. Now comes the tricky part, you need to have some-type of source for your kernel. Check the following two sites for your device as appropriate. Once you have it download it is extracted/cloned into a folder in your kernel directory.
http://www.htcdev.com/
http://opensource.samsung.com/
.http://developer.sonymobile.com/wpor...ads/opensource
http://www.lg.com/global/support/ope...opensource.jsp
Step 3. Modifications
This is the part people are curious about, they want to make modifications to the kernel to make it "special". Start all these from the root directory of your kernel source.
Mod 1. Applying a patch
A. Download the patch you wish to apply, in this case this one should work.
B. Save that file as "kernelPatch" in your kernel directory.
C. Open a Terminal
D. Move into the root directory of the kernel you wish to patch.
E. Type
Code:
[COLOR="black"]patch -p1 < ../kernelPatch[/COLOR]
Mod 2. Adding a Governor Alone
A. Open "drivers/cpufreq/Kconfig"
B. Add the following lines in appropriate spot amongst the other govenor's
Code:
[COLOR="Black"]config CPU_FREQ_DEFAULT_GOV_SMARTASS
bool "smartass"
select CPU_FREQ_GOV_SMARTASS
select CPU_FREQ_GOV_PERFORMANCE
help
Use the CPUFreq governor 'smartass' as default.
[/COLOR]
Code:
[COLOR="Black"]config CPU_FREQ_GOV_SMARTASS
tristate "'smartass' cpufreq governor"
depends on CPU_FREQ
help
smartass' - a "smart" optimized governor!
If in doubt, say N.[/COLOR]
C. Open "drivers/cpufreq/Makefile"
D. Add the following line in the appropriate spot.
Code:
[COLOR="Black"] obj-$(CONFIG_CPU_FREQ_GOV_SMARTASS) += cpufreq_smartass.o[/COLOR]
E. Create a file called "drivers/cpufreq/cpufreq_smartass.c"
F. Put the following code in that file.
http://pastebin.com/f0Bk9kVZ
G. open "include/linux/cpufreq.h"
H. Under the "Cpufreq Default" section add
Code:
[COLOR="Black"]#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_SMARTASS)
extern struct cpufreq_governor cpufreq_gov_smartass;
#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_smartass)[/COLOR]
Ok there is a governor added, do the exact same steps for any other one's you would like to add.
Step 4. Getting a Config file
Option A. Pulling a config file from a kernel.
A. Hook up a device that is using a kernel similar to one you are using as your base.
B. Open a terminal
C. Change to your root kernel directory
D. Type
Code:
[COLOR="black"]adb pull /proc/config.gz[/COLOR]
E. Type
Code:
[COLOR="black"]gunzip config.gz[/COLOR]
F. Type
Code:
[COLOR="black"]mv config arch/arm/configs/<your_config_name>_defconfig[/COLOR]
Option B. Using the manufacturers config.
Unfortunately as stated above, not all kernels support the "/proc/config.gz" method. You can typically find a manufacturer's configuration file in "arch/arm/configs". I believe the one for my HTC Flyer was called "flyer_hc_defconfig", so look for a layout similar to that one. Also read the README to get a better idea of how to modify it. I would personally make a copy of it called "<your_config_name>_defconfig" and use that as my base.
Step 5. Building
Time to start the real "build" section of this tutorial.
Part A. Pre-build Steps
A. Open terminal and change to the root of your kernel directory
B. Type
Code:
[COLOR="black"]export ARCH=arm[/COLOR]
C. Type
Code:
[COLOR="black"]export CROSS_COMPILE=~/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-[/COLOR]
Part B. The First Build
A. Type
Code:
[COLOR="black"]make <your_config_name>_defconfig[/COLOR]
B. Type
Code:
[COLOR="black"]make menuconfig[/COLOR]
and make the required changes to use any modules you added or similar changes.
C. Type
Code:
[COLOR="black"]make -j<maximum number of jobs>[/COLOR]
Part C. Re-Builds
A. Type
Code:
[COLOR="black"]make clean[/COLOR]
B. Type
Code:
[COLOR="black"]make oldconfig[/COLOR]
C. Type
Code:
[COLOR="black"]make -j<maximum number of jobs>[/COLOR]
Part D. Building Modules
You have two options:
A. Type
Code:
[COLOR="black"]make modules[/COLOR]
B. Type
Code:
[COLOR="black"]make path/to/your/module.ko[/COLOR]
The above steps explained:
Part A.(These steps are required every time you close your terminal and re-open it to build again.)
A. Ok shouldn’t need to explain this.
B. This command sets your target architecture.
C. Defines the path to the toolchain we are going to use to compile our kernel. You can change this to point towards whatever toolchain you have downloaded or feel like using, the way it is currently configured it will use the Linaro toolchain that we downloaded above.
Part B.(These only need to be run the first time you build a kernel.)
A. Load's your configuration file from earlier.
B. Open up a menu to configure your kernel. It will use the config file you loaded in the previous step as a base.
C. Viola start the build. I typically allow 1 job per core, so on my quad core machine I put "make -j4". Just raising that number will not make your build faster, your processor needs to be able to support the number of jobs you are assigning it.
Part C. (Use the command's when you are building any-time outside of the first)
A. This command gets rid of any old/outdated binaries or modules you compiled before, and let's start fresh. I like to run it every I build unless my changes are really small and localized.
B. A very awesome command, it parses through what has changed and only prompts you about new options.
C. See the explanation for the above "Part C.".
Part D.(Use these for just building kernel modules.)
A. This will re-build all modules.
B. Will rebuild just the module you need. Very useful when you need to rebuild a WiFi module.
Step 6. Now what
Ok we have now started our build and we are waiting for it to finish, so there are two possible outcomes:
Outcome A. Build Succeeds
W00t!! You have a kernel built by your self from source. There are a couple things you need in-order to use this kernel on your device any ".ko" modules and the zImage binary. If you pay attention to the output of your compiler then you will see the location of those objects. However the following commands will make your life a bit easier(Thanks Recognized Developer Hacre):
A. Open a terminal
B. Change to your root kernel directory
C. Type
Code:
[COLOR="black"]mkdir ../<your_kernel>_output[/COLOR]
D. Type
Code:
[COLOR="black"]cp arch/arm/boot/zImage ../<your_kernel>_output/zImage[/COLOR]
E. Type
Code:
[COLOR="black"]find . -name "*.ko" -exec cp {} ../<your_kernel>_output \;[/COLOR]
The above steps explained:
A-C. Self-Explanatory
D. Move our kernel binary into our output folder
E. This handy bit of magic finds all ".ko" modules and also copies them into your output file.
You will also need to assemble a kernel image containing a initramfs for your device, along with the kernel binary and such. That however is beyond the scope of this tutorial. To get started though try searching the following phrases.
Code:
[COLOR="Black"]building android kernel image
xda build kernel image
xda unpack boot.img[/COLOR]
Outcome B. Build Fails
Oh dear. It failed. Well guess what...this is going to happen..a LOT. Get used to it, and get used to googling and experimenting with different solutions. The following are some tips that will help you with debugging your issues.
Running a "Clean" build
A. Backup your config file - Type
Code:
[COLOR="black"]cp .config ../backupConfig[/COLOR]
B. Re-run the build process using just your defconfig from earlier.
Limiting Output(Thanks Hacre.)
A. Another good tip is to run "make -j1" to get the error, as it will limit the amount of text you need to scroll through.
CCACHE​
Here is a brief tutorial on the installation of Ccache, which can shorten build times drastically :
If you have room on your build system you can speed
your builds up considerably by using ccache. ccache is a compiler
cache. It speeds up re-compilation of C/C++ code by caching
previous compiles and detecting when the same compile is
being done again.
Install it with apt-get:
Code:
[COLOR="Black"]sudo apt-get install ccache[/COLOR]
Set environment vars for Android use:
(I put these exports in my .bashrc)
Code:
[COLOR="Black"]export USE_CCACHE=1
export NDK_CCACHE=ccache[/COLOR]
Set a cache size of 10G for optimal results:
Code:
[COLOR="black"]ccache -M 10G[/COLOR]
Check the status of your cache with the command:
Code:
[COLOR="black"]ccache -s [/COLOR]
Returns:
Code:
[COLOR="black"]
cache directory /home/jocala/.ccache
cache hit 106673
cache miss 18379
called for link 3758
preprocessor error 5
not a C/C++ file 4425
unsupported compiler option 678
no input file 4565
files in cache 36758
cache size 3.2 Gbytes
max cache size 10.0 Gbytes[/COLOR]
​
Links for all relevant topics:
Here are some relevant topics/tutorials/sites:
Download | Ubuntu - www.ubuntu.com/download
Official Ubuntu Documentation: Help for all versions. - https://help.ubuntu.com/
How To Windows Dual Boot: - https://help.ubuntu.com/community/WindowsDualBoot
How To Use The Terminal: Commandline stuff. - https://help.ubuntu.com/community/UsingTheTerminal/
[HOW TO] Beginners Guide to Android ROM Development - http://forum.xda-developers.com/showthread.php?t=1272270 (courtesy of isidromxz)
[Tutorial] Compile JB on Ubuntu - http://forum.xda-developers.com/showthread.php?t=1762641 (courtesy of dastin1015)
[CM10] [PPA] Cyanogenmod Compiler v0.6 - http://forum.xda-developers.com/showthread.php?t=1789190 (courtesy of lithid-cm)
[Wiki] How to: Gerrit - http://wiki.cyanogenmod.com/wiki/Howto:_Gerrit
[Wiki] How to: Git - http://wiki.cyanogenmod.com/wiki/Howto:_Git
[Wiki] How to: Connect to device with SSH - http://wiki.cyanogenmod.com/wiki/Howto:_Connect_to_Device_with_SSH
Here is an easy-to-use page on common Linux commands: - http://www.pixelbeat.org/cmdline.html
Linux Newbie Guide : - http://www.unixguide.net/linux/linuxshortcuts.shtml
Also, Team Chopsticks has a good page with some useful tips as well, located here:
http://www.teamchopsticks.org/p/contributing.html (thanks to bdusmc for the tip)
Here is a link to LIFEHACKER's command line tutorials. Very good stuff!! : http://lifehacker.com/5743814/become-a-command-line-ninja-with-these-time+saving-shortcuts
CyanogenMod git : - https://github.com/CyanogenMod
Team LGOG git : - https://github.com/TeamLGOG
Original Beanstalk thread : - http://forum.xda-developers.com/showthread.php?t=2091900
​
Porting an AOSP based ROM (MIUI, COS, CM, etc):
Special thanks to AdhvanIt for putting this together for everyone!
For this project, you'll need to get familiar with adb, apktool, and meld. Since these already have tutorials, I'll link those instead of writing my own for each.
COMPREHENSIVE GUIDE TO ADB | LEARN TO LOGCAT LIKE A PRO | APKTOOL | MELD
The most successful ports to the LGOG will come from Nexus 4 based ROMs, as they are the most similar in chipset to our device. For this guide, we will reference base ROM as the build from our device, and reference port as the ROM you'll be bringing to our device.
Getting started:
Extract your base ROM into a working folder of your choice. Inside, you'll find:
Code:
[COLOR="Black"]System - The majority of the work we'll do will be in here.
Data - May contain applications, boot scripts, config files etc.
META-INF - Contains certificates and signature for signcheck and updater-script, update-binary (updater-script command processor)
boot.img - Kernel/ramdisk packed together. This should only be touched in the event you wish to use a kernel that is separate from the one in your base ROM, or to edit the ramdisk.[/COLOR]
From inside your working folder, you'll want to delete the following directories and all files contained within them:
Code:
[COLOR="black"]/system/app
/system/fonts
/system/framework
/system/media[/COLOR]
Open your port archive and extract those same folders into /system directory of your working folder.
Some ports such as MIUI, cos, etc also require that certain permissions xml's (inside /system/etc/permissions) be copied over so that the theme engines will work properly.
Modifying build.prop:
Code:
[COLOR="black"]In your additional build properties section, you'll find lines similar to this.
ro.config.ringtone=
ro.config.notification_sound=
ro.config.alarm_alert=
ro.config.sms_received_sound=
ro.config.sms_delivered_sound=[/COLOR]
They contain ringtones that are in the base ROM, and will need to be changed to those in the port.
This is the base work for porting a ROM. From here, you'll want to zip and sign the ROM, then attempt to boot (Note: it will not boot yet).
Framework mods required for the device to boot:
Navigate to /system/framework and decompile the following:
Code:
[COLOR="black"]framework-res.apk
framework.jar
telephony-common.jar[/COLOR]
Note: some ports may require services.jar and android.policy.jar decompiled as well, but no other framework will change in a port as they are common among all AOSP ROMs.
Extract and decompile the same frameworks from your base ROM zip.
The following is a list of the exact methods/classes and framework xml's that need replaced or modified to port COS from the N4 to the LGOG. Some of these will be universal between different ports, and some will be specific to COS. When you run into issues, you'll want to take a look at the steps for debugging below.
framework-res.apk:
/res/values/arrays.xml:
Code:
[COLOR="black"]<array name="config_cdma_dun_supported_types" />
Change this line to:
<string-array name="config_cdma_dun_supported_types">
<item>default</item>
<item>dun</item>
<item>mms</item>
<item>supl</item>
</string-array>[/COLOR]
res/values/bools.xml:
Code:
[COLOR="black"] <bool name="config_telephony_use_own_number_for_voicemail">false</bool>
<bool name="config_mms_content_disposition_support">true</bool>
<bool name="config_showNavigationBar">true</bool>[/COLOR]
Change to:
Code:
[COLOR="black"] <bool name="config_telephony_use_own_number_for_voicemail">true</bool>
<bool name="config_mms_content_disposition_support">false</bool>
<bool name="config_showNavigationBar">false</bool>[/COLOR]
res/xml/eri.xml:
Replace this xml with the one from your base ROM.
telephony-common.jar:
com/android/internal/telephony:
For this, you'll want to replace entire smali trees with those from your base ROM. First, the RIL smali tree, or RIL*.smali:
Code:
[COLOR="black"]RIL.smali
RIL$1.smali
RIL$RILReceiver.smali
RIL$RILSender.smali
RILRequest.smali[/COLOR]
Also:
Code:
[COLOR="black"]LGEQualcommCDMARIL*.smali
PhoneFactory.smali[/COLOR]
framework.jar
android/content/res/AssetManager.smali:
Change:
Code:
[COLOR="black"].field private static final sSync:Ljava/lang/Object;
.field static sSystem:Landroid/content/res/AssetManager;
# instance fields
.field private mNObject:I
.field private mNumRefs:I[/COLOR]
To:
Code:
[COLOR="black"].field private static final sSync:Ljava/lang/Object;
.field static sSystem:Landroid/content/res/AssetManager;
# instance fields
.field private mAppName:Ljava/lang/String;
.field private mAssetDir:Ljava/lang/String;
.field private mNObject:I
.field private mNumRefs:I[/COLOR]
Change:
Code:
[COLOR="black"].field private mOpen:Z
.field private mRefStacks:Ljava/util/HashMap;
.annotation system Ldalvik/annotation/Signature;[/COLOR]
To:
Code:
[COLOR="black"].field private mOpen:Z
.field private mRedirections:Landroid/util/SparseArray;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroid/util/SparseArray",
"<",
"Landroid/content/res/PackageRedirectionMap;",
">;"
}
.end annotation
.end field
.field private mRefStacks:Ljava/util/HashMap;
.annotation system Ldalvik/annotation/Signature;
Change:
Code:
.field private mStringBlocks:[Landroid/content/res/StringBlock;
.field private final mValue:Landroid/util/TypedValue;
# direct methods[/COLOR]
To:
Code:
[COLOR="black"].field private mStringBlocks:[Landroid/content/res/StringBlock;
.field private mThemeCookie:I
.field private mThemePackageName:Ljava/lang/String;
.field private mThemeSupport:Z
.field private final mValue:Landroid/util/TypedValue;
# direct methods[/COLOR]
Change:
Code:
[COLOR="black"].end method
.method static final native applyStyle(IIII[I[I[I)Z
.end method
.method static final native applyThemeStyle(IIZ)V
.end method
.method static final native copyTheme(II)V
.end method[/COLOR]
To:
Code:
[COLOR="black"].end method
.method private final native addRedirectionsNative(I)V
.end method
.method static final native applyStyle(IIII[I[I[I)Z
.end method
.method static final native applyThemeStyle(IIZ)V
.end method
.method private final native clearRedirectionsNative()V
.end method
.method static final native copyTheme(II)V
.end method[/COLOR]
Change:
Code:
[COLOR="black"].method private final native seekAsset(IJI)J
.end method
# virtual methods
.method public final native addAssetPath(Ljava/lang/String;)I
To:
Code:
.end method
.method private final native splitThemePackage(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I
.end method
# virtual methods
.method public final native addAssetPath(Ljava/lang/String;)I[/COLOR]
Change:
Code:
[COLOR="black"] invoke-virtual {p0, v2}, Landroid/content/res/AssetManager;->addAssetPath(Ljava/lang/String;)I
move-result v2
aput v2, v0, v1
.line 620
add-int/lit8 v1, v1, 0x1
goto :goto_0
.end method
.method public close()V
.locals 1[/COLOR]
To:
Code:
[COLOR="black"] invoke-virtual {p0, v2}, Landroid/content/res/AssetManager;->addAssetPath(Ljava/lang/String;)I
move-result v2
aput v2, v0, v1
.line 620
add-int/lit8 v1, v1, 0x1
goto :goto_0
.end method
.method public addRedirections(Landroid/content/res/PackageRedirectionMap;)V
.locals 2
.parameter "map"
.prologue
.line 747
iget-object v0, p0, Landroid/content/res/AssetManager;->mRedirections:Landroid/util/SparseArray;
if-nez v0, :cond_0
.line 748
new-instance v0, Landroid/util/SparseArray;
const/4 v1, 0x2
invoke-direct {v0, v1}, Landroid/util/SparseArray;-><init>(I)V
iput-object v0, p0, Landroid/content/res/AssetManager;->mRedirections:Landroid/util/SparseArray;
.line 750
:cond_0
iget-object v0, p0, Landroid/content/res/AssetManager;->mRedirections:Landroid/util/SparseArray;
invoke-virtual {p1}, Landroid/content/res/PackageRedirectionMap;->getPackageId()I
move-result v1
invoke-virtual {v0, v1, p1}, Landroid/util/SparseArray;->append(ILjava/lang/Object;)V
.line 751
invoke-virtual {p1}, Landroid/content/res/PackageRedirectionMap;->getNativePointer()I
move-result v0
invoke-direct {p0, v0}, Landroid/content/res/AssetManager;->addRedirectionsNative(I)V
.line 752
return-void
.end method
.method public final native attachThemePath(Ljava/lang/String;)I
.end method
.method public clearRedirections()V
.locals 1
.prologue
.line 759
iget-object v0, p0, Landroid/content/res/AssetManager;->mRedirections:Landroid/util/SparseArray;
if-eqz v0, :cond_0
.line 760
iget-object v0, p0, Landroid/content/res/AssetManager;->mRedirections:Landroid/util/SparseArray;
invoke-virtual {v0}, Landroid/util/SparseArray;->clear()V
.line 762
:cond_0
invoke-direct {p0}, Landroid/content/res/AssetManager;->clearRedirectionsNative()V
.line 763
return-void
.end method
.method public close()V
.locals 1[/COLOR]
Change:
Code:
[COLOR="black"].end method
.method final ensureStringBlocks()V
To:
Code:
.end method
.method public final native detachThemePath(Ljava/lang/String;I)Z
.end method
.method final ensureStringBlocks()V
Change:
Code:
.end method
.method final native getArrayIntResource(I)[I
.end method
.method final native getArraySize(I)I
.end method
.method public final native getCookieName(I)Ljava/lang/String;[/COLOR]
To:
Code:
[COLOR="black"].end method
.method public final native generateStyleRedirections(III)Z
.end method
.method final native getArrayIntResource(I)[I
.end method
.method final native getArraySize(I)I
.end method
.method public final native getBasePackageCount()I
.end method
.method public final native getBasePackageId(I)I
.end method
.method public final native getBasePackageName(I)Ljava/lang/String;
.end method
.method public final native getCookieName(I)Ljava/lang/String;
Change:
Code:
.end method
.method final getThemeValue(IILandroid/util/TypedValue;Z)Z
[/COLOR]
To:
Code:
[COLOR="black"].end method
.method public getThemeCookie()I
.locals 1
.prologue
.line 730
iget v0, p0, Landroid/content/res/AssetManager;->mThemeCookie:I
return v0
.end method
.method public getThemePackageName()Ljava/lang/String;
.locals 1
.prologue
.line 714
iget-object v0, p0, Landroid/content/res/AssetManager;->mThemePackageName:Ljava/lang/String;
return-object v0
.end method
.method final getThemeValue(IILandroid/util/TypedValue;Z)Z[/COLOR]
Change:
Code:
[COLOR="black"].end method
.method public final native isUpToDate()Z
To:
Code:
.end method
.method public final hasThemeSupport()Z
.locals 1
.prologue
.line 696
iget-boolean v0, p0, Landroid/content/res/AssetManager;->mThemeSupport:Z
return v0
.end method
.method public final native isUpToDate()Z[/COLOR]
Change:
Code:
[COLOR="black"].end method
.method final releaseTheme(I)V[/COLOR]
To:
Code:
[COLOR="black"].end method
.method final recreateStringBlocks()V
.locals 1
.prologue
.line 272
monitor-enter p0
.line 273
const/4 v0, 0x1
:try_start_0
invoke-virtual {p0, v0}, Landroid/content/res/AssetManager;->makeStringBlocks(Z)V
.line 274
monitor-exit p0
.line 275
return-void
.line 274
:catchall_0
move-exception v0
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
.end method
.method final releaseTheme(I)V[/COLOR]
Change:
Code:
[COLOR="black"].method public final native setLocale(Ljava/lang/String;)V
.end method
.method xmlBlockGone(I)V[/COLOR]
To:
Code:
[COLOR="black"].method public final native setLocale(Ljava/lang/String;)V
.end method
.method public setThemeCookie(I)V
.locals 0
.parameter "cookie"
.prologue
.line 738
iput p1, p0, Landroid/content/res/AssetManager;->mThemeCookie:I
.line 739
return-void
.end method
.method public setThemePackageName(Ljava/lang/String;)V
.locals 0
.parameter "packageName"
.prologue
.line 722
iput-object p1, p0, Landroid/content/res/AssetManager;->mThemePackageName:Ljava/lang/String;
.line 723
return-void
.end method
.method public final setThemeSupport(Z)V
.locals 0
.parameter "themeSupport"
.prologue
.line 686
iput-boolean p1, p0, Landroid/content/res/AssetManager;->mThemeSupport:Z
.line 687
return-void
.end method
.method public final splitDrmProtectedThemePackage(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I
.locals 1
.parameter "packageFileName"
.parameter "lockedFileName"
.parameter "drmProtectedresources"
.prologue
.line 492
invoke-direct {p0, p1, p2, p3}, Landroid/content/res/AssetManager;->splitThemePackage(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I
move-result v0
return v0
.end method
.method xmlBlockGone(I)V[/COLOR]
Replace the following smali files with the ones from your base:
Code:
[COLOR="black"]android/content/res/PackageRedirectionMap*.smali
android/hardware/Camera*.smali
android/telephony/TelephonyManager.smali
android/webkit/HTML5*.smali
android/webkit/WebSettingsClassic.smali
Change:
Code:
.field private mWebGLEnabled:Z
.field private mWebView:Landroid/webkit/WebViewClassic;[/COLOR]
To:
Code:
[COLOR="black"].field private mWebGLEnabled:Z
.field private mWebSocketsEnabled:Z
.field private mWebView:Landroid/webkit/WebViewClassic;[/COLOR]
Change:
Code:
[COLOR="black"] .line 93
iput-boolean v3, p0, Landroid/webkit/WebSettingsClassic;->mDomStorageEnabled:Z
.line 94[/COLOR]
To:
Code:
[COLOR="black"] .line 93
iput-boolean v3, p0, Landroid/webkit/WebSettingsClassic;->mWebSocketsEnabled:Z
iput-boolean v3, p0, Landroid/webkit/WebSettingsClassic;->mDomStorageEnabled:Z
.line 94[/COLOR]
Change:
Code:
[COLOR="black"] monitor-exit p0
throw v2
.end method
.method isNarrowColumnLayout()Z[/COLOR]
To:
Code:
[COLOR="black"]monitor-exit p0
throw v2
.end method
.method public declared-synchronized getWebSocketsEnabled()Z
.locals 1
.prologue
.line 1342
monitor-enter p0
:try_start_0
iget-boolean v0, p0, Landroid/webkit/WebSettingsClassic;->mWebSocketsEnabled:Z
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method isNarrowColumnLayout()Z[/COLOR]
Debugging:
Legend:
Code:
[COLOR="Black"]"E/" - Error
"E/dalvikvm"- Crucial system error
"No such file or directory" - Should be self-eplanatory.
"fail"/"failed" - Crucial error
"W/"/"warning" - Self explanatory.
"exception"(especially NullPointerException) - Points to something that was done incorrectly during the port.[/COLOR]
Common error types:
Couldn't find native method:
Code:
[COLOR="black"]method static synthetic access$100(Landroid/hardware/Camera;)
E/dalvikvm( 100): ERROR: couldn't find native method
E/dalvikvm( 100): Requested: Landroid/hardware/Camera;.Camera$PictureCallback;
E/JNIHelp ( 100): RegisterNatives failed for 'Landroid/hardware/Camera', aborting[/COLOR]
This will help us figure out where the issue is:
Code:
[COLOR="black"]E/JNIHelp ( 100): RegisterNatives failed for 'Landroid/hardware/Camera'[/COLOR]
>>
Code:
[COLOR="black"]android/hardware/Camera[/COLOR]
The smali we're looking for is Camera.smali. Finding the path does require a little knowledge of source code structure. But in this case, we can assume that any path starting with "android" points to framework.jar
You'll want to take the single missing method from base smali and put it in the corresponding port smali. In this case, .Camera$PictureCallback. In some cases, you can get away with using entire smali files (or smali trees consisting of all smali files starting with the same name) from your base ROM in your port. Though this can cause issues if you get carried away.
Fatal signal 11:
Code:
[COLOR="black"]F/libc ( 2698): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
I/DEBUG ( 130): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 130): Build fingerprint: 'google/occam/mako:4.2.2/JDQ39/573038:user/release-keys'
I/DEBUG ( 130): pid: 2698, tid: 2698 >>> zygote <<<
I/DEBUG ( 130): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
I/DEBUG ( 130): r0 deadbaad r1 00000001 r2 a0000000 r3 00000000
I/DEBUG ( 130): r4 00000000 r5 00000027 r6 4086fbfd r7 00000036
I/DEBUG ( 130): r8 40253f04 r9 40233a7e 10 0000904c fp 00009062
I/DEBUG ( 130): ip 4028b240 sp befcfa60 lr 401043c1 pc 40100adc cpsr 600
00030
I/DEBUG ( 130): d0 2f64696f72646e61 d1 2f746e65746e6f63
I/DEBUG ( 130): d2 657373412f736572 d3 726567616e614d74
I/DEBUG ( 130): d4 0000d4cc0000d4b1 d5 0000d4e80000d4cd[/COLOR]
When you see a code block like the start of that one, look just above it. You'll find the error that caused it up a few lines.
Unable to extract+optimize DEX from '/system/framework/framework.jar' and other errors:
Code:
[COLOR="black"]D/dalvikvm( 103): DexOpt: --- BEGIN 'framework.jar' (bootstrap=1) ---
E/dalvikvm( 172): Duplicate class definition: 'Landroid/media/MediaRecorder;'
E/dalvikvm( 172): Trouble with item 2900 @ offset 0x17a86c
E/dalvikvm( 172): Cross-item verify of section type 0006 failed
E/dalvikvm( 172): ERROR: Byte swap + verify failed
E/dalvikvm( 172): Optimization failed
W/dalvikvm( 103): DexOpt: --- END 'framework.jar' --- status=0xff00, process failed
E/dalvikvm( 103): Unable to extract+optimize DEX from '/system/framework/framework.jar'
D/dalvikvm( 103): Unable to process classpath element '/system/framework/framework.jar'
E/JNIHelp ( 103): Native registration unable to find class 'android/debug/JNITest', aborting[/COLOR]
Code:
[COLOR="black"]E/NetworkLocationRealOs(2304): no android ID; can't access encrypted cache
E/NetworkLocationRealOs(2304): java.io.IOException: no android ID; can't access encrypted cache[/COLOR]
Code:
[COLOR="black"]E/System(1538): java.lang.NullPointerException
E/System(1538): at com.android.server.pm.PackageManagerService.grantPermissionsLPw(PackageManagerService.java:4299)
E/System(1538): at com.android.server.pm.PackageManagerService.updatePermissionsLPw(PackageManagerService.java:4247)
E/System(1538): at com.android.server.pm.PackageManagerService.<init>(PackageManagerService.java:1170)
E/System(1538): at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:858)
E/System(1538): at com.android.server.ServerThread.run(SystemServer.java:167)
I/SystemServer(1538): Input Method Service
W/SystemServer(1538): ***********************************************
A/SystemServer(1538): BOOT FAILURE starting Input Manager Service
A/SystemServer(1538): java.lang.NullPointerException
A/SystemServer(1538): at android.app.PendingIntent.getBroadcast(PendingIntent.java:293)
A/SystemServer(1538): at com.android.server.InputMethodManagerService.<init>(InputMethodManagerService.java:548)
at com.android.server.ServerThread.run(SystemServer.java:271)
Error reporting WTF
E/AndroidRuntime(1538): java.lang.NullPointerException
E/AndroidRuntime(1538): at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:345)
E/AndroidRuntime(1538): at android.util.Log$1.onTerribleFailure(Log.java:103)
E/AndroidRuntime(1538): at android.util.Log.wtf(Log.java:278)
E/AndroidRuntime(1538): at com.android.server.ServerThread.reportWtf(SystemServer.java:77)
E/AndroidRuntime(1538): at com.android.server.ServerThread.run(SystemServer.java:274)[/COLOR]
The errors above are typically tied to issues with your build. Either framework that's been decompiled/compiled improperly, or the classes that you've diffed.
The methods above can be found in your base AssetManager.smali. I've provided exactly what you need to replace so that you can do it with as little trial and error as necessary. If you make a mistake in AssetManager, even your logcat won't give you any usable information...
​
Looks great. Nice job, Bryan!
I'll save this post for a potential custom framework (such as Sense, TouchWiz, etc) porting guide.
So, I gave my building laptop a 'tune up' last night; broke it down (ever take apart an aluminum-framed DV7?), cleaned the fan assembly, cleaned the CPU, spooged some new Artic Silver on that badboy, and now were ready to rock! Gonna get something built now!....... Would have anyway, but at least the fan doesn't sound like a freight train going uphill anymore......fan assembly looked like the dryer tray when you don't clean it enough....
You probably want to use the cm10.1 clean branches...not cm10.1
rlasalle15 said:
You probably want to use the cm10.1 clean branches...not cm10.1
Click to expand...
Click to collapse
I'll take any advice I can get. What is the difference, and how do I find the clean branches(sorry if this amounts to noobie-ism, but you lost me at 'clean')?
BMP7777 said:
I'll take any advice I can get. What is the difference, and how do I find the clean branches(sorry if this amounts to noobie-ism, but you lost me at 'clean')
Click to expand...
Click to collapse
well...without me coming off as a douche...a lot was pushed to branches that should of been heavily tested before it got pushed...Shelnuts...got rid of commits with his clean branches...basically its what my branches are.
rlasalle15 said:
well...without me coming off as a douche...a lot was pushed to branches that should of been heavily tested before it got pushed...Shelnuts...got rid of commits with his clean branches...basically its what my branches are.
Click to expand...
Click to collapse
No way, man....you're doing ME a favor. But, without coming off like a moron, I am extremely confused about many things in the building process for this particular device. Samsung's were a pain, but much more straightforward. Even a variant, like the Hercules, was usually just a change or two from the skyrocket in terms of functionality. I haven't been able to locate the actual LS970 files in CM anywhere. Do you mind laying it out for me once and for all, so I can stop shuffling around? xboxfanj has been helping me with the local_manifest, but I'm still not certain where/who to get my CM base files from. I used yours and hit a wall. Then I began using the TeamLGOG files and have gotten a bit further, but still can't build. Any help you could give and I'd be grateful.
BMP7777 said:
No way, man....you're doing ME a favor. But, without coming off like a moron, I am extremely confused about many things in the building process for this particular device. Samsung's were a pain, but much more straightforward. Even a variant, like the Hercules, was usually just a change or two from the skyrocket in terms of functionality. I haven't been able to locate the actual LS970 files in CM anywhere. Do you mind laying it out for me once and for all, so I can stop shuffling around? xboxfanj has been helping me with the local_manifest, but I'm still not certain where/who to get my CM base files from. I used yours and hit a wall. Then I began using the TeamLGOG files and have gotten a bit further, but still can't build. Any help you could give and I'd be grateful.
Click to expand...
Click to collapse
for aokp this is the only local manifest that works haze help me put it together... it builds but some files from a working rom are needed to make the build run proper
<manifest>
<project path="device/lge/geehrc4g_spr_us" name="TeamLGOG/android_device_lge_geehrc4g_spr_us" remote="aokp" revision="cm-10.1"/>
<project path="device/lge/gee-common" name="TeamLGOG/android_device_lge_gee-common" remote="aokp" revision="cm-10.1"/>
<project path="vendor/lge/android_vendor_lge_gee" name="TeamLGOG/android_vendor_lge_gee" remote="aokp" revision="cm-10.1"/>
<project path="kernel/lge/geem" name="TeamLGOG/lge-kernel-geem" remote="aokp" revision="jellybean"/>
using this same manifest it wont allow syncing of any other repo than the aokp... ive tried the one you posted and it doesnt allow repo sync ( for me at least) of any repo i try to init -u, ive had a few talks with rlasalle and shell about the local manifest trying to pry the secret out but so far all ive really been told was yeah thats wrong..lol ( dont take this as trash talk...its not)... im a noob when it comes to source building myself but have tons of porting experience and have managed to slap together several very stable aokp builds for this phone using that local manifest and haze's guide found here....hopefully this thread will help solve the mystery local manifest and everyone can use it to build proper....glad to see this here.. thanks
BMP7777 said:
No way, man....you're doing ME a favor. But, without coming off like a moron, I am extremely confused about many things in the building process for this particular device. Samsung's were a pain, but much more straightforward. Even a variant, like the Hercules, was usually just a change or two from the skyrocket in terms of functionality. I haven't been able to locate the actual LS970 files in CM anywhere. Do you mind laying it out for me once and for all, so I can stop shuffling around? xboxfanj has been helping me with the local_manifest, but I'm still not certain where/who to get my CM base files from. I used yours and hit a wall. Then I began using the TeamLGOG files and have gotten a bit further, but still can't build. Any help you could give and I'd be grateful.
Click to expand...
Click to collapse
Mine will not build CM...I have a branch for EOS, branch for Rootbox...and on codefirex we have a branch for CFX (which I built the other day, just havent released yet).
Our gits work just like the d2 variants. Since the devices are pretty uniform, with a few excepts (Camera and SD card), we a Common git (gee-common) then a separate device git (geehrc4g_spr_us). Then you have your kernel, my kernel will not build on cm as is, you would have modify some build flags to get it work inline. I use the 4.7.3 toolchain, where as CM still uses 4.6. Lastly you would have your gee-vendor.
If you look at the roms based off CM you can pretty much use the CM device trees to build those devices with minimal changes to your geehrc4g_spr_us device trees. IE Carbon rom is basically a CM clone, you just change everything CM to read carbon, (cm.mk becomes carbon.mk).
CM is basically "Ala cart" you only download what you need, that way you dont have to go through downloading every kernel and device source they build for. That sync would take forever. So you repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1, then you can grab your device files with your local manifest. then you have to, cd ~/android/system/vendor/cm and then ./get-prebuilts... to get all of your prebuilts.
I hope this makes sense, lol or that I answered your questions.
rlasalle15 said:
Mine will not build CM...I have a branch for EOS, branch for Rootbox...and on codefirex we have a branch for CFX (which I built the other day, just havent released yet).
Our gits work just like the d2 variants. Since the devices are pretty uniform, with a few excepts (Camera and SD card), we a Common git (gee-common) then a separate device git (geehrc4g_spr_us). Then you have your kernel, my kernel will not build on cm as is, you would have modify some build flags to get it work inline. I use the 4.7.3 toolchain, where as CM still uses 4.6. Lastly you would have your gee-vendor.
If you look at the roms based off CM you can pretty much use the CM device trees to build those devices with minimal changes to your geehrc4g_spr_us device trees. IE Carbon rom is basically a CM clone, you just change everything CM to read carbon, (cm.mk becomes carbon.mk).
CM is basically "Ala cart" you only download what you need, that way you dont have to go through downloading every kernel and device source they build for. That sync would take forever. So you repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1, then you can grab your device files with your local manifest. then you have to, cd ~/android/system/vendor/cm and then ./get-prebuilts... to get all of your prebuilts.
I hope this makes sense, lol or that I answered your questions.
Click to expand...
Click to collapse
I appreciate it and will get to work on it as soon as I get home. I'll update my experience this evening.....used all my thanks for the day
spleef said:
for aokp this is the only local manifest that works haze help me put it together... it builds but some files from a working rom are needed to make the build run proper
<manifest>
<project path="device/lge/geehrc4g_spr_us" name="TeamLGOG/android_device_lge_geehrc4g_spr_us" remote="aokp" revision="cm-10.1"/>
<project path="device/lge/gee-common" name="TeamLGOG/android_device_lge_gee-common" remote="aokp" revision="cm-10.1"/>
<project path="vendor/lge/android_vendor_lge_gee" name="TeamLGOG/android_vendor_lge_gee" remote="aokp" revision="cm-10.1"/>
<project path="kernel/lge/geem" name="TeamLGOG/lge-kernel-geem" remote="aokp" revision="jellybean"/>
using this same manifest it wont allow syncing of any other repo than the aokp... ive tried the one you posted and it doesnt allow repo sync ( for me at least) of any repo i try to init -u, ive had a few talks with rlasalle and shell about the local manifest trying to pry the secret out but so far all ive really been told was yeah thats wrong..lol ( dont take this as trash talk...its not)... im a noob when it comes to source building myself but have tons of porting experience and have managed to slap together several very stable aokp builds for this phone using that local manifest and haze's guide found here....hopefully this thread will help solve the mystery local manifest and everyone can use it to build proper....glad to see this here.. thanks
Click to expand...
Click to collapse
Are you interested in having an AOKP tut in place here? I want to provide build guides for as many ROM styles as there are people willing to help get them in place. :victory:
I'll need a whole bunch of steps for that, I'm sure. Don't sell yourself short: I already hear from others here that you know what you're doing. Even when I was building CM and PACman for the skyrocket, I never had a successful AOKP build. Even my SlimROM was successful, although it never had wifi......but, I digress. If you want to lay out what ever steps you have or know of, we can work together to get everything in place.
BMP7777 said:
Are you interested in having an AOKP tut in place here? I want to provide build guides for as many ROM styles as there are people willing to help get them in place. :victory:
Click to expand...
Click to collapse
wasnt my intention of posting was just offering up my local manifest and adding to the discussion.. i dont think id be much help for the guide im probably greener than you....plus i have been using haze's guide to build except for build errors and file swapping ive had to sort those out on my own..but if you need anything if im able ill try....feel free to do as you like though can put aokp on there if you want.....already posted my local manifest other editing the products.mk,vendor.sh, and android products.mk its pretty much already written out
sorry just read your post script there...lol, ill type up what im doing and send it to you
Spleefs a great guy
Sent from my LG-LS970 using xda premium
Repeatedly hit with the dreaded
Code:
make: *** No rule to make target `/home/bmp7777/beanstalk/out/host/linux-x86/framework/doclava.jar', needed by `/home/bmp7777/beanstalk/out/target/common/docs/api-stubs-timestamp'. Stop.
Have been looking at all ROMs in the 973 and 975 forums, as well as here, and can't find that file........am I a total idiot?
BMP7777 said:
Repeatedly hit with the dreaded
Code:
make: *** No rule to make target `/home/bmp7777/beanstalk/out/host/linux-x86/framework/doclava.jar', needed by `/home/bmp7777/beanstalk/out/target/common/docs/api-stubs-timestamp'. Stop.
Have been looking at all ROMs in the 973 and 975 forums, as well as here, and can't find that file........am I a total idiot?
Click to expand...
Click to collapse
Its not actually a file that goes on the device. Look in another build system or let me know if you want me to send you mine.
Sent from my LG-LS970 using xda app-developers app
xboxfanj said:
Its not actually a file that goes on the device. Look in another build system or let me know if you want me to send you mine.
Sent from my LG-LS970 using xda app-developers app
Click to expand...
Click to collapse
No, I knew that. :angel: I was looking at the builds I have begun(Beanstalk, CM, and Rootbox) but none of them progressed past the syncing stage yet. So, I have no 'out' folder I can copy from. Would you mind sending that?
BMP7777 said:
No, I knew that. :angel: I was looking at the builds I have begun(Beanstalk, CM, and Rootbox) but none of them progressed past the syncing stage yet. So, I have no 'out' folder I can copy from. Would you mind sending that?
Click to expand...
Click to collapse
Sure. I will when I get home.
Sent from my LG-LS970 using xda app-developers app

Emoji Keyboard for Galaxy Nexus Stock..Work together!

Hi to all! I'm new here but I read xda forum from several months!
So.. my mission is modify a bit the new Google Keyboard KitKat Edition with Emoji and make it compatible for devices with under Android SDK.
I decompiled the APK (v 2.0.19003.893803a) and I found this class:
Code:
..\smali\com\android\inputmethod\keyboard\EmojiPalettesView$EmojiCategory.smali
Then, converted in .java class and detected this code:
Code:
addShownCategoryId(0x0);
if((Build.VERSION.SDK_INT > 0x12) || (Build.VERSION.CODENAME.equalsIgnoreCase("KeyLimePie")) || (Build.VERSION.CODENAME.equalsIgnoreCase("KitKat"))) {
addShownCategoryId(0x1);
addShownCategoryId(0x2);
addShownCategoryId(0x3);
addShownCategoryId(0x4);
mCurrentCategoryId = Settings.readLastShownEmojiCategoryId(mPrefs, 0x1);
} else {
mCurrentCategoryId = Settings.readLastShownEmojiCategoryId(mPrefs, 0x5);
}
addShownCategoryId(0x5);
addShownCategoryId(0x6);
I know that new GK have 7 fragments for Emoji (checked on tablet with 4.4) and the code is pretty clear.
They make a control, if SDK>12 or the version name is "KitKat", then we hide the fragments 1,2,3,4.
As you can see on official Android Developer Page, SDK>12 is equal to say SDK>JELLY_BEAN_MR2, then starts with KITKAT (13).
Let's try to change this value? For example "10 (JELLY_BEAN, 4.1)" ?
I don't know what could be happens, but...i will have to try!
Let's go to smali file, I found my interested code:
Code:
.line 158
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v2, [COLOR="Red"][B]0x12[/B][/COLOR] ---> we change it with [COLOR="Black"][B][I]0x10[/I][/B][/COLOR]
if-gt v1, v2, :cond_1
sget-object v1, Landroid/os/Build$VERSION;->CODENAME:Ljava/lang/String;
const-string v2, "KeyLimePie"
So now, i rebuild all with keytool and additionally i make a bit of modifications:
Android Manifest
Code:
changed
<provider android:authorities="@string/authority"
TO
<provider android:authorities="com.google.android.inputmethod.dictionarypack"
Renamed package name with apktool.yml
Code:
rename-manifest-package: com.google.android.inputmethod.latin
Then, opened the built APK and drop in it with WinRar original lib folder and WEB-INF from original APK.
Then, I signed APK with cmd:
Code:
C:\apk\apktool>java -jar SignApk.jar testkey.x509.pem testkey.pk8 c:\apk\apktool
\keyboard\dist\keyboard.apk keyboard_signed.apk
So now..let's try to install the update.....
Code:
[COLOR="Red"][B]New package has a different signature: com.google.android.inputmethod.latin[/B][/COLOR]
How to solve? My experience is focused to write my apps but not modifying the others..
Hope that my work helps other and please help me to fix that problem :good:
is there any possibility to import the key signature from the original APK to modified APK?
I tried to create another APK, with another package name, but Android says that Dictionary Provider is actually used from the original Google Keyboard, it can't continue with installation.
I don't want to remove the original system keyboard app because i want give modified APK to community and i suppose that not all users have phone with root enabled.

[HOWTO] Enable 2G/3G Toggle from Statusbar/Launcher

* ARTICLES MADE IN MACHINE LG G3 ANDROID 4.4.2 MACHINE DO THE SAME AND FLEXIBLE THINKING.
Preparation:
computers
Preset apktool
You must know how to use apktool okay.
File LGPhone.apk and LGSystemUI.apk was taken in Rom deodex you want Mod okay.
Begin.
A. Working with files this most important LGPhone.apk okay.
1. Decompile LGPhone.apk out
2. Navigate to the path LGPhone / smali / com / android / phone
Find PhoneGlobals.smali open in Notepad + +
> Find the following keywords.
Code:
.field private final mMediaButtonReceiver:Landroid/content/BroadcastReceiver;
> Add the following line immediately below it.
Code:
.field private final mModeReceiver:Landroid/content/BroadcastReceiver;
> Find Next line after.
Code:
mReceiver:Landroid/content/BroadcastReceiver;
> Add the following line immediately below it.
Code:
.line 236
new-instance v0, Lcom/android/phone/NetworkModeReceiver;
invoke-direct {v0}, Lcom/android/phone/NetworkModeReceiver;-><init>()V
iput-object v0, p0, Lcom/android/phone/PhoneGlobals;->mModeReceiver:Landroid/content/BroadcastReceiver;
> Find next keyword.
Code:
registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
> Add the following line immediately below it.
Code:
.line 633
new-instance v0, Landroid/content/IntentFilter;
const-string v1, "com.android.phone.CHANGE_NETWORK_MODE"
invoke-direct {v0, v1}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
iget-object v1, p0, Lcom/android/phone/PhoneGlobals;->mModeReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {p0, v1, v0}, Lcom/android/phone/PhoneGlobals;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
> Save PhoneGlobals.smali
3. NetworkModeReceiver Download this file to extract and copy all the files in the path LGPhone smali / smali / com / android / phone
4. Recompile the LGPhone.
5. Fixing what replaces it back old LGPhone.apk file.
-------- 2G/3G toggle mod Guide --------- Choimobile
B. How on LGSystemUI.apk
1. Decompile LGSystemUI.apk out
2. Navigate to the path LGSystemUI/smali/com/lge/quicksettings/
> Open QuicksettingsItemList.smali using Notepad + +
> Find and fix all the 2GOnlyHandler EcoHandler
> Save QuicksettingsItemList.smali back
3. Find LGsystemUI/res/values-xx/
> Open strings.xml by Notepad + +
> Sp_quicksettings_eco_mode_NORMAL edit> Eco mode <a> The 2G <
> Save the strings.xml
4. Find LGSystemUI/res/values
> Open bools.xml using Notepad + +
> Find eco edit keywords >false< >true< save.
5. Download the file, unzip
> Copy smali in LGSystemUI/smali/com/lge/quicksettings/handlers
> Copy image to LGSystemUI/res/drawable-xxhdpi
6. Recompile the LGSystemUI
Replace the following items in LGSystemUI/build/apk file into the root LGSystemUI.apk
- 2 image file in res/drawable-xxhdpi on LGSystemUI.apk/res/drawable-xxhdpi
- Resources.arsc on LGSystemUI.apk
- Classes.dex into LGSystemUI.apk
C. Copy LGPhone.apk and LGSystemUI.apk have to edit the system/app and set 644 memory and delete files LGPhone.odex LGSystemUI.odex go. Reboot the machine and see the results.
Note: The tutorial is done on LG G3 Android 4.4.2 on another machine thinking you have flexibility with each release and each code.
Mod Guide Choimobile 2G/3G toggle.
-Thank: chuc by choimobile.vn/forums
- source: http://choimobile.vn/threads/huong-dan-mod-toggle-2g-3g-2g-only-len-cac-may-android-lg.27391/
Great guide
Thanks
Seems not the same lines can be found on KK.
Also, LGPhone.apk is LGTeleService.apk on my ROM.
Also the lines on smali files are not totally the same.
Thanks for the guide though.
Hi, I know this is an old thread, but I was wondering if you would do "how to enable flashlight toggle"
I have a LG Gpro 240K running one of your lollipop roms. I would REALLY appreciate it.
:good::good::good::good::good:
hi please fix network toggle for lgsystemui and lgteleservice
hi please help
i can't do this changes to my rom
here is files you need
LGTeleService.apk
View attachment LGTeleService.apk
the network toggle is here but don't work ( it can't change network )
i spend a lot of time , i hope some one can fix it
actually can't understand what should i do with lgteleservice.apk ( how to add toggles to this apk?) how to add this codes to lgteleservice?
sorry for my bad english
hi please help
i can't do this changes to my rom
here is files you need
LGTeleService.apk
View attachment 4269150
the network toggle is here but don't work ( it can't change network )
i spend a lot of time , i hope some one can fix it
actually can't understand what should i do with lgteleservice.apk ( how to add toggles to this apk?) how to add this codes to lgteleservice?
sorry for my bad english
EAGLEBOOY said:
hi please help
i can't do this changes to my rom
here is files you need
LGTeleService.apk
View attachment 4269150
the network toggle is here but don't work ( it can't change network )
i spend a lot of time , i hope some one can fix it
actually can't understand what should i do with lgteleservice.apk ( how to add toggles to this apk?) how to add this codes to lgteleservice?
sorry for my bad english
Click to expand...
Click to collapse
hi i fixed it
you should change this line in build.prop
ro.build.user=cloudyfa
to
ro.build.user=matrix_neo
+++++++++++++++++++++++++++++++
this is because
in SystemUI\smali\com\lge\systemui
a file with this name "ModelFeature.smali" in lines 527 and 541
const-string v0, "matrix_neo"
const-string v0, "matrix_neo"
should same as line in build.prop
ro.build.user=*********

Autobrightness fix for all MIUI ROMs

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

Categories

Resources