GUIDE Hacking Android

May 30, 2016 | Author: homesman | Category: N/A
Share Embed Donate


Short Description

Android...

Description

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

xda-developers  Android Development and Hacking  Android Software Development  [GUIDE] [ICS/JB/common] Definitive FAQ for newest miui porting by Lens_flare

 Post Reply 1

2

 Subscribe to Thread

3

11

51

FORUMS

 Email Thread

101



Android Software Development

Last 

Android General

Search Thread

Android Q&A, Help & Troubleshooting

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

Android Software and Hacking General [Developers Only]

Discussion Q&A

 Lens_flare OP

Miscellaneous Android Development

 

Thanks: 2,467

Account currently disabled



17th July 2012, 06:16 AM | #1  



[More]

 

I know there is a Proxuser's guide - "How to Port MIUI v4 for

your device" and GREAT thread intended to eliminate porting

MOST THANKED

ALL-TIME

quirks.

104

which could be helpful for new users porting newest releases

Lens_flare OP

FAQ assumes questionaire, but my format will be more look

96

My goal is to collect all the experience we got in that thread, of miui.

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 -

MENU

bases choice.

is great and …

and also miui release you choose.

which is Qualcomm S2 …

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

tuto above didn't …

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 MIUI for nexus S and Galaxy Nexus are now upgraded to Jelly

… 2012-Nov-04 6:43

(quote) what are you porting? MIUI V5 4.1 or 4.2 or MIUI V4? …

Notorious



2012-Jul-17 1:17

New things on this release: etc/telocation.idf

Lens_flare OP

4

2012-Jul-17 1:16

Stage 3 Third part mostly touches cases where

Lens_flare OP

6

2012-Jul-17 4:42

Stage 2 Recently I had an Acer Liquid MT,

 Register  Login

Under base I will mean rom which could be used to port miui

help to eliminate bugs I haven't listed.

Stage 4 Last part. We recently ported miui, all

Lens_flare OP

63

RECENT

2013-Jul-20 20:40

XDA PORTAL POSTS

Do You Agree with the Verge’s Best Keyboard Choices? The Verge did some testing of all the major Android keyboards and came to the … more

http://forum.xda­developers.com/showthread.php?t=1777999

1/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

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

By Emil Kako

If for you version number is crucial - stop reading this guide

Samsung Galaxy Tab A Hits USA, but Is It Cheap Enough?

and just use PatchROM (though rom will be based on Stock rom).

There is third variant, but it needs a device with nearly same

Samsung’s tablet repertoire

specs:

keeps growing, this time

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,

abandoning the S for … more By Mario Tomás Serrafero

mini, pro, mini pro etc) - arc s [lt18i] miui base and xperia 2012

Google’s latest foray into making Android run every

When base choosen, start to port:

facet of our daily lives is their

Copy unpacked base rom (so set of folders) to any folder you

system - folder on which we will work more often

30 Apr 2015

Android Auto: A Better Choice

(u,p, sola etc) - S miui base.

prefer (let's name it "MIUI"), it usually contains:

30 Apr 2015

push into the … more By Mike McCrary

30 Apr 2015

boot scripts, config files etc.

LG G4’s Evolution: Abandoning Trends, or Starting Them?

META-INF - contains certificates and signature for

The LG G4 has met a lot of

data - may contain something necessary such as first

signcheck, updater-script(we also will work on it) update-binary (updater-script command processor) boot.img, kernel and ramdisk packed together, touch

positive feedback since its unveiling at this … more By Mario Tomás Serrafero

30 Apr 2015

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: http://forum.xda­developers.com/showthread.php?t=1777999

2/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

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:

http://forum.xda­developers.com/showthread.php?t=1777999

3/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

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

http://forum.xda­developers.com/showthread.php?t=1777999

4/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

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"); 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");

set_perm(0, 0, 06755, "/system/xbin/invoke‐as");

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"[later big code bunch like "/system/xbin/[" etc]

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

For those who didn't met that rule I prepared next parts http://forum.xda­developers.com/showthread.php?t=1777999

5/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

framework mods and common debugging and troubleshooting. See next 2 posts.

Last edited by Lens_flare; 4th November 2012 at 11:44 AM. Reason: jellybean

 The Following 143 Users Say Thank You to Lens_flare For This Useful Post:

[ View ]

 

 Lens_flare OP

 

Thanks: 2,467

Account currently disabled

17th July 2012, 06:16 AM | #2  







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 My suggestion is port.

For those who are new in apktool disassembling, I suggest to http://forum.xda­developers.com/showthread.php?t=1777999

6/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

read something like that http://forum.xda-

developers.com/show....php?t=1511730 or that

http://forum.xda-developers.com/show....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 [full name of apk or jar]

command on file I specify if more info not specified assemble something - usually means issuing Code:

apktool b  [disassembled apk or jar folder without .apk in name or with ".out" at the end 

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: RIL.smali RIL$1.smali

Let's start with framework mods:

All frameworks are located at system/framework.

framework.jar http://forum.xda­developers.com/showthread.php?t=1777999

7/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

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:

android/os/Power.smali org/codeaurora/Performance.smali android/media/MediaRecorder*.smali android/graphics/Paint.smali android/os/Environment.smali android/view/HardwareCanvas.smali android/net/wifi/WifiNative.smali Common: Code:

android/view/Gles20*.smali (not only canvas but all with gles20 at the beginning) android/hardware/Camera*.smali android/server/BluetoothA2dpService*.smali android/content/res/PackageRedirectionMap*.smali

JellyBean Only: Code:

android/bluetooth/HeadsetBase*.smali com/android/internal/app/ActivityTrigger.smali android/webkit/HTML5*.smali android/webkit/SelectActionModeCallback 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

It have to be patched

end of ICS-only

I highlighted it as ICS-only as you will just replace it on http://forum.xda­developers.com/showthread.php?t=1777999

8/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

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.

http://forum.xda­developers.com/showthread.php?t=1777999

9/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

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;‐>(Landroid/con http://forum.xda­developers.com/showthread.php?t=1777999

10/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

-> Code:

    .line 136     new‐instance v8, Lcom/android/internal/telephony/     invoke‐direct {v8, p0, v4, v0}, Lcom/android/internal/telephony/ 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

while miui file will show just that: Code: http://forum.xda­developers.com/showthread.php?t=1777999

11/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

    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

except "goto", which will show as differ, but who cares?

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

http://forum.xda­developers.com/showthread.php?t=1777999

12/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

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 http://forum.xda­developers.com/showthread.php?t=1777999

13/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

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

Last edited by Lens_flare; 4th November 2012 at 10:15 AM. Reason: jellybean

 The Following 96 Users Say Thank You to Lens_flare For This Useful Post:

 Lens_flare OP

 

Thanks: 2,467

Account currently disabled

17th July 2012, 06:17 AM | #3  

[ View ]







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 http://forum.xda­developers.com/showthread.php?t=1777999

14/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

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

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 http://forum.xda­developers.com/showthread.php?t=1777999

15/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

"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 http://forum.xda­developers.com/showthread.php?t=1777999

16/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

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

)

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 #0x3060 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.j

E/AndroidRuntime( 3047): at miui.util.HapticFeedbackUtil$SettingsObserver.obse rve(HapticFeed E/AndroidRuntime( 3047): at miui.util.HapticFeedbackUtil.(HapticFeedback Util.java:75) 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:

http://forum.xda­developers.com/showthread.php?t=1777999

17/34

1.5.2015

[GUIDE][ICS/JB/common] Definitive FAQ for ne… | Android Development and Hacking | XDA Forums

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

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF