yashsingh1/xdaforums huggingface dataset:
[Android Software Development] CosmicDan:
Yeah I've been porting ROM's for a few months now and I still don't understand what a lot of smali code does... but I did read a lot of documentation on the smali language too. A good place to start is here (smali is based on Jasmin) - http://jasmin.sourceforge.net/guide.html

EDIT: And here is a very valuable command/syntax reference: Dalvik Opcodes

I have found one critical bug with my port though, most apps from Google Play Store simply won't download - they are just stuck and won't start. The one app that does work is ROM Manager. :(

EDIT: Solved it by using Google DNS servers (thanks again to logcat). MIUI5 is cool, if you set static IP and delete your local DNS IP, it automatically sets Google DNS (8.8.8.8) :D
[Android Software Development] ZduneX25:
@CosmicDan yeah i did use cm10 kernel, gonna try with the next release
[Android Software Development] v1r0x:
:crying::mad:

omg, I hate this sh*t <.<

I tried to port the Skip track mod from Andy Thomsons I9000 Rom to mine (He is using nexus s, too). But it doesn't work :confused:

Don't know what could be wrong. Diffed the PhoneWindowManager and added the two other smalis.

Should be the same framework
[Android Software Development] firered365:
Trouble with framework

OK guys, I am having trouble with the framework. I am porting the Nexus 7 MIUI ROM to the Kindle Fire and when I decompiled framework.jar in apktool, I saw nothing. Any ideas?
[Android Software Development] v1r0x:
Ok, I was a curious about JB :D

So I decided to try a port with early JB port for my device and good old Nexus S (<3 :D) MIUI.

I've done everything as with v4 but now I get this.

Anyone an idea?

08-21 20:33:30.600: W/AudioPolicyManagerBase(15588): could not open HW module usb
08-21 20:33:00.390: W/dalvikvm(14915): VFY: register index out of range (1 >= 1)
08-21 20:33:00.390: W/dalvikvm(14915): VFY: rejecting opcode 0x12 at 0x0002
08-21 20:33:00.390: W/dalvikvm(14915): VFY: rejected Landroid/os/SystemProperties;.<clinit> ()V
08-21 20:33:00.390: W/dalvikvm(14915): Verifier rejected class Landroid/os/SystemProperties;
08-21 20:33:00.390: W/dalvikvm(14915): Exception Ljava/lang/VerifyError; thrown while initializing Landroid/os/Build;
08-21 20:33:00.390: W/dalvikvm(14915): Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing Landroid/os/StrictMode;
08-21 20:33:00.400: A/libc(14915): Fatal signal 11 (SIGSEGV) at 0x0000002c (code=1), thread 14915 (zygote)
08-21 20:33:00.520: E/HTC Acoustic(14916): ioctl ACOUSTIC_UPDATE_ADIE failed -1
08-21 20:33:00.520: E/HTC Acoustic(14916): ioctl ACOUSTIC_UPDATE_ADIE failed -1
08-21 20:33:00.530: E/HTC Acoustic(14916): ioctl ACOUSTIC_UPDATE_ADIE failed -1
08-21 20:33:00.530: E/HTC Acoustic(14916): ioctl ACOUSTIC_UPDATE_ADIE failed -1
08-21 20:33:00.550: E/HTC Acoustic(14916): ioctl ACOUSTIC_UPDATE_ADIE failed -1
08-21 20:33:00.550: E/BandwidthController(14914): runIptablesCmd(): failed /system/bin/iptables -t raw -N bw_raw_PREROUTING res=256
08-21 20:33:00.550: E/HTC Acoustic(14916): failed to open A2051 CSV files /system/etc/TPA2051_CFG.csv.
08-21 20:33:00.560: E/BandwidthController(14914): runIptablesCmd(): failed /system/bin/ip6tables -t raw -N bw_raw_PREROUTING res=256
08-21 20:33:00.600: W/AudioFlinger(14916): Thread AudioOut_2 cannot connect to the power manager service
08-21 20:33:00.600: E/AudioHardwareMSM7X30(14916): updateDeviceInfo: E rx_device 6 and tx_device 11
08-21 20:33:00.600: E/AudioHardwareMSM7X30(14916): updateDeviceInfo: X cur_rx 6 cur_tx 11
08-21 20:33:00.610: E/AudioFlinger(14916): int android::load_audio_interface(char const*, audio_hw_device_t**) couldn't load audio hw module audio.usb (No such file or directory)
[Android Software Development] CosmicDan:
I have it half working, the Smali files are attached. By half-working I mean, when music is playing and screen is off - VolUp doesn't do anything, and holding either volume button will both skip forward (no skip backwards). I spent many hours on this trying different constants and variables but this is the best I could get it. It's good enough for me so I won't waste any more headaches on it lol.

Note - these smali files are only for Galaxy Nexus 2.8.17 (JB) of MIUI.

Try APKTool 1.4.10.

Bad SystemProperties.smali file, dunno how that happened. Try using Galaxy Nexus MIUI, that's what I used.
[Android Software Development] v1r0x:
I'll have a look at it, as soon as my rom boots ;)

I've only diffed the two smalis :confused:

Is there a reason why you are using galaxy nexus and not nexus s?
[Android Software Development] CosmicDan:
Don't diff, copy the whole file.

Yes, because the Galaxy Nexus has a GSM and CDMA version (maguro and toro respectively) and the Xperia Play also has GSM and CDMA versions. I want to target both. The Galaxy Nexus has no proprietary Samsung code whatsoever and uses Generic branding/RIL classes, because like all the Nexus phones it was a Google flagship/milestone phone.

EDIT: I know the Galaxy Nexus is newer and XHDPI, which can cause issues. I dunno, maybe those smali files will also work on the Nexus S. But if it doesn't, bummer.
[Android Software Development] firered365:
I downloaded APKTool 1.4.10, but I keeps giving me apktool.yml in the decompiled folder.
[Android Software Development] CosmicDan:
Dunno, maybe you're not using it right or have the wrong aapt.exe binary. I usually rename the jar to apk before decompiling but I don't think that's needed.
[Android Software Development] firered365:
I'll try that! I will come back to see what happens.

Still the folder shows up, but inside it shows apktool.yml. I am using Ubuntu 12.04.
[Android Software Development] CosmicDan:
I use Windows but I've used APKTool inside Ubuntu too. But what is the actual console output of apktool? Maybe you need to change permissions... are you doing all this inside your home folder?
[Android Software Development] firered365:
I have the tool in usr/local/bin.

May I send you the files I need to decompile in a pm?
[Android Software Development] v1r0x:
Ok, I have copied whole SystemProperties.smali

The warning is gone, but I still got this.

08-22 02:10:01.175: E/BandwidthController(5034): runIptablesCmd(): failed /system/bin/iptables -t raw -N bw_raw_PREROUTING res=256
08-22 02:10:01.215: E/BandwidthController(5034): runIptablesCmd(): failed /system/bin/ip6tables -t raw -N bw_raw_PREROUTING res=256
08-22 02:10:01.245: E/HTC Acoustic(5036): ioctl ACOUSTIC_UPDATE_ADIE failed -1
08-22 02:10:01.245: E/HTC Acoustic(5036): ioctl ACOUSTIC_UPDATE_ADIE failed -1
08-22 02:10:01.245: E/HTC Acoustic(5036): ioctl ACOUSTIC_UPDATE_ADIE failed -1
08-22 02:10:01.245: E/HTC Acoustic(5036): ioctl ACOUSTIC_UPDATE_ADIE failed -1
08-22 02:10:01.255: E/HTC Acoustic(5036): ioctl ACOUSTIC_UPDATE_ADIE failed -1
08-22 02:10:01.265: E/HTC Acoustic(5036): failed to open A2051 CSV files /system/etc/TPA2051_CFG.csv.
08-22 02:10:01.325: E/AudioHardwareMSM7X30(5036): updateDeviceInfo: E rx_device 6 and tx_device 11
08-22 02:10:01.325: E/AudioHardwareMSM7X30(5036): updateDeviceInfo: X cur_rx 6 cur_tx 11
08-22 02:10:01.325: E/AudioFlinger(5036): int android::load_audio_interface(char const*, audio_hw_device_t**) couldn't load audio hw module audio.usb (No such file or directory)
08-22 02:10:01.465: E/AudioTrack-JNI(5035): Can't find android/media/AudioFormat.ENCODING_AMRNB
08-22 02:10:01.475: E/AndroidRuntime(5035): Unable to register all android natives

Don't know what's the problem :confused:
[Android Software Development] CosmicDan:
Looks like you're missing a file called "audio.usb" or maybe called something else, possibly in /system/lib/hw/

Are you using 100% original CM10 lib folder? Maybe it's unique to your device, but i use all CM10 libs except I copied these files from MIUI:

content-types.properties
liblbesec.so
libdrmframework_jni.so
libmedia_jni.so
libmtp.so
libphonelock.so

But those didn't fix any boot issues, just later issues once booted.
[Android Software Development] v1r0x:
Ok, my bad :D

Thought it is just a unnecessary lib :o

After some modifications my rom boots :) :highfive:

Thanks for the hint
[Android Software Development] firered365:
That s my problem! It boots up, then stays there, frozen. I need help. Plus I can't even decompile the apk nor jar files because it shows nothing when finish decompiling.
[Android Software Development] CosmicDan:
Obviously it's not the same problem if you kept all CM10 libs so we'll need a logcat. And I dunno what the problem with apktool is, even the old 1.4.3 works fine on jar files.
[Android Software Development] Lens_flare:
You have apktool at usr/local/bin but do you have its dependencies (aapt.exe) at the same folder? Seem to me you don't.

Easier way to prepare apktool to work:

- dload these:

http://code.google.com/p/android-apktool/downloads/detail?name=apktool1.4.3.tar.bz2&can=2&q=

http://code.google.com/p/android-ap...tool-install-linux-r04-brut1.tar.bz2&can=2&q=

- dload apktool you want and replace apktool jar you dloaded previously

- in terminal issue:

mkdir -p bin

- copy all you dloaded to that folder

- enjoy :D

then you could just issue apktool as a new command.

PS:

connor apktool still works with newest ICS frameworks.
[Android Software Development] DJBhardwaj:
@cosmic, lens: Have a look at this error. http://pastebin.com/DTSmhvmK

I guess it has something to do with /android/os/Environment.smali (I replaced the MIUI one from cm10 base)

If I am wrong, please correct me. And apart from this, does the log says anything else? That I might I have did wrong?
[Android Software Development] Lens_flare:
E/JNIHelp ( 1543): Native registration unable to find class 'android/debug/JNITe
st', aborting

you recompiled framework.jar wrong, seems.
[Android Software Development] CosmicDan:
Copy the JNITest.smali file, it's right there.

But why copy Environment.smali? I didn't need to for CM10. Or are you still using ICS version?
[Android Software Development] Alex93917:
Hello !

I've an issue with bluetooth call in my 2.8.10.

Actually, when people call other people, they don't hear speak ...

How fix it ?

Thank you.

Envoyé depuis mon GT-I9001 avec Tapatalk
[Android Software Development] Lens_flare:
bt is most likely works at kernel-binary level so that you might forgot something to add.
[Android Software Development] DJBhardwaj:
Okay, I just replaced the Environment.smali back from MIUI. So it is now unchanged and not replaced.

Flashing now, lets see what comes up. :fingers-crossed:
[Android Software Development] DJBhardwaj:
Finally, booted the ROM.

Thanks alot Dan and lens!

Oh, previously I was compiling framework.jar wrong. That's what gave me the error.

@Cosmic: You steps, a few pages back were so helpful.

---------- Post added at 04:00 PM ---------- Previous post was at 03:59 PM ----------

Finally, booted the ROM.

Thanks alot Dan and lens!

Oh, previously I was compiling framework.jar wrong. That's what gave me the error.

@Cosmic: You steps, a few pages back were so helpful.
[Android Software Development] Lens_flare:
Paint.smali is responsible for that. My recommendations are something you want to do with new porting before asking, though.

then it's already there.

You may check that out by looking at the yourROM/system/etc/permissions and also MIUIBaseROM/system/etc/permissions to copy that file from.
[Android Software Development] raj_k_r:
Thank you. Will check that. Trying from yesterday without luck. Googled and searched so many forums but no luck :(
[Android Software Development] bihariel:
Hi, i ported miui successfully but i have problems to get Usb strage morking.

Logcat:

Quote:

12:58:07.387 Error Vold 1111 Unable to open ums lunfile /sys/class/android_usb/android0/f_mass_storage/lun/file (No such file or directory)

12:58:07.387 Error Vold 1111 Unable to find ums lunfile for LUN 0

12:58:07.387 Error MountService 1448 Failed to share/unshare

12:58:07.387 Error MountService 1448 com.android.server.NativeDaemonConnectorException: Cmd {volume share /mnt/sdcard ums} failed with code 400 : {volume operation failed (Invalid argument)}

12:58:07.387 Error MountService 1448 at com.android.server.NativeDaemonConnector.doCommand Locked(NativeDaemonConnector.java:281)

12:58:07.387 Error MountService 1448 at com.android.server.NativeDaemonConnector.doCommand (NativeDaemonConnector.java:241)

12:58:07.387 Error MountService 1448 at com.android.server.MountService.doShareUnshareVolu me(MountService.java:567)

12:58:07.387 Error MountService 1448 at com.android.server.MountService.access$200(MountSe rvice.java:92)

12:58:07.387 Error MountService 1448 at com.android.server.MountService$UmsEnableCallBack. handleFinished(MountService.java:334)

12:58:07.387 Error MountService 1448 at com.android.server.MountService$MountServiceHandle r.handleMessage(MountService.java:438)

12:58:07.387 Error MountService 1448 at android.os.Handler.dispatchMessage(Handler.java:99 )

12:58:07.387 Error MountService 1448 at android.os.Looper.loop(Looper.java:137)

12:58:07.387 Error MountService 1448 at android.os.HandlerThread.run(HandlerThread.java:60 )

12:58:08.699 Error Vold 1111 Unable to open ums lunfile /sys/class/android_usb/android1/f_mass_storage/lun/file (No such file or directory)

12:58:08.699 Error Vold 1111 Unable to find ums lunfile for LUN 1

12:58:08.699 Error MountService 1448 Failed to share/unshare

12:58:08.699 Error MountService 1448 com.android.server.NativeDaemonConnectorException: Cmd {volume share /mnt/emmc ums} failed with code 400 : {volume operation failed (Invalid argument)}

12:58:08.699 Error MountService 1448 at com.android.server.NativeDaemonConnector.doCommand Locked(NativeDaemonConnector.java:281)

12:58:08.699 Error MountService 1448 at com.android.server.NativeDaemonConnector.doCommand (NativeDaemonConnector.java:241)

12:58:08.699 Error MountService 1448 at com.android.server.MountService.doShareUnshareVolu me(MountService.java:567)

12:58:08.699 Error MountService 1448 at com.android.server.MountService.access$200(MountSe rvice.java:92)

12:58:08.699 Error MountService 1448 at com.android.server.MountService$UmsEnableCallBack. handleFinished(MountService.java:334)

12:58:08.699 Error MountService 1448 at com.android.server.MountService$MountServiceHandle r.handleMessage(MountService.java:438)

12:58:08.699 Error MountService 1448 at android.os.Handler.dispatchMessage(Handler.java:99 )

12:58:08.699 Error MountService 1448 at android.os.Looper.loop(Looper.java:137)

12:58:08.699 Error MountService 1448 at android.os.HandlerThread.run(HandlerThread.java:60 )

Please helpme to fix this

thanks
[Android Software Development] Lens_flare:
have you seen fourth stage? First guide in it describes how to get masstorage work on devices with old usb gadget framework.

Your error is about path that doesn't exists.
[Android Software Development] Lens_flare:
That's where I must say your work was useless. Xperia-Xperia? Great, but one little detail: It's stock XS, not a CM-based. So it's tweaked ENOUGH that prevents reusing.

right.

sooo you used miui android runtime and want something to work? Sorry, forget about it.
[Android Software Development] CosmicDan:
Hmm OK.... that makes sense why the only MIUI for the Play is built on official ICS Beta and not CM9 then. Odd, never had this trouble with MIUI Gingerbread.

All the MIUIv4 guides, including yours, say nothing about replacing CM9 libs with MIUI ones - only the apps and framework. But fair enough.

So basically what you're saying is I should base this on official ICS? And doing it on CM9 (or any other AOSP-based ROM) is just not possible?

EDIT: I replaced some more framework files from CM9 versions and got to the "Optimizing apps" page, but now I'm in another bootloop with all sorts of random errors. Damn.
[Android Software Development] Lens_flare:
of couse. They assume you have base and replaced app and framework with MIUI.

if your base is XS, yes.

what if you just change base to nexus S? ;)

It's not so hard with guide like mine ;]

PS:

World just have been changed, MIUI are now rejecting CM source in choice for AOSP base.
[Android Software Development] CosmicDan:
That's a good idea, Nexus S is a more "standard" Android device right?

Never knew that, good to know.

Well I managed to get it to boot now, but I get FC's on MIUI Home and also media process. If I can't fix them I'll take a crack at using Nexus S base. Cheers.
[Android Software Development] Lens_flare:
pure AOSP.

miui-framework.xml permission?
[Android Software Development] CosmicDan:
Nah that's all good I needed to merge more CM9 framework in. It boots and I have wifi access but nearly every app crashes :) But the errors all make sense to me now, it'll end up being an MIUI/CM9 mutant :cyclops:
[Android Software Development] bihariel:
thanks, found that the problem was that i was using a wrong vold binary file.
[Android Software Development] CosmicDan:
Thanks again for the guide Lens_Flare, I have finally released a public alpha of MIUI based on CM9 for the Xperia Play. I only had to replace one CM9 lib (to get Media Scanner working) and not a single binary ;) mind you though, I am using CM9 Web Browser and Camera, and still have some issues here and there. I'm confident I will solve them by slowly merging in the CM9 framework, since all I wanted was the base MIUI style (statusbar, apps, etc) anyway.

All the best and I really appreciate the time you took to document your porting!
[Android Software Development] :
lens_flare i have learned alot from reading your guide very good job! i have a made a port for my x10i and everything is working perfectly! only one problem i was hoping you could help me with... when you apply a theme it applies fine, but when you reboot theme goes back to stock! i cant figure out whats wrong so i was hoping for your help! :)

- Milad
[Android Software Development] Lens_flare:
it was a problem with miui gingerbread that resolved by enabling init.d scripts. As miui is now AOSP, something acts like that script (some of the framework?), there was a mention about invoke-as, check it out.

maybe you have to recreate folder with theme each time (or just have something that do something like that on your base). Unfortunately I don't know which folder now is responsible for theme, it used to be data/theme or something like that.
[Android Software Development] :
It is still data/system/theme but how would I go about creating a fix thank you for your help :)
[Android Software Development] Lens_flare:
create init.d script like 20recreate with following:

#!system/bin/sh
mkdir data/system/theme

and push to system/etc/init.d, ensure there are no scripts with 20 in the beginning.

I'm not sure about first line, I almost forgot how it should exactly look.
[Android Software Development] :
Thank you very much.. it of course didn't work because i forgot to tell you that only icons and lock screen gets resetet to default after reboot.. the rest is working fine :) hope you got an idea what is causing this :)
[Android Software Development] Lens_flare:
it is something on base part, permissions, init.d scripts etc, check..
[Android Software Development] CosmicDan:
I've noticed that MIUI 4 no longer has any init.d scripts at all, no more 06defaulttheme like GB. The number doesn't matter, it just forces a specific order of boot. Anyway try this one:

06defaulttheme

#!/system/bin/sh

SYSTEM_FOLDER=/data/system
rm -r -f $SYSTEM_FOLDER/theme1

if [ ! -d $SYSTEM_FOLDER ];
then
mkdir -p $SYSTEM_FOLDER;
chmod -R 775 $SYSTEM_FOLDER;
chown -R 1000:1000 $SYSTEM_FOLDER;
fi

THEME_FOLDER=$SYSTEM_FOLDER/theme
THEME_BEGIN_FLAG=$SYSTEM_FOLDER/.theme_begin
THEME_END_FLAG=$SYSTEM_FOLDER/.theme_end
if [ ! -d $THEME_FOLDER ] || ( [ -f $THEME_BEGIN_FLAG ] && [ ! -f $THEME_END_FLAG ] );
then
echo "[MIUI] No theme active, applying default";
rm -r -f $THEME_FOLDER;
rm -r -f $SYSTEM_FOLDER/customized_icons_1;
touch $THEME_BEGIN_FLAG;
mkdir -p $THEME_FOLDER;
unzip -o /system/media/theme/default.mtz -d $THEME_FOLDER;
chmod -R 775 $THEME_FOLDER;
chown -R 1030:1030 $THEME_FOLDER;
touch $THEME_END_FLAG;
else
chmod -R 775 $THEME_FOLDER;
chown -R 1030:1030 $THEME_FOLDER;
fi

exit;

If you want to use an alternative (your own) theme as the default, you need to duplicate the default.mtz line underneath it and change the mtz filename on the second one to your desired default.

Do this all at your own risk, I dunno if it will fix it - the MIUI I ported has theme switching and staying working 100% with no init.d scripts.
[Android Software Development] DJBhardwaj:
@cosmic and lens, have a look at this

What happens is:

1. I go to toggles

2. press data toggle

3. It shows me this

4. a) If i select "OK", data status remains unchanged.

b) If I select "re-enanble data", It give FC to SystemUI

LOG: http://pastebin.com/4RdSrihv
[Android Software Development] v1r0x:
I had this "bug" on ICS, too.

After hitting "Ok" for several times it should work.

Anyone an idea how to fix keyboard not showing up?

I have a hardware keyboard which works, but on-screen keyboard won't show up :(
[Android Software Development] DJBhardwaj:
I need a complete solution :/

And its silly to say but you have LatinIME.apk in system/app. Right?

Or missing any dependencies?
[Android Software Development] v1r0x:
Sorry, no idea :/

Yes, it's there. But I've fixed it.

Thanks.

I had to disable hardware-keyboard in settings. Now both work oO :confused:
[Android Software Development] CosmicDan:
It annoyed me too. But new JB builds dont do it. New Jb MIUI is actually very stable, fast and bug free for me.

EDIT: Also had keyboard not showing on later ICS builds too, but rebooting again solves it.

Sent from Xperia Play (R800a) with Tapatalk
[Android Software Development] v1r0x:
Yes, JB is easy to port. Needs less smali edits than ICS.

Themes seems to be a little bit buggy.

my

ro.build.version.incremental

in build.prop had a blank (space) and so Themes closed right after starting it. But without FC. After removing the blank and reboot it works fine.
[Android Software Development] chonkit:
hi guys..do you all had any idea to change google location service provider to google location service provider? i tried to copy networklocation.apk from gapps-jb-20120726-signed, pasted into /system/app and set permission, but when boot up it does not occur in the apps there..which apk or file i need to change so that i can use network location apk from the gapps-jb-20120726-signed.

thanks in advance
[Android Software Development] v1r0x:
What do you mean with use? It's just a provider for location services. ;)
[Android Software Development] chonkit:
erm, since miui changed location service provider from google to baidu, i unable to use my google maps with google location service on in location service settings, i google and found out that many people replace the network location.apk from earlier build and the location service worked again. i replace the networklocation.apk as mention by replacing the networklocation.apk to /system/app but once reboot, its disappear and logcat show that signature mismatch for networklocation.apk.
[Android Software Development] v1r0x:
Maybe a missing xml-file in /system/etc/permissions or missing jar in /system/framework

and you can delete the liblocSDK_2.5OEM.so oder anything starting with liblocSDK_ in /system/lib

Works for me
[Android Software Development] chonkit:
ok thanks..will try your solution =)
[Android Software Development] Hikari:
guys after the first boot my jb wont boot again.. pc says "usb device not recognized".. I tried to fix usb subsystem following this tut, but didnt help. as I said I booted the rom once so I know that things are pretty much working(correct files, etc..).. but still not sure.. any help?
[Android Software Development] firered365:
Here is the logcat: http://pastebin.com/XcbAp5C0
[Android Software Development] v1r0x:
what says logcat of your device?
[Android Software Development] Hikari:
thats the thing Im unable to see the logcat.. "usb device not recognized" :(
[Android Software Development] firered365:
I get an error when I try to put the files in the /bin file.
[Android Software Development] v1r0x:
There are some Log-Apps out there.

E.g. this one:

https://play.google.com/store/apps/...ic.android.logcollector&feature=search_result