[GUIDE + Microphone Fix][NOOB Friendly] Port CM9 / CM10 Based Roms

D

DQiB

Guest
Intro

Code:
/* Last Time i got multiple Requests how to FIX Ril in CM9/CM10 Based Roms
/* Now, i figured out how to get the Mic working and how to port the
/* CM10/CM9 Based Roms, with extended explaining how to and
/* logcats with the problem what needs to be fixed!
/* This Thread tell you all Informations and will show Picture based
/* Informations also ;)



Now lets start ^^ :eek:

Step 1
Its quietly easy:

-extract both Roms in two folders, like the base Rom (CM9/CM10 from your Device) in a Folder named Port and the (CM9/CM10 based) Rom from the Device from that u wanna port in a Folder like "Orig/Original" :D
Picture:


- Now delete the following Folders in "Port" Folder (the specific folders are placed in /system): /app ; /framework ; /fonts ; /media
Picture:


- Open both Folders once more and move the /app ; /framework ; /fonts ; /media folder from "Original/system" Folder in the "Port/system" Folder
Picture:


-Now u have the basic thing in it ;)

Step 2
- now delete from the "Port/system/lib" Folder this File: android_runtime.so ;)

- Now move the android_runtime.so from the "Original/system/lib" Folder in the "Port/system/lib" Folder ^^
Picture:


- Now u need to modify the build.prop (Notepad++)! Open both in Notepad+ and delete the "ro.build.description=
ro.build.fingerprint=" Line from the original build.prop!

- Open the build.prop from the "Original/system Folder" and copy the "ro.build.description=
ro.build.fingerprint=" Lines

- Now re-open the build.prop from the the "Port/system" Folder and paste the lines below "# Do not try to parse ro.build.description or .fingerprint" Line!

Picture:

Now save it ;)

-Zip all Folders and Files in the "Port" Folder!

-Try to flash it and try to BOOT it ... (I think that it wont boot)

Step 3
I think it wont boot ;) (U will see a long time the Bootanimation and nothing will happen)
Its just a lib related error:
Code:
F/libc    (  449): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)

I/DEBUG   (  117): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

I/DEBUG   (  117): Build fingerprint: 'lge/thunderg/thunderg:2.3.3/GRI40/LG-P500-V20h.19D34B612E:user/release-keys'

I/DEBUG   (  117): pid: 449, tid: 449  >>> system_server <<<

I/DEBUG   (  117): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad

I/DEBUG   (  117):  r0 deadbaad  r1 0000000c  r2 00000027  r3 40000000

I/DEBUG   (  117):  r4 00000000  r5 00000080  r6 4b048987  r7 be9f9778

I/DEBUG   (  117):  r8 40813200  r9 00000006  10 46218e1c  fp fffffe50

I/DEBUG   (  117):  ip ffffffff  sp be9f9740  lr 4001f377  pc 4001b7c2  cpsr 00000030

I/DEBUG   (  117):  d0  3fe99999a0000000  d1  3ff0000000000000

I/DEBUG   (  117):  d2  bebbbc6c1a570a20  d3  3f1155e54e7e8408

I/DEBUG   (  117):  d4  bfb1be5a93a83e1d  d5  4000000000000000

I/DEBUG   (  117):  d6  4a066ec000000000  d7  000000344d520d0c

I/DEBUG   (  117):  d8  0000000000000000  d9  0000000000000000

I/DEBUG   (  117):  d10 0000000000000000  d11 0000000000000000

I/DEBUG   (  117):  d12 0000000000000000  d13 0000000000000000

I/DEBUG   (  117):  d14 0000000000000000  d15 0000000000000000

I/DEBUG   (  117):  scr 80000010

I/DEBUG   (  117): 

I/DEBUG   (  117):          #00  pc 000177c2  /system/lib/libc.so

I/DEBUG   (  117):          #01  pc 0000c658  /system/lib/libnativehelper.so (jniRegisterNativeMethods)

I/DEBUG   (  117): 

I/DEBUG   (  117): code around pc:

I/DEBUG   (  117): 4001b7a0 1c2bd00c 2d00682d e027d1fb 2a0068da  ..+.-h.-..'..h.*

I/DEBUG   (  117): 4001b7b0 4b16d004 447b2001 47906018 22274814  ...K. {D.`.G.H'"

I/DEBUG   (  117): 4001b7c0 70022580 ef6ef7f4 f7f62106 aa01e80c  .%.p..n..!......

I/DEBUG   (  117): 4001b7d0 05692400 60546091 20061c11 f7f59401  .$i..`T`... ....

I/DEBUG   (  117): 4001b7e0 a905ebc8 20022200 ebd0f7f5 ef5af7f4  .....". ......Z.

I/DEBUG   (  117): 

I/DEBUG   (  117): code around lr:

I/DEBUG   (  117): 4001f354 4b0db5f0 447bb083 681c2600 68a59001  ...K..{D.&.h...h

I/DEBUG   (  117): 4001f364 e0086867 5ea8220c dd032800 99011c28  gh...".^.(..(...

I/DEBUG   (  117): 4001f374 43064788 3f013554 6824d5f4 d1ee2c00  .G.CT5.?..$h.,..

I/DEBUG   (  117): 4001f384 1c30b003 46c0bdf0 0002818e 1c0fb5f0  ..0....F........

I/DEBUG   (  117): 4001f394 b0891c3d a9064355 604d9103 90064914  =...UC....M`.I..

I/DEBUG   (  117): 

I/DEBUG   (  117): memory map around addr deadbaad:

I/DEBUG   (  117): be9da000-be9fa000 [stack]

I/DEBUG   (  117): (no map for address)

I/DEBUG   (  117): (no map above)

I/DEBUG   (  117): 

I/DEBUG   (  117): stack:

I/DEBUG   (  117):     be9f9700  00000002  

I/DEBUG   (  117):     be9f9704  7b4c2d14  

I/DEBUG   (  117):     be9f9708  40047774  /system/lib/libc.so

I/DEBUG   (  117):     be9f970c  4004c8bc  

I/DEBUG   (  117):     be9f9710  00000000  

I/DEBUG   (  117):     be9f9714  4001f377  /system/lib/libc.so

I/DEBUG   (  117):     be9f9718  4b04753a  /system/lib/libandroid_servers.so

I/DEBUG   (  117):     be9f971c  4001e0dd  /system/lib/libc.so

I/DEBUG   (  117):     be9f9720  ffffffff  

I/DEBUG   (  117):     be9f9724  00000000  

I/DEBUG   (  117):     be9f9728  00000000  

I/DEBUG   (  117):     be9f972c  4b048987  /system/lib/libandroid_servers.so

I/DEBUG   (  117):     be9f9730  be9f9778  [stack]

I/DEBUG   (  117):     be9f9734  4001e4f5  /system/lib/libc.so

I/DEBUG   (  117):     be9f9738  df0027ad  

I/DEBUG   (  117):     be9f973c  00000000  

I/DEBUG   (  117): #00 be9f9740  00000002  

I/DEBUG   (  117):     be9f9744  00000100  

I/DEBUG   (  117):     be9f9748  4b045169  /system/lib/libandroid_servers.so

I/DEBUG   (  117):     be9f974c  7b4c2d14  

I/DEBUG   (  117):     be9f9750  0000002b  

I/DEBUG   (  117):     be9f9754  fffffbdf  

I/DEBUG   (  117):     be9f9758  0000f2c8  [heap]

I/DEBUG   (  117):     be9f975c  40849fdd  /system/lib/libdvm.so

I/DEBUG   (  117):     be9f9760  0000f2c8  [heap]

I/DEBUG   (  117):     be9f9764  401d665b  /system/lib/libnativehelper.so

I/DEBUG   (  117): #01 be9f9768  40849fdd  /system/lib/libdvm.so

I/DEBUG   (  117):     be9f976c  401d665b  /system/lib/libnativehelper.so

I/DEBUG   (  117):     be9f9770  4b04aac4  /system/lib/libandroid_servers.so

I/DEBUG   (  117):     be9f9774  00000004  

I/DEBUG   (  117):     be9f9778  0000f2c8  [heap]

I/DEBUG   (  117):     be9f977c  74800019  

I/DEBUG   (  117):     be9f9780  00000028  

I/DEBUG   (  117):     be9f9784  4b048987  /system/lib/libandroid_servers.so

I/DEBUG   (  117):     be9f9788  0000f2c8  [heap]

I/DEBUG   (  117):     be9f978c  00012830  [heap]

I/DEBUG   (  117):     be9f9790  00000000  

I/DEBUG   (  117):     be9f9794  4b04522d  /system/lib/libandroid_servers.so

I/DEBUG   (  117):     be9f9798  00012b88  [heap]

I/DEBUG   (  117):     be9f979c  4b0473c1  /system/lib/libandroid_servers.so

I/DEBUG   (  117):     be9f97a0  001fc710  [heap]

I/DEBUG   (  117):     be9f97a4  00012830  [heap]

I/DEBUG   (  117):     be9f97a8  00000000  

I/DEBUG   (  117):     be9f97ac  4b0473ef  /system/lib/libandroid_servers.so

D/Zygote  (  408): Process 449 terminated by signal (11)

I/Zygote  (  408): Exit zygote because system server (449) has terminated
What is easy to fix: Replace the android_servers.so in "Port/system/lib" Folder with the one in Original/system/lib Folder ;)
Picture:


Now re-zip all Files and Folders in the /Port Folder and it should boot now after u flashed it! :D

Step 4
Maybe u get always a Phone FC Error or no one can hear u while u are calling someone! :silly:
Thats an Ril related error :eek:
Now u think, what should i do, right?
Hmm u need to decompile both framework.jar´s from "Port/system/framework/" and the one from ur base zip like CM9 or CM10 from your device!

u need apktool for that, its not related for framework.jar´s when u have a gingerbread apktool (1.4.3) or an ics one! its only related that u know how to decompile, recompile and repack the jar (winrar)

rename the framework.jar from your CM9 or CM10 (your Device, NOT FROM THE "PORT" Folder) to framework-orig.jar and put it in apktool folder!
Place the framework.jar from the "Port" folder also in the apktool folder ;)

Now 2 simple commands in apktool cmd window:
Code:
apktool d framework-orig.jar
and
Code:
apktool d framework.jar
let it decompile and close the window only when there is a word: "Done"!
Now open framework.jar.out folder and framework-orig.jar.out folder, yet open in both folders: /smali/com/android/internal/telephony ^^
copy all files which start with RIL and end with .smali and placed in the framework-orig.jar.out/smali/com/android/internal/telephony Folder and put it in the framework.jar.out/smali/com/android/telephony Folder (replace them all)

Some Devices have in build.prop a specific Ril Class Path! Mine is: "ro.telephony.ril_class=JellaxyRIL" urs can variate after the "="! If this is the case, look once more in framewok-orig.jar.out/smali/com/android/internal/telephony and search for "JellaxyRIL" or how ur´s is called after "=" in the RIL Class ;)
Now copy the "JellaxyRIL.smali" (Its the one from my base Rom) or whatever in the other Folder "framework.jar.out/smali/com/android/telephony" !

Now re-compile it:
Code:
apktool b framework.jar.out
let it compile, it takes a few minutes (depends on ur PC Speed)
Now open the framework.jar from "apktool" Folder with WinRAR
and move the classes.dex from "apktool/framework.jar.out/build/apk in the opened WinRAR Window and let it re-pack, now close the Windows (WinRAR) and move the new framework.jar from /apktool in "Port/system/framework"
Voila, Mic Working and no more Phone FC´s!


If u have a problem with it, pm me with the following files:
framework.jar (from the Rom u wanna port), framework.jar (from your base CM10 or CM9) and your build.prop (from ur base CM10 or CM9)

Step 6
May barebone your Rom will improve the stability ;)
Some apps u can remove:
*QuickSearchBox.apk
*STK.apk
*GoogleMail.apk (Mail.apk is still included, so why there should be 2 Mail Apps;) )
*Term.apk (Terminal Emulator)
*Voice Dialer (Its not the phone and takes also no effect to it)
*VideoEditor.apk (WTF who wants to cut Videos over android 0.o

oh i forgot about that step:
move from "Port/system/etc/permissions" Folder, all Files to "Original/system/etc/permissions" Folder (Replace them) and move them all back to "Port/system/etc/permissions" Folder! One more Thing: if Superuser isn´t working, take the "su File from "Original/system/xbin" and move it to "Port/system/xbin" Folder and replace it!
 
Last edited:
D

DQiB

Guest
In case the Rom wont boot or u cant do any step bcoz u wont understand it:

My support: Only over Facebook :eek:
For the reply "Rom wont boot! Pls help me :(", i wont read it!
U need to add the related things i provide now:

Code:
Logcat:
Rom (u wanna port):
Rom Link:
Base Rom:
Base Rom Link:
Your Device:
 
Last edited: