[GUIDE][ICS/JB/common] Definitive FAQ for newest miui porting

Search This thread

myozeus

Senior Member
Jul 14, 2011
89
20
Bangalore
I'm trying to port MIUI from Htc explorer to Karbonn A5. Base being 4.04.(both ARMv7 and same family of chipsets) I get this recurring error after its first occurence:
9): Error Loading libmpqstobinder and it loops on logcat.(repeats indefinitely)

Please do help as this error occurs even while porting CM9.
NOTE: libmpqstobinder.so is NOT present in EITHER of the roms. So that error is kinda confusing.

Here is the log cat: http://pastie.org/7698038 OR instance of logcat where the specified error begins
Code:
V/AudioHardwareMSM76XXA(  119): AudioStreamOutMSM72xx::getParameters() voip_flag=

V/AudioPolicyManagerBase(  119): setOutputDevice() output 1 device 2 delayMs 0

W/AudioFlinger(  119): Thread AudioOut_1 cannot connect to the power manager service

W/AudioFlinger(  119): Thread AudioOut_1 cannot connect to the power manager service

V/AudioHardwareMSM76XXA(  119): AudioStreamOutMSM72xx::setParameters() routing=2

V/AudioHardwareMSM76XXA(  119): set output routing 2

I/AudioHardwareMSM76XXA(  119): do output routing device 2

I/AudioHardwareMSM76XXA(  119): Routing audio to Speakerphone

E/AudioHardwareMSM76XXA(  119): TYDRV xiang add start read file

E/AudioHardwareMSM76XXA(  119): TYDRV xiang read success (48,231)

W/AudioHardwareMSM76XXA(  119): rpc_snd_set_device(6, 1, 1)

V/AudioPolicyManagerBase(  119): applyStreamVolumes() for output 1 and device 2

V/AudioPolicyManagerBase(  119): VOLUME vol index=[66 100 100], dB=[-17.0 0.0 0.0] ampl=1.00000

V/AudioPolicyManagerBase(  119): setStreamVolume() for output 1 stream 0, volume 1.000000, delay 0

D/AudioHardwareMSM76XXA(  119): setVoiceVolume(1.400000)

I/AudioHardwareMSM76XXA(  119): Setting in-call volume to 7 (available range is 2 to 7)

V/AudioPolicyManagerBase(  119): VOLUME vol index=[60 100 100], dB=[-11.0 0.0 0.0] ampl=1.00000

V/AudioPolicyManagerBase(  119): setStreamVolume() for output 1 stream 1, volume 1.000000, delay 0

V/AudioPolicyManagerBase(  119): VOLUME vol index=[66 100 100], dB=[-10.2 0.0 0.0] ampl=1.00000

V/AudioPolicyManagerBase(  119): setStreamVolume() for output 1 stream 2, volume 1.000000, delay 0

V/AudioPolicyManagerBase(  119): VOLUME vol index=[60 100 100], dB=[-11.0 0.0 0.0] ampl=1.00000

V/AudioPolicyManagerBase(  119): setStreamVolume() for output 1 stream 3, volume 1.000000, delay 0

V/AudioPolicyManagerBase(  119): VOLUME vol index=[66 100 100], dB=[-10.2 0.0 0.0] ampl=1.00000

V/AudioPolicyManagerBase(  119): setStreamVolume() for output 1 stream 4, volume 1.000000, delay 0

V/AudioPolicyManagerBase(  119): VOLUME vol index=[66 100 100], dB=[-10.2 0.0 0.0] ampl=1.00000

V/AudioPolicyManagerBase(  119): setStreamVolume() for output 1 stream 5, volume 1.000000, delay 0

V/AudioPolicyManagerBase(  119): checkAndSetVolume() cannot set stream 6 volume with force use = 0 for comm

V/AudioPolicyManagerBase(  119): VOLUME vol index=[66 100 100], dB=[-10.2 0.0 0.0] ampl=1.00000

V/AudioPolicyManagerBase(  119): setStreamVolume() for output 1 stream 7, volume 1.000000, delay 0

V/AudioPolicyManagerBase(  119): VOLUME vol index=[66 100 100], dB=[-17.0 0.0 0.0] ampl=1.00000

V/AudioPolicyManagerBase(  119): setStreamVolume() for output 1 stream 8, volume 1.000000, delay 0

V/AudioPolicyManagerBase(  119): VOLUME vol index=[60 100 100], dB=[-11.0 0.0 0.0] ampl=1.00000

V/AudioPolicyManagerBase(  119): setStreamVolume() for output 1 stream 9, volume 1.000000, delay 0

V/AudioPolicyManagerBase(  119): VOLUME vol index=[60 100 100], dB=[-11.0 0.0 0.0] ampl=1.00000

V/AudioPolicyManagerBase(  119): setStreamVolume() for output 1 stream 10, volume 1.000000, delay 0

V/AudioPolicyManagerBase(  119): getDeviceForStrategy() strategy 0, device 2

V/AudioPolicyManagerBase(  119): getDeviceForStrategy() strategy 1, device 1

V/AudioPolicyManagerBase(  119): getDeviceForStrategy() strategy 2, device 2

V/AudioPolicyManagerBase(  119): getDeviceForStrategy() strategy 0, device 2

V/AudioPolicyManagerBase(  119): getDeviceForStrategy() strategy 3, device 2

V/AudioPolicyManagerBase(  119): getDeviceForStrategy() strategy 4, device 2

V/AudioPolicyManagerBase(  119): setSystemProperty() property ro.camera.sound.forced, value 0

V/AudioPolicyManagerBase(  119): ENFORCED_AUDIBLE can be muted

E/        (  119): Error Loading libmpqstobinder 

E/        (  119): Error: Cannot load library: load_library[1091]: Library 'libmpqstobinder.so' not found
 

_polimorph_

Senior Member
Jan 23, 2012
556
1,125
Jibou, Transilvania
Can anyone, plz, help with this one.

This seems to be the problem, a resource error:

Code:
android.content.res.Resources$NotFoundException: Resource ID #[B]0x1110044[/B]

I haven't done it myself, but from my knowledge this is how you solve it. Give it a try.
So what you want to do is compare the decompiled folders of framework-res.apk from your base with port's coresponding decompiled apk, search for that code an replace it in the port. Recompile and you're good to go.
 

xnan

Senior Member
Jun 17, 2012
65
42
28
Tuticorin
I'm having the following errors... I have attached my full log..... Somebody please help me with this :crying: :crying: :crying:

Code:
Failure starting Input Manager Service
E/SystemServer(1695): java.lang.SecurityException: invalid status bar icon slot: ime
E/SystemServer(1695): at com.android.server.StatusBarManagerService.setIconVisibility(StatusBarManagerService.java:203)
E/SystemServer(1695): at com.android.server.InputMethodManagerService.<init>(InputMethodManagerService.java:480)
E/SystemServer(1695): at com.android.server.ServerThread.run(SystemServer.java:303)

Code:
04-25 08:41:20.906: E/AndroidRuntime(1695): *** FATAL EXCEPTION IN SYSTEM PROCESS: ConnectivityThread
E/AndroidRuntime(1695): java.lang.NumberFormatException: unable to parse 'rmnet\d' as integer
E/AndroidRuntime(1695): at java.lang.Integer.parse(Integer.java:383)
E/AndroidRuntime(1695): at java.lang.Integer.parseInt(Integer.java:372)
E/AndroidRuntime(1695): at java.lang.Integer.parseInt(Integer.java:332)
E/AndroidRuntime(1695): at com.android.server.ConnectivityService$RadioAttributes.<init>(ConnectivityService.java:216)
E/AndroidRuntime(1695): at com.android.server.ConnectivityService.<init>(ConnectivityService.java:299)
E/AndroidRuntime(1695): at com.android.server.ConnectivityService.<init>(ConnectivityService.java:66)
E/AndroidRuntime(1695): at com.android.server.ConnectivityService$ConnectivityThread.run(ConnectivityService.java:234)
 

Attachments

  • log.txt
    169 KB · Views: 2

ganeshbiyer

Inactive Recognized Contributor
Jan 16, 2011
2,404
2,628
Bangalore
I have ported MIUI 3.4.24 (Maguro) to Xperia ION using Cm10 FXP216.
I am facing two problems.

1. When I install apps from playstore that I have purchased, after downloading and while installing the phone hot boots. I cleared cache and all data for playstore. Still problem persists. I tried factory reset. I tried clearing internal sd card. but to no avail.

This the logcat link. http://www.mediafire.com/view/?ppphonmuo72auyi

Code:
00:38:09.440 Warning PackageManager 11450  Failure retrieving resources forcom.android.vending: Resource ID #0x0
00:38:15.041 Warning PackageManager 11450  Failure retrieving resources forcom.android.vending: Resource ID #0x0
00:38:18.452 Warning PackageManager 10493  Failure retrieving resources forcom.android.providers.downloads: Resource ID #0x0
00:38:29.137 Warning PackageParser 13569  Unable to read AndroidManifest.xml of /data/data/com.android.providers.downloads/cache/downloadfile-1.apk
00:38:29.137 Warning PackageParser 13569  java.io.FileNotFoundException: AndroidManifest.xml
00:38:29.137 Warning PackageParser 13569      at android.content.res.AssetManager.openXmlAssetNative(Native Method)
00:38:29.137 Warning PackageParser 13569      at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:493)
00:38:29.137 Warning PackageParser 13569      at android.content.res.AssetManager.openXmlResourceParser(AssetManager.java:461)
00:38:29.137 Warning PackageParser 13569      at android.content.pm.PackageParser.parsePackage(PackageParser.java:525)
00:38:29.137 Warning PackageParser 13569      at android.content.pm.PackageManager.getPackageArchiveInfo(PackageManager.java:2204)
00:38:29.137 Warning PackageParser 13569      at tms.by.b(Unknown Source)
00:38:29.137 Warning PackageParser 13569      at tms.b.b(Unknown Source)
00:38:29.137 Warning PackageParser 13569      at tms.bw.b(Unknown Source)
00:38:29.137 Warning PackageParser 13569      at tms.bw.a(Unknown Source)
00:38:29.137 Warning PackageParser 13569      at tms.bw.b(Unknown Source)
00:38:29.137 Warning PackageParser 13569      at com.tencent.tmsecure.module.qscanner.QScannerManager.scanApks(Unknown Source)
00:38:29.137 Warning PackageParser 13569      at com.tencent.tmsprovider.FunctionHandler.getVirusResult(FunctionHandler.java:158)
00:38:29.137 Warning PackageParser 13569      at com.tencent.tmsprovider.GuardProvider.update(GuardProvider.java:136)
00:38:29.137 Warning PackageParser 13569      at android.content.ContentProvider$Transport.update(ContentProvider.java:235)
00:38:29.137 Warning PackageParser 13569      at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:203)
00:38:29.137 Warning PackageParser 13569      at android.os.Binder.execTransact(Binder.java:367)
00:38:29.137 Warning PackageParser 13569      at dalvik.system.NativeStart.run(Native Method)
00:38:31.023 Info PackageHelper 13612  Size of container 2 MB
00:38:38.078 Warning PackageManager 13815  Library not found: /system/framework/com.dsi.ant.antradio_library.jar
00:38:38.188 Warning PackageParser 13815  No actions in intent filter at /system/app/Bluetooth.apk Binary XML file line #147
00:38:38.200 Warning PackageParser 13815  No actions in intent filter at /system/app/Browser.apk Binary XML file line #298
00:38:38.262 Warning PackageParser 13815  No actions in intent filter at /system/app/Contacts.apk Binary XML file line #571
00:38:38.306 Info PackageManager 13815  /system/app/DrmProvider.apk changed; collecting certs
00:38:38.320 Warning PackageManager 13815  Signature mismatch for shared user : SharedUserSetting{41926fa0 android.media/10013}
00:38:38.320 Error PackageManager 13815  Package com.android.providers.drm has no signatures that match those in shared user android.media; ignoring!
00:38:38.472 Info PackageManager 13815  /system/app/InputDevices.apk changed; collecting certs
00:38:38.507 Warning PackageManager 13815  Signature mismatch for shared user : SharedUserSetting{417a9ea0 android.uid.system/1000}
00:38:38.507 Info PackageManager 13815  /system/app/KeyChain.apk changed; collecting certs
00:38:38.507 Error PackageManager 13815  Package com.android.inputdevices has no signatures that match those in shared user android.uid.system; ignoring!
00:38:38.507 Warning PackageManager 13815  Signature mismatch for shared user : SharedUserSetting{417a9ea0 android.uid.system/1000}
00:38:38.507 Error PackageManager 13815  Package com.android.keychain has no signatures that match those in shared user android.uid.system; ignoring!
00:38:38.654 Info PackageManager 13815  Package com.nononsenseapps.notepad at /system/app/Notes.apk ignored: updated version 55 better than this 45
00:38:38.885 Info PackageManager 13815  /system/app/UserDictionaryProvider.apk changed; collecting certs
00:38:38.897 Warning PackageManager 13815  Signature mismatch for shared user : SharedUserSetting{41921758 android.uid.shared/10001}
00:38:38.898 Error PackageManager 13815  Package com.android.providers.userdictionary has no signatures that match those in shared user android.uid.shared; ignoring!
00:38:38.975 Info PackageManager 13815  Package com.google.android.gm at /system/app/Gmail.apk ignored: updated version 734 better than this 615
00:38:38.988 Info PackageManager 13815  Package com.google.android.gms at /system/app/GmsCore.apk ignored: updated version 3027110 better than this 2012110
00:38:39.147 Info PackageManager 13815  Package com.google.android.googlequicksearchbox at /system/app/QuickSearchBox.apk ignored: updated version 210020410 better than this 210020210
00:38:39.198 Info PackageManager 13815  Package com.google.android.marvin.talkback at /system/app/Talkback.apk ignored: updated version 95 better than this 83
00:38:39.236 Debug PackageManager 13815  No files in app dir /vendor/app
00:38:39.248 Debug ExtraPackageManagerServices 13815  No files in preinstall app dir /data/preinstall_apps
00:38:39.414 Info PackageParser 13815  org.swiftp: compat added android.permission.WRITE_EXTERNAL_STORAGE
00:38:39.431 Info PackageManager 13815  Time to scan packages: 1.359 seconds
00:38:39.444 Warning PackageManager 13815  Removing dangling permission: com.tmobile.permission.ACCESS_DRM_THEME from package null
00:38:39.444 Warning PackageManager 13815  Not granting permission android.permission.ACCESS_ALL_DOWNLOADS to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:39.444 Warning PackageManager 13815  Not granting permission android.permission.ASEC_ACCESS to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:39.444 Warning PackageManager 13815  Not granting permission android.permission.ASEC_CREATE to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:39.444 Warning PackageManager 13815  Not granting permission android.permission.ASEC_DESTROY to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:39.444 Warning PackageManager 13815  Not granting permission android.permission.ASEC_MOUNT_UNMOUNT to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:39.446 Warning PackageManager 13815  Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone
00:38:39.479 Warning PackageManager 13815  Unknown permission android.permission.WRITE_INTERNAL_STORAGE in package com.miui.player
00:38:39.480 Warning PackageManager 13815  Unknown permission com.android.vending.billing.IBillingAccountService.BIND2 in package com.google.android.gsf.login
00:38:39.480 Warning PackageManager 13815  Unknown permission com.android.chrome.TOS_ACKED in package com.google.android.gsf.login
00:38:39.480 Warning PackageManager 13815  Not granting permission android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS to package com.android.browser (protectionLevel=2 flags=0x9be45)
00:38:39.480 Warning PackageManager 13815  Unknown permission android.permission.ACCESS_COARSE_UPDATES in package com.miui.cloudservice
00:38:39.480 Warning PackageManager 13815  Unknown permission android.permission.INSTALL_DRM in package com.android.mms
00:38:39.480 Warning PackageManager 13815  Unknown permission android.permission.CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY in package com.google.android.marvin.talkback
00:38:39.480 Warning PackageManager 13815  Unknown permission android.permission.CAN_REQUEST_TOUCH_EXPLORATION_MODE in package com.google.android.marvin.talkback
00:38:39.480 Warning PackageManager 13815  Not granting permission android.permission.READ_FRAME_BUFFER to package com.google.android.marvin.talkback (protectionLevel=18 flags=0x9bec5)
00:38:39.480 Warning PackageManager 13815  Unknown permission android.permission.READ_MEDIA_STORAGE in package com.keramidas.TitaniumBackup
00:38:39.480 Warning PackageManager 13815  Not granting permission android.permission.WRITE_MEDIA_STORAGE to package com.keramidas.TitaniumBackup (protectionLevel=18 flags=0x4008be44)
00:38:39.480 Warning PackageManager 13815  Not granting permission com.android.voicemail.permission.READ_WRITE_ALL_VOICEMAIL to package com.keramidas.TitaniumBackup (protectionLevel=2 flags=0x4008be44)
00:38:39.480 Warning PackageManager 13815  Unknown permission android.permission.ACCESS_SUPERUSER in package com.keramidas.TitaniumBackup
00:38:39.480 Warning PackageManager 13815  Unknown permission android.permission.INTERACT_ACROSS_USERS in package com.google.android.gms
00:38:39.480 Warning PackageManager 13815  Unknown permission android.permission.READ_OWNER_DATA in package com.google.android.setupwizard
00:38:39.484 Warning PackageManager 13815  Unknown permission android.permission.WRITE_OWNER_DATA in package com.google.android.setupwizard
00:38:39.523 Warning PackageManager 13815  Unknown permission android.permission.WRITE_INTERNAL_STORAGE in package com.android.updater
00:38:39.547 Warning PackageManager 13815  Unknown permission com.google.android.voicesearch.SHORTCUTS_ACCESS in package com.google.android.googlequicksearchbox
00:38:39.547 Warning PackageManager 13815  Unknown permission com.google.android.apps.googlevoice.permission.AUTO_SEND in package com.google.android.googlequicksearchbox
00:38:39.547 Warning PackageManager 13815  Unknown permission android.permission.PREVENT_POWER_KEY in package com.android.gallery3d
00:38:39.547 Warning PackageManager 13815  Unknown permission android.permission.READ_SECURE_SETTINGS in package com.wali.miui.networkassistant
00:38:39.547 Warning PackageManager 13815  Unknown permission android.permission.READ_SETTINGS in package com.wali.miui.networkassistant
00:38:39.547 Warning PackageManager 13815  Unknown permission com.android.providers.im.permission.READ_ONLY in package com.google.android.apps.maps
00:38:39.547 Warning PackageManager 13815  Unknown permission com.android.launcher.permission.PRELOAD_WORKSPACE in package com.google.android.partnersetup
00:38:39.547 Warning PackageManager 13815  Not granting permission com.android.permission.WHITELIST_BLUETOOTH_DEVICE to package com.android.nfc (protectionLevel=2 flags=0x9be4d)
00:38:39.547 Warning PackageManager 13815  Not granting permission com.android.permission.HANDOVER_STATUS to package com.android.nfc (protectionLevel=2 flags=0x9be4d)
00:38:39.547 Warning PackageManager 13815  Unknown permission android.permission.MANAGE_USERS in package com.android.vending
00:38:39.547 Warning PackageManager 13815  Unknown permission android.permission.INTERACT_ACROSS_USERS in package com.android.vending
00:38:39.547 Warning PackageManager 13815  Unknown permission adnroid.permission.CHANGE_WIFI_STATE in package com.tencent.tmsprovider
00:38:39.731 Debug PackageManager 13815  generateServicesMap(android.accounts.AccountAuthenticator): 3 services unchanged
00:38:40.117 Info PackageManager 13815  Updating external media status from unmounted to mounted
00:38:40.128 Info PackageManager 13815  No secure containers on sdcard
00:38:40.142 Warning PackageManager 13815  Not granting permission android.permission.ACCESS_ALL_DOWNLOADS to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:40.142 Warning PackageManager 13815  Not granting permission android.permission.ASEC_ACCESS to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:40.142 Warning PackageManager 13815  Not granting permission android.permission.ASEC_CREATE to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:40.142 Warning PackageManager 13815  Not granting permission android.permission.ASEC_DESTROY to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:40.142 Warning PackageManager 13815  Not granting permission android.permission.ASEC_MOUNT_UNMOUNT to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:40.142 Warning PackageManager 13815  Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone
00:38:40.160 Info PackageManager 13815  No secure containers on sdcard
00:38:40.160 Warning PackageManager 13815  Unknown permission android.permission.WRITE_INTERNAL_STORAGE in package com.miui.player
00:38:40.160 Warning PackageManager 13815  Unknown permission com.android.vending.billing.IBillingAccountService.BIND2 in package com.google.android.gsf.login
00:38:40.160 Warning PackageManager 13815  Unknown permission com.android.chrome.TOS_ACKED in package com.google.android.gsf.login
00:38:40.160 Warning PackageManager 13815  Not granting permission android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS to package com.android.browser (protectionLevel=2 flags=0x9be45)
00:38:40.160 Warning PackageManager 13815  Unknown permission android.permission.ACCESS_COARSE_UPDATES in package com.miui.cloudservice
00:38:40.160 Warning PackageManager 13815  Unknown permission android.permission.INSTALL_DRM in package com.android.mms
00:38:40.160 Warning PackageManager 13815  Unknown permission android.permission.CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY in package com.google.android.marvin.talkback
00:38:40.161 Warning PackageManager 13815  Unknown permission android.permission.CAN_REQUEST_TOUCH_EXPLORATION_MODE in package com.google.android.marvin.talkback
00:38:40.161 Warning PackageManager 13815  Not granting permission android.permission.READ_FRAME_BUFFER to package com.google.android.marvin.talkback (protectionLevel=18 flags=0x9bec5)
00:38:40.161 Warning PackageManager 13815  Unknown permission android.permission.READ_MEDIA_STORAGE in package com.keramidas.TitaniumBackup
00:38:40.161 Warning PackageManager 13815  Not granting permission android.permission.WRITE_MEDIA_STORAGE to package com.keramidas.TitaniumBackup (protectionLevel=18 flags=0x4028be44)
00:38:40.161 Warning PackageManager 13815  Not granting permission com.android.voicemail.permission.READ_WRITE_ALL_VOICEMAIL to package com.keramidas.TitaniumBackup (protectionLevel=2 flags=0x4028be44)
00:38:40.161 Warning PackageManager 13815  Unknown permission android.permission.ACCESS_SUPERUSER in package com.keramidas.TitaniumBackup
00:38:40.161 Warning PackageManager 13815  Unknown permission android.permission.INTERACT_ACROSS_USERS in package com.google.android.gms
00:38:40.161 Warning PackageManager 13815  Unknown permission android.permission.READ_OWNER_DATA in package com.google.android.setupwizard
00:38:40.161 Warning PackageManager 13815  Unknown permission android.permission.WRITE_OWNER_DATA in package com.google.android.setupwizard
00:38:40.161 Warning PackageManager 13815  Unknown permission android.permission.WRITE_INTERNAL_STORAGE in package com.android.updater
00:38:40.161 Warning PackageManager 13815  Unknown permission com.google.android.voicesearch.SHORTCUTS_ACCESS in package com.google.android.googlequicksearchbox
00:38:40.161 Warning PackageManager 13815  Unknown permission com.google.android.apps.googlevoice.permission.AUTO_SEND in package com.google.android.googlequicksearchbox
00:38:40.161 Warning PackageManager 13815  Unknown permission android.permission.PREVENT_POWER_KEY in package com.android.gallery3d
00:38:40.161 Warning PackageManager 13815  Unknown permission android.permission.READ_SECURE_SETTINGS in package com.wali.miui.networkassistant
00:38:40.161 Warning PackageManager 13815  Unknown permission android.permission.READ_SETTINGS in package com.wali.miui.networkassistant
00:38:40.180 Warning PackageManager 13815  Unknown permission com.android.providers.im.permission.READ_ONLY in package com.google.android.apps.maps
00:38:40.218 Warning PackageManager 13815  Unknown permission com.android.launcher.permission.PRELOAD_WORKSPACE in package com.google.android.partnersetup
00:38:40.218 Warning PackageManager 13815  Not granting permission com.android.permission.WHITELIST_BLUETOOTH_DEVICE to package com.android.nfc (protectionLevel=2 flags=0x9be4d)
00:38:40.218 Warning PackageManager 13815  Not granting permission com.android.permission.HANDOVER_STATUS to package com.android.nfc (protectionLevel=2 flags=0x9be4d)
00:38:40.218 Warning PackageManager 13815  Unknown permission android.permission.MANAGE_USERS in package com.android.vending
00:38:40.218 Warning PackageManager 13815  Unknown permission android.permission.INTERACT_ACROSS_USERS in package com.android.vending
00:38:40.218 Warning PackageManager 13815  Unknown permission adnroid.permission.CHANGE_WIFI_STATE in package com.tencent.tmsprovider
00:38:41.263 Warning PackageManager 13815  Not granting permission android.permission.ACCESS_ALL_DOWNLOADS to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:41.321 Warning PackageManager 13815  Not granting permission android.permission.ASEC_ACCESS to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:41.339 Warning PackageManager 13815  Not granting permission android.permission.ASEC_CREATE to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:41.433 Warning PackageManager 13815  Not granting permission android.permission.ASEC_DESTROY to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:41.448 Warning PackageManager 13815  Not granting permission android.permission.ASEC_MOUNT_UNMOUNT to package com.android.defcontainer (protectionLevel=2 flags=0x83e45)
00:38:41.475 Warning PackageManager 13815  Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone
00:38:41.498 Warning PackageManager 13815  Unknown permission android.permission.WRITE_INTERNAL_STORAGE in package com.miui.player
00:38:41.656 Warning PackageManager 13815  Unknown permission com.android.vending.billing.IBillingAccountService.BIND2 in package com.google.android.gsf.login
00:38:41.674 Warning PackageManager 13815  Unknown permission com.android.chrome.TOS_ACKED in package com.google.android.gsf.login
00:38:41.674 Warning PackageManager 13815  Not granting permission android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS to package com.android.browser (protectionLevel=2 flags=0x9be45)
00:38:41.674 Warning PackageManager 13815  Unknown permission android.permission.ACCESS_COARSE_UPDATES in package com.miui.cloudservice
00:38:41.693 Warning PackageManager 13815  Unknown permission android.permission.INSTALL_DRM in package com.android.mms
00:38:41.712 Warning PackageManager 13815  Unknown permission android.permission.CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY in package com.google.android.marvin.talkback
00:38:41.713 Warning PackageManager 13815  Unknown permission android.permission.CAN_REQUEST_TOUCH_EXPLORATION_MODE in package com.google.android.marvin.talkback
00:38:41.713 Warning PackageManager 13815  Not granting permission android.permission.READ_FRAME_BUFFER to package com.google.android.marvin.talkback (protectionLevel=18 flags=0x9bec5)
00:38:41.713 Warning PackageManager 13815  Unknown permission android.permission.READ_MEDIA_STORAGE in package com.keramidas.TitaniumBackup
00:38:41.713 Warning PackageManager 13815  Not granting permission android.permission.WRITE_MEDIA_STORAGE to package com.keramidas.TitaniumBackup (protectionLevel=18 flags=0x4028be44)
00:38:41.713 Warning PackageManager 13815  Not granting permission com.android.voicemail.permission.READ_WRITE_ALL_VOICEMAIL to package com.keramidas.TitaniumBackup (protectionLevel=2 flags=0x4028be44)
00:38:41.713 Warning PackageManager 13815  Unknown permission android.permission.ACCESS_SUPERUSER in package com.keramidas.TitaniumBackup
00:38:41.713 Warning PackageManager 13815  Unknown permission android.permission.INTERACT_ACROSS_USERS in package com.google.android.gms
00:38:41.713 Warning PackageManager 13815  Unknown permission android.permission.READ_OWNER_DATA in package com.google.android.setupwizard
00:38:41.714 Warning PackageManager 13815  Unknown permission android.permission.WRITE_OWNER_DATA in package com.google.android.setupwizard
00:38:41.752 Warning PackageManager 13815  Unknown permission android.permission.WRITE_INTERNAL_STORAGE in package com.android.updater
00:38:41.752 Warning PackageManager 13815  Unknown permission com.google.android.voicesearch.SHORTCUTS_ACCESS in package com.google.android.googlequicksearchbox
00:38:41.785 Warning PackageManager 13815  Unknown permission com.google.android.apps.googlevoice.permission.AUTO_SEND in package com.google.android.googlequicksearchbox
00:38:41.802 Warning PackageManager 13815  Unknown permission android.permission.PREVENT_POWER_KEY in package com.android.gallery3d
00:38:41.826 Warning PackageManager 13815  Unknown permission android.permission.READ_SECURE_SETTINGS in package com.wali.miui.networkassistant
00:38:41.827 Warning PackageManager 13815  Unknown permission android.permission.READ_SETTINGS in package com.wali.miui.networkassistant
00:38:41.859 Warning PackageManager 13815  Unknown permission com.android.providers.im.permission.READ_ONLY in package com.google.android.apps.maps
00:38:41.913 Warning PackageManager 13815  Unknown permission com.android.launcher.permission.PRELOAD_WORKSPACE in package com.google.android.partnersetup
00:38:41.963 Warning PackageManager 13815  Not granting permission com.android.permission.WHITELIST_BLUETOOTH_DEVICE to package com.android.nfc (protectionLevel=2 flags=0x9be4d)
00:38:41.979 Warning PackageManager 13815  Not granting permission com.android.permission.HANDOVER_STATUS to package com.android.nfc (protectionLevel=2 flags=0x9be4d)
00:38:42.058 Warning PackageManager 13815  Unknown permission android.permission.MANAGE_USERS in package com.android.vending
00:38:42.070 Warning PackageManager 13815  Unknown permission android.permission.INTERACT_ACROSS_USERS in package com.android.vending
00:38:42.083 Warning PackageManager 13815  Unknown permission adnroid.permission.CHANGE_WIFI_STATE in package com.tencent.tmsprovider
00:38:42.656 Debug PackageManager 13815  generateServicesMap(android.accounts.AccountAuthenticator): 3 services unchanged
00:38:42.881 Debug PackageManager 13815  generateServicesMap(android.content.SyncAdapter): 14 services unchanged
2. Sometime the phone suddenly freezes. Nothing works. I have to let the battery die down and charge it again to boot the phone.

Any help will be greatly appreciated.

Thanks
 
Last edited:

twitish

Senior Member
Jul 27, 2012
178
295
Virginia
Hey guys. Not sure if this has been answered yet, but is there a working port of MIUI v5 to android 4.2.2? Also, are there any new steps to porting MIUI v5 besides what's in the guide and shelld? Thanks for your time.

Sent from my XT912 using xda app-developers app
 

ubaid88

Senior Member
Jul 6, 2011
55
11
I am trying port MIUIv4(ICS) from Gionee GN700W to Gionee GN700T. Both are same device expect Gn700W(MTK6577) is with 3g and GN700T(MTK6517) is without 3G. First I tried by replacing Modem.img, /system/etc/firmware folder and /system/lib/module folder in MIUI rom from base rom but it got stuck first boot logo.

Then I tried port by method of Lense_Flare, now I get stuck on boot animation(not first boot logo). Here is logcat of it.

E/dalvikvm( 1738): ERROR: couldn't find native method

E/dalvikvm( 1738): Requested: Lcom/android/server/VibratorService;.vibratorExec:([B)V

E/JNIHelp ( 1738): RegisterNatives failed for 'com/android/server/VibratorService', aborting

F/libc ( 1738): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)

D/AEE/AED ( 95): $===AEE===AEE===AEE===$

D/AEE/AED ( 95): p 0 poll events 1 revents 0

D/AEE/AED ( 95): not know revents:0

D/AEE/AED ( 95): p 1 poll events 1 revents 0

D/AEE/AED ( 95): not know revents:0

D/AEE/AED ( 95): p 2 poll events 1 revents 1

D/AEE/AED ( 95): aed_main_fork_worker: generator 0x1825038, worker 0xbee8bb78, recv_fd 19

D/AEE/AED ( 95): p 3 poll events 1 revents 0

D/AEE/AED ( 95): not know revents:0

D/AEE/AED ( 95): p 4 poll events 1 revents 0

D/AEE/AED ( 95): not know revents:0

I/DEBUG ( 1751): BOOM: pid=1738 uid=1000 gid=1000 tid=1738

I/DEBUG ( 1751): debuggerd: tmb file path:'/data/tombstones/tombstone_06'

I/DEBUG ( 1751): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

I/DEBUG ( 1751): Build fingerprint: 'alps/gionee77_cu_ics2/gionee77_cu_ics2:4.0.4/IMM76D/1358422231:user/test-keys'

I/DEBUG ( 1751): pid: 1738, tid: 1738 >>> system_server <<<

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

I/DEBUG ( 1751): r0 00000000 r1 00000000 r2 4013f748 r3 000004a4

I/DEBUG ( 1751): r4 00000000 r5 bef1a75c r6 40ab847d r7 00000004

I/DEBUG ( 1751): r8 4bf35b24 r9 0046bb60 10 00000001 fp 00000000

I/DEBUG ( 1751): ip 00000027 sp bef1a748 lr deadbaff pc 400f4bc0 cpsr 60000010

I/DEBUG ( 1751): #00 pc 00019bc0 /system/lib/libc.so

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

I/DEBUG ( 1751): #02 pc 0000b96c /system/lib/libandroid_servers.so (_ZN7android39register_android_server_VibratorServiceEP7_JNIEnv)

I/DEBUG ( 1751): #03 pc 0000d20a /system/lib/libandroid_servers.so (JNI_OnLoad)

I/DEBUG ( 1751): #04 pc 0005b4e8 /system/lib/libdvm.so (_Z17dvmLoadNativeCodePKcP6ObjectPPc)

I/DEBUG ( 1751): #05 pc 00073d78 /system/lib/libdvm.so

I/DEBUG ( 1751): #06 pc 00030bcc /system/lib/libdvm.so

I/DEBUG ( 1751): #07 pc 000344d4 /system/lib/libdvm.so (_Z12dvmInterpretP6ThreadPK6MethodP6JValue)

I/DEBUG ( 1751): #08 pc 0006d442 /system/lib/libdvm.so (_Z15dvmInvokeMethodP6ObjectPK6MethodP11ArrayObjectS5_P11ClassObjectb)

I/DEBUG ( 1751): #09 pc 00074e82 /system/lib/libdvm.so

I/DEBUG ( 1751): #10 pc 00030bcc /system/lib/libdvm.so

I/DEBUG ( 1751): #11 pc 000344d4 /system/lib/libdvm.so (_Z12dvmInterpretP6ThreadPK6MethodP6JValue)

I/DEBUG ( 1751): #12 pc 0006d710 /system/lib/libdvm.so (_Z14dvmCallMethodVP6ThreadPK6MethodP6ObjectbP6JValueSt9__va_list)

I/DEBUG ( 1751): #13 pc 0005574a /system/lib/libdvm.so

I/DEBUG ( 1751): #14 pc 0004902e /system/lib/libandroid_runtime.so

I/DEBUG ( 1751): #15 pc 00049e36 /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime5startEPKcS2_)

I/DEBUG ( 1751): #16 pc 00008f0c /system/bin/app_process

I/DEBUG ( 1751): #17 pc 00018aac /system/lib/libc.so (__libc_init)

I/DEBUG ( 1751):

I/DEBUG ( 1751): code around pc:

I/DEBUG ( 1751): 400f4ba0 1afffffb e5941014 e3510000 0a000018 ..........Q.....

I/DEBUG ( 1751): 400f4bb0 e30beaff e3a0c027 e34deead e3a04000 ....'.....M..@..

I/DEBUG ( 1751): 400f4bc0 e54ec052 ebffcae2 e3a01006 ebffcf37 R.N.........7...

I/DEBUG ( 1751): 400f4bd0 e28d1004 e3a03201 e1a02001 e3a00006 .....2... ......

I/DEBUG ( 1751): 400f4be0 e58d300c e58d4004 e58d4008 ebffcd0b .0...@...@......

I/DEBUG ( 1751):

I/DEBUG ( 1751): code around lr:

I/DEBUG ( 1751): deadbadc ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 1751): deadbaec ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 1751): deadbafc ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 1751): deadbb0c ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 1751): deadbb1c ffffffff ffffffff ffffffff ffffffff ................

I/DEBUG ( 1751):

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

I/DEBUG ( 1751): beefa000-bef1b000 [stack]

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

I/DEBUG ( 1751): ffff0000-ffff1000 [vectors]

I/DEBUG ( 1751):

I/DEBUG ( 1751): stack:

I/DEBUG ( 1751): bef1a708 4c483c40 /dev/ashmem/dalvik-LinearAlloc (deleted)

I/DEBUG ( 1751): bef1a70c 40afb378 /system/lib/libdvm.so

I/DEBUG ( 1751): bef1a710 4c4838c0 /dev/ashmem/dalvik-LinearAlloc (deleted)

I/DEBUG ( 1751): bef1a714 00000011

I/DEBUG ( 1751): bef1a718 4013f92c

I/DEBUG ( 1751): bef1a71c 00000002

I/DEBUG ( 1751): bef1a720 00000011

I/DEBUG ( 1751): bef1a724 400fb998 /system/lib/libc.so

I/DEBUG ( 1751): bef1a728 4007a000

I/DEBUG ( 1751): bef1a72c bef1a75c [stack]

I/DEBUG ( 1751): bef1a730 40ab847d /system/lib/libdvm.so

I/DEBUG ( 1751): bef1a734 00000004

I/DEBUG ( 1751): bef1a738 4bf35b24 /system/lib/libandroid_servers.so

I/DEBUG ( 1751): bef1a73c 0046bb60 [heap]

I/DEBUG ( 1751): bef1a740 df0027ad

I/DEBUG ( 1751): bef1a744 00000000

I/DEBUG ( 1751): #00 bef1a748 1d700051

I/DEBUG ( 1751): bef1a74c e03b384d

I/DEBUG ( 1751): bef1a750 4bf33bf5 /system/lib/libandroid_servers.so

I/DEBUG ( 1751): bef1a754 0012e630 [heap]

I/DEBUG ( 1751): bef1a758 4bf33bf5 /system/lib/libandroid_servers.so

I/DEBUG ( 1751): bef1a75c fffffbdf

I/DEBUG ( 1751): bef1a760 00000004

I/DEBUG ( 1751): bef1a764 0012e630 [heap]

I/DEBUG ( 1751): bef1a768 4bf33bf5 /system/lib/libandroid_servers.so

I/DEBUG ( 1751): bef1a76c 401be42d /system/lib/libnativehelper.so

I/DEBUG ( 1751): #01 bef1a770 0012e630 [heap]

I/DEBUG ( 1751): bef1a774 1d700051

I/DEBUG ( 1751): bef1a778 00000000

I/DEBUG ( 1751): bef1a77c 00000000

I/DEBUG ( 1751): bef1a780 4bf321ad /system/lib/libandroid_servers.so

I/DEBUG ( 1751): bef1a784 001309e8 [heap]

I/DEBUG ( 1751): bef1a788 40b16f9c /system/lib/libdvm.so

I/DEBUG ( 1751): bef1a78c 4bf30971 /system/lib/libandroid_servers.so

I/SurfaceFlinger( 102): [SurfaceFlinger] frames:38, duration:1.011000, fps:37.568810

W/ADB_SERVICES( 122): create_local_service_socket() name=shell:df -h /system /data /mnt/sdcard

D/ADB_SERVICES( 122): Calling send_ready local=121, remote=384

D/ADB_SERVICES( 122): closing because is_eof=1 r=-1 s->fde.force_eof=0

W/ADB_SERVICES( 122): create_local_service_socket() name=shell:getprop gsm.version.baseband

D/ADB_SERVICES( 122): Calling send_ready local=122, remote=386

D/ADB_SERVICES( 122): closing because is_eof=1 r=-1 s->fde.force_eof=0

W/ADB_SERVICES( 122): create_local_service_socket() name=shell:dumpsys iphonesubinfo

D/ADB_SERVICES( 122): Calling send_ready local=123, remote=388

I/SurfaceFlinger( 102): [SurfaceFlinger] frames:40, duration:1.013000, fps:39.464458

D/ADB_SERVICES( 122): adb fdevent_process list (15) (22) (21) (10) (23)

D/ADB_SERVICES( 122): adb socket read list (22) (21) (23)

D/ADB_SERVICES( 122): read_data=33705

D/ADB_SERVICES( 122): max_read_time=0.000072 max_send_time=0.000382

D/ADB_SERVICES( 122): adb local_socket_ready list (22) (21) (23)

D/ADB_SERVICES( 122): closing because is_eof=1 r=-1 s->fde.force_eof=0

W/ADB_SERVICES( 122): create_local_service_socket() name=shell:dumpsys iphonesubinfo2

D/ADB_SERVICES( 122): Calling send_ready local=124, remote=390

D/ADB_SERVICES( 122): closing because is_eof=1 r=-1 s->fde.force_eof=0

W/AEE/AED ( 1751): DAL feature is off, just return

I/AEE/AED ( 1751): Dumping EXP/Native (NE)

I/AEE/AED ( 1751): db base:/data/aee_exp

D/AEE/AED ( 1751): aed_report_dump_open: Using /data/aee_exp/temp/db.Yb1751

I/AEE/AED ( 1751): $** *** *** *** *** *** *** *** Fatal *** *** *** *** *** *** *** **$

I/AEE/AED ( 1751): Build Info: 'ALPS.ICS2.6577.SP:Noir A8:MT6577:S01,alps/gionee77_cu_ics2/gionee77_cu_ics2:4.0.4/IMM76D/1358422231:user/test-keys'

I/AEE/AED ( 1751): Exception Log Time:[Wed May 1 22:08:39 MSK 2013] [271.130000]

I/AEE/AED ( 1751):

I/AEE/AED ( 1751): Exception Class: Native (NE)

I/AEE/AED ( 1751): Exception Type: SIGSEGV

I/AEE/AED ( 1751):

I/AEE/AED ( 1751): Current Executing Process:

I/AEE/AED ( 1751): pid: 1738, tid: 1738

I/AEE/AED ( 1751): system_server

I/AEE/AED ( 1751):

I/AEE/AED ( 1751): Backtrace:

I/AEE/AED ( 1751): #00 pc 00019bc0 /system/lib/libc.so

I/AEE/AED ( 1751): #01 pc 0000c428 /system/lib/libnativehelper.so (jniRegisterNativeMethods)

I/AEE/AED ( 1751): #02 pc 0000b96c /system/lib/libandroid_servers.so (_ZN7android39register_android_server_VibratorServiceEP7_JNIEnv)

I/AEE/AED ( 1751): #03 pc 0000d20a /system/lib/libandroid_servers.so (JNI_OnLoad)

I/AEE/AED ( 1751): #04 pc 0005b4e8 /system/lib/libdvm.so (_Z17dvmLoadNativeCodePKcP6ObjectPPc)

I/AEE/AED ( 1751): #05 pc 00073d78 /system/lib/libdvm.so

I/AEE/AED ( 1751): #06 pc 00030bcc /system/lib/libdvm.so

I/AEE/AED ( 1751): #07 pc 000344d4 /system/lib/libdvm.so (_Z12dvmInterpretP6ThreadPK6MethodP6JValue)

I/AEE/AED ( 1751): #08 pc 0006d442 /system/lib/libdvm.so (_Z15dvmInvokeMethodP6ObjectPK6MethodP11ArrayObjectS5_P11ClassObjectb)

I/AEE/AED ( 1751): #09 pc 00074e82 /system/lib/libdvm.so

I/AEE/AED ( 1751): #10 pc 00030bcc /system/lib/libdvm.so

I/AEE/AED ( 1751): #11 pc 000344d4 /system/lib/libdvm.so (_Z12dvmInterpretP6ThreadPK6MethodP6JValue)

I/AEE/AED ( 1751): #12 pc 0006d710 /system/lib/libdvm.so (_Z14dvmCallMethodVP6ThreadPK6MethodP6Obj

I/AEE/AED ( 1751): $** *** *** *** *** *** *** *** Fatal *** *** *** *** *** *** *** **$

Any help????
 
Last edited:

maestrobarako

Senior Member
Jan 4, 2013
336
114
davao
hello..
I managed to Port MIUI V4 to my MTK MT6577 device from another MT6577 device..
it boot successfuly, but an error "unfortunately MIUIhome has stopped" occurs everytime.. i can able to use camera though, wifi and bluetooth also works.. just the MIUI home FC that bugs me..
please help me with this..
 

sorullo_xgrx

Senior Member
Jan 9, 2012
515
78
Google Pixel 6 Pro
hello..
I managed to Port MIUI V4 to my MTK MT6577 device from another MT6577 device..
it boot successfuly, but an error "unfortunately MIUIhome has stopped" occurs everytime.. i can able to use camera though, wifi and bluetooth also works.. just the MIUI home FC that bugs me..
please help me with this..

Did you copy shelld from miui ROM xbin folder to your base xbin. If you did good plus you need to add this line inside the kernel.

Service shelld /system/xbin/shelld
Class main

To be exact inside the init rc file.

Sent from my GT-P3110 using Tapatalk HD
 

Top Liked Posts

  • There are no posts matching your filters.
  • 147
    I know there is a Proxuser's guide - "How to Port MIUI v4 for your device" and GREAT thread intended to eliminate porting quirks.
    My goal is to collect all the experience we got in that thread, which could be helpful for new users porting newest releases of miui.
    FAQ assumes questionaire, but my format will be more look like a guide but as collection, it could be treated as FAQ.
    Structure will be Stage-divided to ease of use.
    Stage 1. Initial port
    Let's start with first moment - bases choice.
    Under base I will mean rom which could be used to port miui and also miui release you choose.
    Let's assume - just "Base" will mean rom for your device with ICS/JellyBean, such as Cyanogen Mod or AOKP or AOSP and their variations(I don't know if it is possible to use stock rom for porting and wouldn't recommend it), when "MIUI base" means any miui rom you prefer (my preference and advice - MIUIandroid crespo [nexus S] or MIUIandroid maguro (Galaxy Nexus) release). You could use any miui base but results will be unpredictable and may very vary from guide stands, for those cases I prepared common debugging stage, which will help to eliminate bugs I haven't listed.
    MIUI for nexus S and Galaxy Nexus are now upgraded to Jelly Bean. That actually means - you couldn't use their miui bases to port ICS roms(which still under support).
    For those who stuck at ICS the situation is as follows:
    If version number is not crucial, you might just stick at MIUI 2.8.10 http://weedy.ca/miuiandroid/ and use old kind Nexus S/Galaxy Nexus roms. In guide I will describe steps right for you with mark "ICS-only".
    If for you version number is crucial - stop reading this guide and just use PatchROM (though rom will be based on Stock rom).
    There is third variant, but it needs a device with nearly same specs:
    you might just replace some files in miui-supported device rom with files from your stock rom. For now that case is only tested on xperia 2011 products (play,live with walkman,ray, mini, pro, mini pro etc) - arc s [lt18i] miui base and xperia 2012 (u,p, sola etc) - S miui base.

    When base choosen, start to port:
    Copy unpacked base rom (so set of folders) to any folder you prefer (let's name it "MIUI"), it usually contains:
    • system - folder on which we will work more often
    • data - may contain something necessary such as first boot scripts, config files etc.
    • META-INF - contains certificates and signature for signcheck, updater-script(we also will work on it) update-binary (updater-script command processor)
    • boot.img, kernel and ramdisk packed together, touch only if kernel should be changed to something more recent or if your preference is not similar with base rom maker's, but keep in mind that you have to place modules that provided with kernel to lib/modules [or in place where .ko files are]
    Starting with system:
    delete:
    • app
    • framework
    • media
    • fonts
    then open miui archive and extract those folders to system. Don't close archive.
    Open lib folder in system to add from the same archive:
    • content-types.properties [for themes]
    • liblbesec.so [for LBE Guard - MIUI superuser]
    • liblocSDK_2.2.so [for baidu location service, prevents network location provider FC]
      JellyBean-only:
    • libjni_resource_drm.so [themes DRM, actually involves download online themes screen]
    Open etc folder in system to add from the same archive:
    • yellowpage.db [Phone calls ability]
      ICS-only
    • telocation.td (as for nexus S and telocation.db in others) [location provider dependency]
      JellyBean-only:
    • telocation.idf (possible new telocation.db)
    go to permissions folder in etc to add:
    • com.nxp.mifare.xml [NFC]
    • miui-framework.xml [activates miui framework, near all apps won't work without that]
    • com.google.android.media.effects.xml [gallery]
    • com.google.widevine.software.drm.xml [something also related to google may affect play market]
    • com.google.android.maps.xml [gmaps]
    Open xbin folder in system to add from the same archive:
    • su [replace, don't even use base one!]
    • invoke-as [binary with near busybox and toolbox functionality, need everywhere in system, mostly in themes and SU]
    that's all about additional files. Devices which don't have NFC(Near Field Communication chip) also shouldn't have Nfc.apk in app folder!
    Let's modify build.prop then, to add:
    Code:
    ro.build.id=MIUI
    ro.build.display.id=MIUI
    ro.build.version.incremental=2.x.x
    
    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
    ro.build.version.incremental points to MIUI you port, so specify it.
    At your base you will most likely see these lines
    Code:
    ro.config.ringtone=
    ro.config.notification_sound=
    ro.config.alarm_alert=
    ro.config.sms_received_sound=
    ro.config.sms_delivered_sound=
    are filled with ringtones that only base have, soo just change them as MIUI do have different ringtone set.
    Initial port done, in system part, let's talk about Updater-script:
    any release of miui you port should have that line:
    Code:
    set_perm(0, 0, 06755, "/system/xbin/invoke-as");
    for example you have that bunch of code [which is mostly common for CM9 release]:
    Code:
    set_perm_recursive(0, 0, 0755, 0644, "/system");
    set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
    set_perm(0, 3003, 06755, "/system/bin/ip");
    set_perm(0, 3003, 02750, "/system/bin/netcfg");
    set_perm(0, 3004, 02755, "/system/bin/ping");
    set_perm(0, 2000, 06750, "/system/bin/run-as");
    set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
    set_perm(0, 0, 0755, "/system/etc/bluetooth");
    set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
    set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
    set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
    set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
    set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
    set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
    set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");
    set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
    set_perm(0, 0, 06755, "/system/xbin/librank");
    set_perm(0, 0, 06755, "/system/xbin/procmem");
    set_perm(0, 0, 06755, "/system/xbin/procrank");
    set_perm(0, 0, 06755, "/system/xbin/su");
    set_perm(0, 0, 06755, "/system/xbin/tcpdump");
    set_perm_recursive(0, 0, 0755, 0644, "/system/vendor/firmware");
    set_perm(0, 2000, 0755, "/system/vendor/firmware");
    set_perm_recursive(0, 0, 0755, 0555, "/system/etc/init.d");
    So line I pointed should be somewhere there, for example:
    Code:
    set_perm(0, 0, 06755, "/system/xbin/librank");
    set_perm(0, 0, 06755, "/system/xbin/procmem");
    set_perm(0, 0, 06755, "/system/xbin/procrank");
    set_perm(0, 0, 06755, "/system/xbin/su");
    [B][SIZE="4"]set_perm(0, 0, 06755, "/system/xbin/invoke-as");[/SIZE][/B]
    set_perm(0, 0, 06755, "/system/xbin/tcpdump");
    IF you have problems with SU, that line may help:
    Code:
    symlink("/system/xbin/su", "/system/bin/su");
    paste it somewhere after
    Code:
    symlink("busybox"[B][COLOR="YellowGreen"][later big code bunch like "/system/xbin/[" etc][/COLOR][/B]
    but before
    Code:
    unmount("/system");

    Your own MIUI is now ready to be flashed, but only, if your device is SOOO near on hardware part with MIUI base :D
    For those who didn't met that rule I prepared next parts - framework mods and common debugging and troubleshooting. See next 2 posts.
    106
    Stage 4

    Last part. We recently ported miui, all is great and mostly functions, But.. am I the only one or that one looks incomplete? One could make its port complete by following next stage:
    Stage 4. Advanced tweaks and specific hardware fixes
    USB subsystem(mass storage/tether/debugging sign)
    First of all, little self - check:
    you have to be on old USB Gadget framework kernel source. Those you could clarify by talking with cm dev. Also I'm not rejecting it could work for others but in slightly modified sequence.
    Starting from framework-res.apk.
    You have to disassemble it first, but before you use actual "apktool d", you should also issue:
    Code:
    apktool if framework-res.apk
    that is necessary for decoding internal resources correctly.
    Disassemble base and MIUI frameworks and leave base one as we will work with MIUI one and will use base as a reference.
    After disassembling, let's go to res/values in it:
    As old usb gadget needs old mass storage path which was applicable to gingerbread, we should add that path to strings.xml.
    If you only disassembled that file, you should see something like that:
    Code:
        <string name="launchBrowserDefault">Launch Browser?</string>
        <string name="SetupCallDefault">Accept Call?</string>
    </resources>
    exact line to add at the near end:
    Code:
        <string name="config_legacyUmsLunFile">/sys/devices/platform/usb_mass_storage/lun0/file</string>
    so that you will get something like that:
    Code:
        <string name="launchBrowserDefault">Launch Browser?</string>
        <string name="SetupCallDefault">Accept Call?</string>
        <string name="config_legacyUmsLunFile">/sys/devices/platform/usb_mass_storage/lun0/file</string>
    </resources>
    Remark:
    that case is the only applicable to devices which have old kind SD card only. Look at the framework-res on your device, it also might have different LUN file path(actually it is a file, which collects all your SD data to be mounted as usb drive), that you should always replace in mind my defines with yours to make actual usb work.
    Devices with flash memory(also called EMMC or embedded SD on flash) and SD[or without SD support at all], should be treat in custom way unfortunately I don't know, consult with your device CM devs for more details. And hey, most of these devices are on new usb gadget, so don't need my guide at all :p
    <<
    After addition, save strings.xml and go to res/xml in the same framework-res.That's where you also should use base framework-res.
    copy from base to miui storage_list.xml and replace when prompted. That file provides only your device-specific SD support, not nexus S or whatever miui base you use.
    Assemble miui framework-res.apk and, attention! disassemble it again. That action allows you to see resource ID-s for each line exactly in manner they will be used in living rom.
    Remark:
    Each resource-drawable, string, boolean switcher etc is treated by its ID - personal identificator. Resources are used in other frameworks and APK to identify something necessary for them. framework-res.apk is a resource storage, which handled by android.content.res package classes like ResourceManager.
    USB subsystem also uses some resource to provide to user actual USB status and right mass storage.
    <<
    Make sure you have both base and miui framework-res, then open both: res/values/public.xml.
    Now, we could start the main part - services.jar mod
    After adding line "config_legacyUmsLunFile" there will be its id in public.xml after compiling. That's why I stand you should disassemble assembled framework-res again. Remember both ID-s from base and from miui.
    Also you need ID-s from both base and miui for following resources:
    • "stat_sys_adb" - usb debugging icon
    • "adb_active_notification_title" - usb debugging short message
    • "adb_active_notification_message" - usb debugging long message
      JellyBean-specific:
    • "config_oemUsbModeOverride" - usb mode override flag
    Remark:
    public.xml is a resource dictionary, example of line:
    Code:
        <public type="drawable" name="stat_sys_adb" id="0x010804f8" />
    means as follows: public type="drawable", drawable - mere picture for different resolution, drawn on the screen, public type subsequently is a type of resource. name="stat_sys_adb" - name of resource, that may be name of acual file or string or bool define etc. id="0x010804f8" - hexadecimal resource identifier. Important note: most resource users are treat resource name without leading zero, for example, 0x010804f8 in usb smalis presented as 0x10804f8, that fact will be necessary on finding and replacing resources(I'd call it matching process), exactly what we are going to do with USB folder smalis.
    <<
    Open USB folder in miui services.jar (smali/com/android/server/usb), you will see smalis, as usual. Replace its contents with those in base services.jar' usb folder.
    Then we are going to match resources: each ID you found in public.xml should be bound to resource call in smali. Let's start:
    we will work with miui usb folder smalis. Open UsbService.smali, now remember what id was bound to config_legacyUmsLunFile in base public.xml, for example it was 0x01040029, eliminate leading zero and search file contents for resource 0x1040029, so you will find its entry. Replace that entry with resource you got from public.xml in miui, again, without leading zero. Search for the same ID in LegacyUsbDeviceManager.smali and replace it to miui one.
    If you got how that process work, remaining task is match other resource id-s that listed above (usb debugging icon, long and short message). They will be in following files
    • LegacyUsbDeviceManager$LegacyUsbHandler
    • UsbDeviceManager$UsbHandler
    JellyBean-specific:
    UsbDeviceManager.smali also contains necessary switch - config_oemUsbModeOverride, also match ID-s with miui framework and here you go.

    USB debugging message is not so necessary as mass storage [coz if resource of mass storage file not found, you won't get usb subsystem to work].
    After matching is done, assemble services.jar.
    Done! USB subsystem now works.
    Another moment could be necessary is to change USB tether interface device to usb0 (as Nexus S is using rndis0 instead, and base whatever you choosed may also have another tether interface)
    To change it, you again need a disassembled framework-res.apk(don't forget "apktool if") In it navigate to res/values/arrays.xml.
    find the following:
    Code:
         <string-array name="config_tether_usb_regexs">
    in nexus S full block will look like that:
    Code:
        <string-array name="config_tether_usb_regexs">
            <item>[COLOR="Orange"]rndis0[/COLOR]</item>
        </string-array>
    Look, I highlighted interface name for you! So the only part you should do it is just replace it to yours. Example for usb0:
    Code:
        <string-array name="config_tether_usb_regexs">
            <item>[COLOR="Orange"]usb0[/COLOR]</item>
        </string-array>
    Interface name could be seen in the same file but in base rom.
    By The Way, do you see
    Code:
        <string-array name="config_tether_wifi_regexs">
            <item>[COLOR="Orange"]wl0.1[/COLOR]</item>
        </string-array>
    right after usb one? That is the interface for wifi tether, that you also should change to yours (one your base needed) and that is it! I saw somewhere following interface variant:
    Code:
        <string-array name="config_tether_wifi_regex[/B]">
            <item>[COLOR="orange"]tiap//d[/COLOR]</item>
        </string-array>
    which is for Sony [Ericsson] devices with Texas Instruments wifi chip, just see yours in base to check this out.
    in the same file you may also fix Autobrightness levels, I mean those ones:
    Code:
        <integer-array name="config_autoBrightnessLevels">
        <integer-array name="config_autoBrightnessLcdBacklightValues">
        <integer-array name="config_autoBrightnessButtonBacklightValues">
        <integer-array name="config_autoBrightnessKeyboardBacklightValues">
    MIUI doesn't have autobrightness tweaks so that is the only way those levels could be applied.

    To fully close framework-res and don't come back no more, let's see other things you could do with it:
    Minimal brightness too low
    There is a bug with brightness: when you regulating it to minmal, screen comes black and won't come back until wipe.
    Reason is banal - screen highlight couldn't handle so low value (in nexus S it's 10), first of all find a line at res/values/integers.xml:
    Code:
    <integer name="config_screenBrightnessDim">10</integer>
    in most cases value "20" will be reliable, so change "10" to "20":
    Code:
    <integer name="config_screenBrightnessDim">20</integer>
    Fix "Network won't automatically picks up"
    The problem on some devices like HTC on 7x30 QC architecture, is in one little switch [res/values/bools.xml] :
    Code:
    <bool name="skip_restoring_network_selection">[COLOR="orange"]true[/COLOR]</bool>
    just change it to "false":
    Code:
    <bool name="skip_restoring_network_selection">[COLOR="orange"]false[/COLOR]</bool>
    and network will come up.
    Fix "Deep sleep issue on some devices"
    Problem reported Wildfire S users resolved by that little define [res/values/bools.xml] :
    Code:
        <bool name="config_bluetooth_adapter_quick_switch">[COLOR="orange"]true[/COLOR]</bool>
    change it to "false":
    Code:
        <bool name="config_bluetooth_adapter_quick_switch">[COLOR="orange"]false[/COLOR]</bool>
    and issue will be resolved.

    Also, it might be interesting to check out all bools.xml defines to see if something should be changed.

    Fixing wrong hardware-software keyboard relationship [auto-rotate and showing issues] (also for galaxy tab 7)

    Those with built-in hardware keyboard may experiencing following issue: when hardware keyboard opened, you also see a software keyboard and when you just need a software keyboard, it won't show. Also auto-rotate won't work properly when keyboard is activated.
    Seems on Galaxy Tab 7 Samsung(or maybe Cyanogen Mod?) handles software keyboard in relation of some kind of dummy hardware keyboard, so it's our case too.
    ICS-only:
    To fix that issue, disassemble miui android.policy.jar and navigate to smali/com/android/internal/policy/impl/PhoneWindowManager.smali
    there are three constants, according to the source: 0(0x0) - lid closed, 1(0x1) - lid open, and -1(-0x1) - lid absent.
    they are located after a function "GetSwitchState".
    Original idea was to swap these constants so that system gets fooled about your keyboard state:
    code that exists:
    Code:
    const/4 v1, 0x1
    -> code that you will get after mod:
    Code:
    const/4 v1, 0x0
    the same you should proceed with zero:
    Code:
    const/4 v1, 0x0
    ->
    Code:
    const/4 v1, 0x1
    you might also have to change
    Code:
    const/4 v1, -0x1
    ->
    Code:
    const/4 v1, 0x1
    to get rid of absent state.

    another ways to fix this up:
    res/values/bools.xml
    change
    Code:
    <bool name="config_forceDisableHardwareKeyboard">[COLOR="Orange"]false[/COLOR]</bool>
    ->
    Code:
    <bool name="config_forceDisableHardwareKeyboard">[COLOR="Orange"]true[/COLOR]</bool>
    as we see, it force-disables hardware keyboard so that only soft one will show up.
    for devices with hardware keyboard that might also be a deal:
    res/values/integers.xml
    change the following two line:
    Code:
    <integer name="config_lidOpenRotation">90</integer>
    <integer name="config_lidKeyboardAccessibility">1</integer>

    Next questions will be related to various APK fixes:
    before we start you need to know that all apk are depend on framework-res resources, so before you start disassembling them, let's clarify steps: "apktool if" each framework with resources you have in miui, in stock there are two:
    Code:
    apktool if framework-res.apk
    Code:
    apktool if framework-miui-res.apk
    then each apk could be disassembled as usual.
    Getting rid of MIUI start screen
    Have you mentioned it? Ya, that annoying setup wizard.. In the end it suggests you to input your XIAOMI account which some users may never had and won't create. Keep them out of stress - get rid of that wizard!
    Let me show how:
    there are 2 ways, one - fully infiltrate that wizard from user's eye, second - will let you choose a language(useful in multilanguage releases) and setup wifi, then go right to homescreen.
    Common moment: disassemble Provision.apk and go to smali contents - com/android/provision and choose DefaultActivity.smali
    First method - codename "infiltration":
    we will modify contents of "isProvisioned" method.
    Kill all except "const/4 v1" and "return v1" in it, change const/4 v1 to 0x1 so you will get something like that:
    Code:
    .method private deviceIsProvisioned()Z
        .locals 3
    
        .prologue
        const/4 v1, 0x1
    
        return v1
    .end method
    actually, we are just saying to setup wizard that device is already passed its steps and don't need them anymore. So that setup wizard won't even be showed.
    Second method - codename "multilang":
    it is based on exploit, which is as follows: one could bypass xiaomi account prompt if before flashing miui he pull off sim card and then on setupwizard won't set up wifi. Wizard will send you to "sim not found" dialog, which then will allow one to "dismiss" account request.
    Line which asks about SIM state is as follows:
    Code:
        invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getSimState()I
    then
    Code:
        move-result v1
        const/4 v2, 0x5
    some variable now consists of returned value.
    To initialte that value to fail a check, I've just changed constant value to one that telephony manager will never return: -0x5
    Code:
        const/4 v2, -0x5
    Now its time to point fail to logical end of wizard, we are going to change label..
    Code:
        if-ne v1, v2, :[COLOR="DarkOrange"]cond_5[/COLOR]
    if not equals v1, v2 (if (v1!=v2) in С manner ) go to label cond_5. As we stated, v1 won't be equal v2,so it will go to cond_5, which is not a place we wish to go (coz of unbelieveable hardcode). But there is a wishable place - cond_6:
    Code:
        invoke-direct {p0}, Lcom/android/provision/DefaultActivity;->finishSetup()V
    yyyyeah, right to finish :D
    so we are changing cond_5 to cond_6:
    Code:
        if-ne v1, v2, :[COLOR="DarkOrange"]cond_6[/COLOR]
    that's it! In the end you will get: language selection->wifi setup->homescreen, almost briliant! :D

    Whether you choosed first or second method - assemble apk you got after all things done.

    Fixing not working mic in calls
    Disassemble Phone.apk and navigate to res/values/bools.xml to change:
    Code:
        <bool name="send_mic_mute_to_AudioManager">[COLOR="Orange"]false[/COLOR]</bool>
    ->
    Code:
        <bool name="send_mic_mute_to_AudioManager">[COLOR="orange"]true[/COLOR]</bool>
    Fixing pin code prompt on xperia devices
    Disassemble Phone.apk and navigate to res/values/bools.xml to change:
    Code:
        <bool name="ignore_sim_network_locked_events">[COLOR="orange"]false[/COLOR]</bool>
    ->
    Code:
        <bool name="ignore_sim_network_locked_events">[COLOR="orange"]true[/COLOR]</bool>
    Enabling hidden settings
    Did you know that you may activate LEDs settings? Or maybe use camera key to trigger some useful functions? If not, follow the next little tuto.
    Disassemble Settings.apk, navigate to bools.xml in res/values.
    Activating LED settings
    It would be enough to change
    Code:
        <bool name="has_led">[COLOR="orange"]false[/COLOR]</bool>
    ->
    Code:
        <bool name="has_led">[COLOR="orange"]true[/COLOR]</bool>
    As you may got, other hidden settings are also there, I'll just list them and assume all of them needs just replacement false to true to make them activated
    Multitouch gestures
    Still didn't mentioned how they works, but, xiaomi wouldn't make something just for its appearence in settings.
    Code:
        <bool name="has_multi_touch">[COLOR="orange"]false[/COLOR]</bool>
    MI button
    Mi button on any device that has camera button!
    What is MI button? It's a tweak that allows dedicated button to do something instead of its mere function (for example-issuing camera app as for cam button). You may adjust any app in rom to be executed, any switch from miui switchers and also trigger some actions like "menu", "call", "screen off toggle"(allows you to switch screen on and off, so possibly replace power button which is mostly weak) and "screenshot".
    how to activate it? - the same:
    Code:
         <bool name="has_camera_key">[COLOR="orange"]false[/COLOR]</bool>
    change to "true"
    Dock settings
    mere dock station settings dialog.
    Code:
        <bool name="has_dock_settings">[COLOR="orange"]false[/COLOR]</bool>
    Trackball settings
    for devices such as nexus one with active trackball.
    Code:
        <bool name="has_track_ball">[COLOR="orange"]false[/COLOR]</bool>

    "Black bar" fix
    more details - https://www.dropbox.com/s/6u63tozthmj6xa9/Screenshot_2012-08-07-09-49-09.png
    Let's get MiuiSystemUI.apk and disassemble it.
    Locate to res/values/drawables.xml and delete first line:
    Code:
    <item type="drawable" name="notification_header_bg">#ff000000</item>
    it might vary but always contains black colour (#ff000000). Recompile modified systemUI.

    Least but hope not last define for that guide, hope it will fill up with latest and greatest from MIUI devices users and porters around the world.
    Cheers, L_F.
    95
    Stage 2

    Recently I had an Acer Liquid MT[now bricked], which is Qualcomm S2 device(msm7x30) and my guide defines also assume you have device with Qualcomm inside. But some of guide moments[first stage is not exception] are common for most devices with other chips.
    I also used Cyanogen Mod 9 as base, so some of these defines wouldn't be applicable to your porting using AOSP base.
    That was on ICS, and I will count that in while describing for those who don't care about miui version and porting something before MIUI 2.8.10.
    Now I have MIUI-supported Xperia Arc S. But its MIUI is based on stock rom (such a shame). So as FXP provides us CM 10, I started to port over it to bring latest and greatest of MIUI jellybean on that device. So again Qualcomm, but with stock ICS, which means lesser quirks on porting. I again will assume you are on Qualcomm but I have to say that all defines of this stage are nomore device-specific.

    Returning to guide:
    Stage 2. Framework mods to make it boot
    Rom not booting? - that is most likely a framework issue, that is remained from Nexus S/Galaxy Nexus. But don't run to base to grab all framework and paste it to base, else you will have a base rom instead of miui :p
    My suggestion is port.
    For those who are new in apktool disassembling, I suggest to read something like that http://xdaforums.com/showthread.php?t=1511730 or that http://xdaforums.com/showthread.php?t=1752201 or google it to understand common principles of work.
    For framework-res.apk mods we will use Connor-apktool and scripts for ease of use: http://code.google.com/p/android-apktool/downloads/list (choose only dependencies for your platform, don't replace AAPT from them). Always choose latest one!
    Let's assume again:
    • disassemble something - usually means issuing
      Code:
      apktool d [[COLOR="YellowGreen"]full name of apk or jar[/COLOR]]
      command on file I specify if more info not specified
    • assemble something - usually means issuing
      Code:
      apktool b  [[COLOR="YellowGreen"]disassembled apk or jar folder without .apk in name or with ".out" at the end for jars[/COLOR] ]
      command on file I specify
      better way to assemble is drag assembled classes.dex(or resources.arsc and xmls at rest folders in case of assembling framework-res.apk) from [file you modified]/build/apk to original file, opened as archive (in windows you also have to check out a compression rate to make it the same as there were before dragging, which prompts to you as compression method like "Normal" and "Store")
    • smali - piece of code on dalvik bytecode language, are part of nearly any disassembled file
    • smali tree/just "tree"/"*.smali" - usually means set of files with the same name in the beginning but with different end(usually with $ before), for example
    Code:
    RIL*.smali means:
    [LIST]
    [*]RIL.smali
    [*]RIL$1.smali
    [*]RIL$RILReceiver.smali
    [*]RIL$RILSender.smali
    [/LIST]
    Let's start with framework mods:
    All frameworks are located at system/framework.
    framework.jar
    Mostly issues are produced there.
    Disassemble framework.jar from MIUI port you are working so you will see framework.jar.out. Go to smali folder in it. Later all actions we will produce from there (except assembling).
    First replace some files from your base framework.jar (fist disassemble base rom's framework.jar and move all files I will specify, replace if asked).
    Listing all smali I had to replace in framework.jar:
    ICS-only:
    Code:
    [B]android/os/Power.smali[/B]
    org/codeaurora/Performance.smali
    [B]android/media/MediaRecorder*.smali[/B]
    android/graphics/Paint.smali
    android/os/Environment.smali
    android/view/HardwareCanvas.smali
    [B]android/net/wifi/WifiNative.smali[/B]
    Common:
    Code:
    android/view/Gles20*.smali (not only canvas but all with gles20 at the beginning)
    [B]android/hardware/Camera*.smali[/B]
    [B]android/server/BluetoothA2dpService*.smali[/B]
    [B]android/content/res/PackageRedirectionMap*.smali[/B]
    [B]com/android/internal/telephony/RIL*.smali[/B]
    JellyBean Only:
    Code:
    [B]android/bluetooth/HeadsetBase*.smali[/B]
    [B]com/android/internal/app/ActivityTrigger.smali[/B]
    [B]android/webkit/HTML5*.smali[/B]
    [B]android/webkit/SelectActionModeCallback[/B]
    I highlighted those could be common for all chips, not only for Qualcomm ones.
    But some of smalis are not following common rules.
    The weirdest exception of that - WebviewCore. If you replace only WebViewCore tree, Gmail, Facebook, Browser, HTML viewer and all that is using this class WON'T WORK. What was my solution is to replace Webview*.smali tree, so I met all dependencies that class may work with.
    ICS-only:
    That class, and Sound Recorder are in need of one property from SystemProperties.smali, which is located at android/os/.
    But don't run to base to take it and replace immediately as you read :D It have to be patched
    end of ICS-only
    I highlighted it as ICS-only as you will just replace it on JellyBean - it's now hard to patch, but easy to replace.
    >>Common Remark about patching smalis
    Patching (usually named diffing, diff, that means "find differences and eliminate them") in our context is a process of comparing two files and adding contents of one of them to another and not replacing anything. Our diff process will consist of base->miui content addition so smali we modify could live in dual life - for your base and for MIUI remained framework. For start of diff you should have both base and miui files you want to modify, and a diff tool (in windows - beyond compare,total commander, winmerge or notepad++), my preference - Meld diff viewer[really simple and visual-oriented], the only thing - it's running on linux environment and I don't know if there is a windows version. Then just open files in tool and start adding. Sometimes you have to add all entries are not present in miui one from base, sometimes you should be smart enough to mod only part which needed and nothing more and also sometimes to replace pieces of code which are actually safe to do so. That's a whole process.
    >>
    Example - our SystemProperties.smali:
    Actually after opening you see it is full of differences from base:
    http://minus.com/mbmfprmG4K/
    you see those green blocks? Each of them signs a missing part of code you should add, in Meld it's just about of clicking little arrow that represents that block. As for windows tools, they should have something like "add all" and many other things could do it in a batch way.
    A little piece of smartness:
    that file is the only one I discovered which allow replacing .line with big code pieces, see that:
    http://minus.com/mdnAholnL/
    do you see ".line 126" and HUGE code block against it? you may forget about ".line 126" and copy block against it with no doubt. Note that line numbers etc could change, always check before doing something.
    That line also became a dealbreaker on JellyBean, that's why we decided it would be better to just replace it. Ecample will give you a clue just about common patch process.
    >>
    Another file has to be modified in same way - AssetManager.smali, which is located at android/content/res.
    Beware of replacing anything on it[only add, as stand before], if something went wrong, it might produce awful logcat nobody could understand so you have to re-port rom again to catch a causer.
    Another interesting patch you should perform if you have different than RIL telephony class.
    To determine which ril class you have, seek for following line in your build.prop:
    Code:
    ro.telephony.ril_class=
    If you don't have such, mostly it means you are using RIL class and don't need a patch.
    in my case it was:
    Code:
    ro.telephony.ril_class=LGEQualcommRIL
    so I'll describe a process for it, pointing what is common.
    All ril classes located at com/android/internal/telephony, so go to it.
    LGEqualcommRIL have a single smali, so copy only that one[if your class also have another smali with the same name, for example LGEStarRIL$1.smali, copy them too], Also, unlike most classes in CM, LGEQualcommRIL have a dependency - QualcommSharedRIL, which tree you should also move to that folder near LGE one.
    Classes that are also have that dependency:
    • LGEQualcommUiccRIL
    • HTCQualcommRIL
    • SamsungQualcommUiccRIL
    Others are dervied from RIL and don't have any dependencies like that. As CM involves more and more devices, to determine what dependencies you actually need, ask source code:
    Code:
    public class LGEQualcommRIL extends QualcommSharedRIL implements CommandsInterface
    extends means your dependency you have to also add to MIUI, if it is "RIL", go ahead and continue porting.
    To make your class work instead of RIL, you should modify MIUI' PhoneFactory.smali located at the same folder in following way:
    Code:
        .line 136
        new-instance v8, Lcom/android/internal/telephony/RIL;
    
        invoke-direct {v8, p0, v4, v0}, Lcom/android/internal/telephony/RIL;-><init>(Landroid/content/Context;II)V
    ->
    Code:
        .line 136
        new-instance v8, Lcom/android/internal/telephony/[B]LGEQualcomm[/B]RIL;
    
        invoke-direct {v8, p0, v4, v0}, Lcom/android/internal/telephony/[B]LGEQualcomm[/B]RIL;-><init>(Landroid/content/Context;II)V
    it changes a constructor of RIL class to LGEQualcommRIL class. If my lines incorrect, just type RIL in search in Phonefactory, it will show you exactly 2 defines with "RIL" involved.

    Another case for patching is android/media/AudioFormat.smali.
    Copy all missing lines from base to miui, it would be enough. I have decide to not replacing it coz of constructor that is differ and might one day turn into bomb.
    The most complicated smali case, WebSettingsClassic. It do contains lines that should be added, also lines that should be slightly modified.
    Let's try to make the process bit easier with these steps:
    first of all, find those fields:
    Code:
    .field private mMediaPreloadEnabled
    .field private mWebGLEnabled:Z
    they are at the beginning of file, marked as green blocks. Attention: then there is a listing that asks you about default value, like that:
    Code:
        .line 91
        iput-boolean v2, p0, Landroid/webkit/WebSettingsClassic;->mMediaPreloadEnabled:Z
    DON'T EVEN TOUCH THEM! Even if you know what are you doing - it will fail on boot if you placed that lines in miui file.
    interesting place here.. when you will search for webgl from the beginning, you will hit such block, marked as blue (incompatible):
    Code:
        goto/16 :goto_1
    .end method
    
    .method private native nativeIsWebGLAvailable()Z
    .end method
    while miui file will show just that:
    Code:
        goto :goto_1
    and ".end method" after. "You f***n kiddng?" - will you ask.. yeah, pure cheat. Let's fix it up:
    paste only:
    Code:
    .end method
    
    .method private native nativeIsWebGLAvailable()Z
    before ".end_method" but after "goto :goto_1", so that full block will be instantly turned to whie:
    Code:
        goto :goto_1
    .end method
    
    .method private native nativeIsWebGLAvailable()Z
    .end method
    except "goto", which will show as differ, but who cares? :D
    After searching "webgl" on base file you will possibly see a code block starting with:
    Code:
    .method public declared-synchronized isWebGLAvailable()Z
    add it without any thought. You should do the same with following methods:
    Code:
    .method public declared-synchronized setMediaPreloadEnabled(Z)V
    .method public declared-synchronized setWebGLEnabled(Z)V
    btw, those methods are so-called "setters" - methods in class that intended to adjust value to class field.
    DON'T ADD ANYTHING ELSE, IT WILL POSSIBLY BREAK BOOTING AGAIN! You've been warned.

    Framework.jar port done!
    the only thing to do - assemble it.
    services.jar
    Unlike framework.jar, there are lesser things to do. But they are also significant for porting process.
    ICS-only:
    InputManager*.smali - the only thing should be replaced [and located in com/android/server/wm/].
    On JellyBean it is located at com/android/server/Input ands also have to be replaced.
    You may also replace usb folder, but actually those who have MTP(devices with kernel 3.0 or so, that are having new "USB gadget framework" drivers, consult with development branch for details) are in no need to do so, as for others (as of mine instance on MT development) you have to replace it. In stage 4 I will present my ways to make usb subsystem work on miui.
    Also, there is a new smali on Jellybean: watchdog*.smali. Just replace whole tree of this in com/android/server/.
    As for diff files, there is one: PowerManagerService.smali(may I shorten its name to PMS?)
    there is no matter to diff it like others as it have too much dependencies to resolve and may cause your system crash.
    ICS-only:
    So, it only asks about nativeStartSurfaceFlingerOffAnimation method. but hey, PMS do have such method, but its name is nativeStartSurfaceFlingerAnimation, so without "Off"; my solution is to add "Off" to it, see that stack:
    http://minus.com/lY4DiQfJ451Aq
    that's where you should find you first entry (there are 2)
    second entry showed there:
    http://minus.com/lchMVcHtKe46T
    after editing , you should see a huge block to add:
    http://minus.com/lbmNygeJBs9klv
    add it, and that smali is ported.
    end of ICS-only
    On jellybean porting it more trivial:
    nativeCPUBoost is missing. You will have some defines in base file. Use search by keyword "cpuboost" in base file to determine where they are and just add them to miui one.
    defines will be:
    Code:
    .method private static native nativeCpuBoost(I)V
    -method definition.
    Code:
    .method public cpuBoost(I)V
    -method code block.
    and nothing extra.
    Assemble new services.jar.out to services.jar when complete.

    Done those but still not boots or boots but functions improperly? see next Stages- 3 and 4, I will enlighten all moments of debugging what's wrong and also additional tweaks for specific devices that faced problems with porting [It's just impossible to do that for each device, so there is a great thread you could always ask what's wrong if my advices didn't help].
    64
    Stage 3

    Third part mostly touches cases where tuto above didn't resolved boot problems, also cases where there is no confidence 2nd stage will work/cases when people are trying to investigate themselves but mostly not xperienced in such(the most respectable case). To understand what's going on with your build it would be better to be CM/AOSP/AOKP dev, so you will most likely know where to find an answer. But if it is not about you, let me point on some moments could help.
    Stage 3. Understanding logs and debugging
    Yes, exactly understanding. Most likely people are going to forum and just posting logcat (that might contain common error). My goal is show you - logcat is not shuch thing you should fear to investigate!
    First of all, let's assume something:
    • adb - powerful tool, in our case the must have thing to make a log. Article on android devs most likely describes all the moments about adb power: http://developer.android.com/tools/help/adb.html
    • logcat/log - one of the android advantages that allows you to debug what's going on with your system. by "make log" I will assume issuing
      Code:
      adb logcat >log.txt
      command, last argument - log.txt is a text file with log system provided to you (you could use any name).
      sometimes we need an answer about things that are going on with baseband (so-called radio). In those cases I usually asking to take radiolog. That's how it could be produced:
      Code:
      adb logcat -b radio >log.txt
      reading it might be a pain, as terms of it are too much hardware-specific, but it anyway complies with principles I will put below.
    • debug/debugging - process of analyzing code which helps to eliminate bugs (that's why de-bug)
    Some people experiencing problems with log, most common are:
    -wrong MIUI base which prevents usb subsytem to start (nexus S base most likely allows you to use log)
    -no/corrupted/wrong usb drivers on PC
    -Windows :crying: most likely is about new usb subsystems etc, so advice is the only one - try on ubuntu (not working without udev rules)
    -somewhat corrupted/inconsistent usb port
    -lack of "persist.sys.usb.config= mass_storage,adb" in build.prop, specifically "adb" in this line.
    Note: if your log only consists of:
    Code:
    link system/bin/sh failed: no such file or directory
    or something like that, you should contact a CM dev, else, you are most likely know what happened ;]
    Alright when we got a log, it consist of many many lines that are looping if your system not boots. That's why that kind of situation is sometimes called bootloop. System may repeat a error eternal time it lives, so log might be huge.
    To parse what's going on there are some advice:
    keywords:
    search in log you got some keywords, that might be useful on debugging boot issue;
    most common keywords are:
    • "E/" - error
    • "E/dalvikvm" - possibly crucial system error
    • "No such file or directory" - says it all
    • "couldn't" - android likes that, mostly shows faulty things.
    • "fail"/"failed" - mostly crucial error
    • "W/"/"warning" - says it all, but not always warn could be a boot failure cause
    • "exception"(especially NullPointerException) - points you that something went wrong in framework or application work
    I/ tags could be also useful at debugging, but most helpful are errors and warnings.
    Most common constructs:
    "couldn't find native method", the most common reason of a bootloop.
    For instance:
    Code:
    E/dalvikvm(  100): ERROR: couldn't find native method
    E/dalvikvm(  100): Requested: Landroid/view/GLES20Canvas;.nStartTileRendering:(IIIII)V
    E/JNIHelp (  100): RegisterNatives failed for 'android/view/GLES20Canvas', aborting
    Let's parse that construct to extract parts we will fix.
    First of all. smali path might be extracted from that line:
    Code:
    E/JNIHelp (  100): RegisterNatives failed for 'android/view/GLES20Canvas', aborting
    ->
    Code:
    android/view/GLES20Canvas
    that's it, smali we are looking for is GLES20Canvas.smali. But.. android/view.. where it is? Answer comes from android source, it took some time to analyze frameworks.. Just let's assume: all that starting with "android" in path belongs to framework,jar.
    What if path doesn't contain "android" at the beginning?
    Again the answer is in source. Paths like"org/" are belong to framework.jar.
    "com/android/server" - services.jar (there is the same folder at framework.jar but most likely you don't need to touch it).
    another place we could be mixed up:
    "com/android/internal" - framework.jar
    "com/android/internal/policy/impl/" - android.policy.jar
    for framework.jar path ends up on internal, which represents telephony folder. policy/impl is the only android.policy.jar folder.
    Other frameworks are actually not used in port as they contain core android functionality which is common.
    Note about smali you found:
    • it might be not smali you are looking for, most likely when code points you to android functionality and widgets (control elements) like combobox or listview, it's a sign to think twice what have you done on your system to port it
    • it might be tree of smali(remember 2nd stage assumes?), to ease of use, always replace smali with its tree, and only if error becomes worse, think about single smali or about diff(2nd stage assumes again :D)
    from
    Code:
    E/dalvikvm(  100): Requested: Landroid/view/GLES20Canvas;.nStartTileRendering:(IIIII)V
    we could extract a method which is missing - nStartTileRendering. In some cases only that method should be added and nothing more.
    " android.content.res.Resources$NotFoundException: Resource ID #XXX"
    Example:
    Code:
    E/AndroidRuntime( 3047): *** FATAL EXCEPTION IN SYSTEM PROCESS: WindowManagerPolicy
    E/AndroidRuntime( 3047): android.content.res.Resources$NotFoundException: Resource ID #0x3060008
    E/AndroidRuntime( 3047): at android.content.res.Resources.getValue(Resources.j ava:1022)
    E/AndroidRuntime( 3047): at android.content.res.MiuiResources.getValue(MiuiRes ources.java:56)
    E/AndroidRuntime( 3047): at miui.util.ResourceMapper.resolveReference(Resource Mapper.java:9)
    E/AndroidRuntime( 3047): at miui.util.HapticFeedbackUtil.updateSettings(Haptic FeedbackUtil.java:109)
    E/AndroidRuntime( 3047): at miui.util.HapticFeedbackUtil$SettingsObserver.obse rve(HapticFeedbackUtil.java:92)
    E/AndroidRuntime( 3047): at miui.util.HapticFeedbackUtil.<init>(HapticFeedback Util.java:75)
    E/AndroidRuntime( 3047): at com.android.internal.policy.impl.MiuiPhoneWindowMa nager.init(MiuiPhoneWindowManager.java:108)
    E/AndroidRuntime( 3047): at com.android.server.wm.WindowManagerService$PolicyT hread.run(WindowManagerService.java:733)
    Wrong MIUI base, mostly. Appear when something changed by previous porter (miui) which affects resources you won't have, banal link error.
    " Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)"
    Hope all of you heared about C language. That error is a form of C "exceptional case"(in other words - exception).
    You will see if it happen:
    Code:
    F/libc    ( 2698): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
    I/DEBUG   (  130): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    I/DEBUG   (  130): Build fingerprint: 'tmous/htc_doubleshot/doubleshot:4.0.3/IML
    74K/275847.101:user/release-keys'
    I/DEBUG   (  130): pid: 2698, tid: 2698  >>> zygote <<<
    I/DEBUG   (  130): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaa
    d
    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
    yaa.. ENORMOUS code block, build fingerprint, fatal signal and stack trace.. welcome to hell :D
    One little thing: error is right above that block, don't even try to parse its contents, ignore it.
    WE ALL DIE!!!111
    yaa, series of "died" errors:
    Code:
    I/ServiceManager( 1478): service 'media.audio_flinger' died
    I/ServiceManager( 1478): service 'media.player' died
    I/ServiceManager( 1478): service 'media.camera' died
    I/ServiceManager( 1478): service 'media.audio_policy' died
    IGNORE them, it's a result of exception right above(no matter C exception or java one), it's better to see it instead of posting "WE ALL DIE!!!111" :D
    "Unable to extract+optimize DEX from '/system/framework/framework.jar'" and other WTF cases
    examples:
    Code:
    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
    Code:
    05-30 14:15:15.970: E/NetworkLocationRealOs(2304): no android ID; can't access encrypted cache
    05-30 14:15:15.970: E/NetworkLocationRealOs(2304): java.io.IOException: no android ID; can't access encrypted cache
    Code:
    1012: 	07-03 03:28:21.350: E/System(1538): ************ Failure starting core service
    07-03 03:28:21.350: E/System(1538): java.lang.NullPointerException
    07-03 03:28:21.350: E/System(1538): at com.android.server.pm.PackageManagerService.grantPermissionsLPw(PackageManagerService.java:4299)
    07-03 03:28:21.350: E/System(1538): at com.android.server.pm.PackageManagerService.updatePermissionsLPw(PackageManagerService.java:4247)
    07-03 03:28:21.350: E/System(1538): at com.android.server.pm.PackageManagerService.<init>(PackageManagerService.java:1170)
    07-03 03:28:21.350: E/System(1538): at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:858)
    07-03 03:28:21.350: E/System(1538): at com.android.server.ServerThread.run(SystemServer.java:167)
    07-03 03:28:21.350: I/SystemServer(1538): Input Method Service
    07-03 03:28:21.360: W/SystemServer(1538): ***********************************************
    1021: 	07-03 03:28:21.370: A/SystemServer(1538): BOOT FAILURE starting Input Manager Service
    1022: 	07-03 03:28:21.370: A/SystemServer(1538): java.lang.NullPointerException
    1023: 	07-03 03:28:21.370: A/SystemServer(1538): at android.app.PendingIntent.getBroadcast(PendingIntent.java:293)
    1024: 	07-03 03:28:21.370: A/SystemServer(1538): at com.android.server.InputMethodManagerService.<init>(InputMethodManagerService.java:548)
    1025: 	07-03 03:28:21.370: A/SystemServer(1538): at com.android.server.ServerThread.run(SystemServer.java:271)
    1026: 	07-03 03:28:21.400: E/AndroidRuntime(1538): Error reporting WTF
    1027: 	07-03 03:28:21.400: E/AndroidRuntime(1538): java.lang.NullPointerException
    1028: 	07-03 03:28:21.400: E/AndroidRuntime(1538): at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:345)
    1029: 	07-03 03:28:21.400: E/AndroidRuntime(1538): at android.util.Log$1.onTerribleFailure(Log.java:103)
    1030: 	07-03 03:28:21.400: E/AndroidRuntime(1538): at android.util.Log.wtf(Log.java:278)
    1031: 	07-03 03:28:21.400: E/AndroidRuntime(1538): at com.android.server.ServerThread.reportWtf(SystemServer.java:77)
    1032: 	07-03 03:28:21.400: E/AndroidRuntime(1538): at com.android.server.ServerThread.run(SystemServer.java:274)
    mostly likely is about way assembling framework files. Also some of them might be just corrupted by accident. Sometimes these errors caused by wrong smali replacement or wrong diff methodology. Or it might be just banal reason - no place in system or cache partitions.
    English [:D]
    Most log parts are in mere, not technician English,log might be read as little book with bright characters. Find what you are looking for and fix it..
    Source code is your best friend in porting
    I'd recommend to have an android source code [from internet or on your local PC] to port something that outstands of rules I listed. For example CM frameworks source could be found here: https://github.com/CyanogenMod/android_frameworks_base .
    That mostly affect cases in which hardware that is not working/working but not perfect/working incorrect on MIUI but worked like a charm on base.
    Any log line represents a line of code in source, that one could search and debug from there (as source is mostly common, that miui ports possibility proove). Each smali represents a java source code or its part(- subclass which signed by $), each java is in frameworks folder on source (mostly frameworks/base). Log line is a message, which formed with C rules about these rules, so you have to avoid ciphers or guess how could code represent that message. You may search guessed line in source to locate java file, or locate it manually according to smali location and my advice and search in it.

    Happy debugging ;)
    6
    New things on this release:
    etc/telocation.idf
    lib/libjni_resource_drm.so
    android/bluetooth/HeadsetBase*.smali , framework.jar
    Provision.apk:
    damn chinese even changed a cond_5 to cond_6 (guide have been rewrote for that)..

    As you wish guys, but I couldn't maintain that thread anymore, as MIUI for me now is pure crap (having to pay for themes and create new account for them was just a last edge). Plus smalis.. on each release something becomes complicated to work with..
    So I'm out, sorry.