yashsingh1/xdaforums huggingface dataset:
[G2 and Desire Z Android Development] HTCDreamOn:
Do I still use CM9 for PA2.5?

I'm having a stab at porting Paranoid Android from the Desire S, but it's Jelly Bean 4.1 and PA 2.5, so do I still use CM9 as my base ROM? If I do, will the end result be ICS or Jelly Bean? Is it possible to use CM10? Sorry for all these n00b questions, this is my first attempt at porting, although I hope someone can help me :)
[G2 and Desire Z Android Development] lms24:
I guess it should work better with CM10. If you don't get it booting, try CM9 instead but I doubt it would work with CM9..
[G2 and Desire Z Android Development] HTCDreamOn:
used CM10

Thanks, tried CM9 but boot looped, then tried Andromadus CM10 build 132 and it booted. The problems I have so far are: 1) soft keyboard is not showing up 2) physical keyboard works but backlight doesn't 3) Paranoid Settings doesn't work. I mean I can set things, but upon reboot nothing happens?

Don't suppose anyone's got any ideas so far? I can do a log cat if anyone willing to help :). Thanks
[G2 and Desire Z Android Development] lms24:
This post should correct your first 2 problems.

http://xdaforums.com/showpost.php?p=31329467&postcount=184
[G2 and Desire Z Android Development] HTCDreamOn:
logcats (yay)

I've attached two logcats both starting from when I opened settings, to going into paranoid preferences, to the phone shutting down. One is whilst selecting tablet UI from "launch" in PA settings, he other is from going into "interface" from PA settings then selecting tablet mode for Workspace UI.

I'd really appreciate if someone could help me with this, I'm new to porting, etc., so am certainly not knowledgeable when it comes logcats. I'm not stupid either, so I'd still like the help :). Thanks

---edit---1515---

I've had a look, and just after I change the PA settings there appears to be an error:

01-13 13:38:33.089 I/ActivityManager( 303): Start proc com.paranoid.preferences for activity com.paranoid.preferences/.PreferenceListActivity: pid=1332 uid=1000 gids={1015, 3002, 3001, 3003, 1028, 3007}
01-13 13:38:33.129 D/dalvikvm( 120): GC_EXPLICIT freed 38K, 74% free 2199K/8451K, paused 2ms+4ms, total 47ms
01-13 13:38:33.170 D/dalvikvm( 120): GC_EXPLICIT freed <1K, 74% free 2199K/8451K, paused 2ms+2ms, total 39ms
01-13 13:38:33.220 D/dalvikvm( 120): GC_EXPLICIT freed <1K, 74% free 2199K/8451K, paused 4ms+2ms, total 45ms
01-13 13:38:33.320 E/Trace ( 1332): error opening trace file: No such file or directory (2)

The last line, E/Trace. I don't understand it, but I know it's an error and I know something's up, so does anyone have any ideas?

---edit---1554---

I am now pretty sure the problem is the PA Settings app itself, because I can set tablet mode by manually editing /system/etc/paranoid/preferences.conf .

---edit---1952---

Also, I can't find the two .line xxxx lines with a difference of 2 followed by const/4 v1, 0x1 in PhoneWIndowManager.smali, which I've also attached (if someone would be willing to take a look).
[G2 and Desire Z Android Development] lms24:
Alright, I took a look at the smail file and found out something interesting. I compared the method readlidstate() in PhoneWindowManager.smali to the same method in my Rom Sabsa Bliss and Tean venoms' ViperZ. The method of your rom looks really diffrent than the other ones:

Your ROM:

.method readLidState()V
.registers 2

.prologue
.line 1648
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWindowManagerFuncs:Landroid/view/WindowManagerPolicy$WindowManagerFuncs;

invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowManagerFuncs;->getLidState()I

move-result v0

iput v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLidState:I

.line 1649
return-void
.end method

My ROM:

.method readLidState()V
.locals 3

.prologue
.line 1558
:try_start_0
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mWindowManager:Landroid/view/IWindowManager;

const/4 v2, 0x0

invoke-interface {v1, v2}, Landroid/view/IWindowManager;->getSwitchState(I)I

move-result v0

.line 1559
.local v0, sw:I
if-lez v0, :cond_d

.line 1560
const/4 v1, 0x0

iput v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLidOpen:I

.line 1569
.end local v0 #sw:I
:goto_c
return-void

.line 1561
.restart local v0 #sw:I
:cond_d
if-nez v0, :cond_15

.line 1562
const/4 v1, 0x1

iput v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLidOpen:I

goto :goto_c

.line 1566
.end local v0 #sw:I
:catch_13
move-exception v1

goto :goto_c

.line 1564
.restart local v0 #sw:I
:cond_15
const/4 v1, 0x1

iput v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLidOpen:I
:try_end_18
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_18} :catch_13

goto :goto_c
.end method

I have no idea if this works, but I replaced the method of your file with the method of my Rom in the attached smali file. Replace the file with he attached one and try to recompile android.policy.jar. Let me know if it worked :)

If this doesn't work, can you give me your android.policy.jar? Maybe the code has changed in JB..
[G2 and Desire Z Android Development] ajhavery:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The rom is a hybrid do there might be some changes in the phonewindowmanager.smali.

I should have mentioned earlier that while porting roms, use the same base, i.e ICS for ICS and so on.

Now, I would say that you should follow the following while porting roms:

Before asking questions you should mention the base rom you are using for your port, the rom you are porting and your progress.

Did you got it to boot??

I would say take the base cyanogenmod 10 rom, since I believe you are porting JB 4.1.2, so take jellybelly beta 1 as your base rom.

Rename the jellybelly beta to base.zip and the rom you would like to port to port.zip.

STEP 1:

Extract PORT to any folder and BASE to another folder.

STEP 2:

Delete app, framework and media folders from /system folder of BASE

Transfer these folders from PORT to BASE.

STEP 3:

Delete libandroid_runtime.so form /system/lib

Copy libandroid_runtime.so from PORT /system/lib to BASE /system/lib

"If you get into bootloop then you should use the base libandroid_runtime.so."

STEP 4:

Copy any missing files you find from /system/lib and /system/etc folder of port to corresponding folders of base.

Copy any missing xmls from PORT /system/etc/permissions to BASE

STEP 5:

In build.prop, make corresponding changes as I have mentioned in my guide.

Change product.board and devices and anywhere you find saga or Desire S to vision and Desire HD.

don't change ro.build.fingerprint.

Take a look in build.prop and ask if you get stuck somewhere.

STEP 6:

updater-script CHANGES:

For saga, you don't need any major changes but look if the updater script mentions saga anywhere and change it to vision.

STEP 7:

Now you need to make device specific changes.

Look at the keyboard fix I've mentioned in my first post and make corresponding changes. Usually there is no need to make auto brightness changes but do that if you need it.

For trackpad wake, it should be there but if it isn't, post you keyboardviewmediator.smali and I'll make the necessary changes.

(Too lazy right now to explain it.)

STEP 8:

Now zip the base file using 7zip. And check if everything is as it should be.

Now you are ready for the first test.

Report the steps you followed.
[G2 and Desire Z Android Development] ajhavery:
For keyboard fix, do the following:

Change the following line in framework-res/res/values/bools.xml:

<bool name="config_forceDisableHardwareKeyboard">true</bool>

Setting this value to false fixed the keyboard issue completely.

If you get stuck somewhere, go through this post atleast once:

http://xdaforums.com/showthread.php?p=28885450#post28885450

It's for miui but it has got fixes which work for most ports.
[G2 and Desire Z Android Development] HTCDreamOn:
Thanks for your help, but it's already set to false. I'll try the android.policy.jar hacks.

@lms24 : Thank you very much for help, but unfortunately I get bootloops with the new android.policy.jar . I've attached my original, and once again thanks for your time and effort :good: I love the Vision community :laugh:

@ajhavery : I've already done everything you've suggested in your above post. I shouldn't have to change build.prop (apart from the Paranoid Android entries of course), because the build.prop should still be the same one from my BASE ROM. The same goes for the updater script, but once again I did enter the PA specific entries.

I am porting Paranoid Android v2.51 from the saga and using Andromadus CM10 build 132 as my base (I know Flinny said not to use test builds as bases for ports, but I wasn't planning on releasing this. I'll probably do one based on Jelly Belly if I can sort these problems out).
[G2 and Desire Z Android Development] lms24:
Did you also change the bool value in framework-res as suggested above ? I'll take a look at android.policy.jar tomorrow....
[G2 and Desire Z Android Development] HTCDreamOn:
Oddly it was already set to false. Thanks for your help :) I'll try to contribute where I can.
[G2 and Desire Z Android Development] ajhavery:
I guess the problem is with your base rom. Since flinny test builds are in .odex format hence tweaks apps are not able to modify it, hence you might be having the force closes.

Try with jellybelly beta and I hope it'll work.
[G2 and Desire Z Android Development] HTCDreamOn:
Tried with Jelly Belly, problems remain :(

Tried with Jelly Belly, I have the exact same problems. BTW I didn't say I get FCs, it's just PA Settings won't stick. You pick a setting, it asks to reboot, and once you have, nothing's changed.

Even if you guys can help me with the keyboard, I haven't a clue how I'll get PA Settings to work. The best thing would be if someone built PA from source... that'd be fantastic, unfortunately I have no experience in Android development whatsoever.
[G2 and Desire Z Android Development] ajhavery:
If paranoid is not working then you may try using PACMAN, it has got all paranoid, aokp and cyanogen goodies.

blindnumb already has made a port of it in desire hd forums, you can port it from there.

I personally am a great fan of sense roms, so I don't get my hands on aosp based roms. Sense has got all features which android will have in coming years. And about google now, I don't use it so sense is best for me.

The only problem is it lags a lot, so my approach has always been to make sense smooth on our phone in which I haven't succeed yet, but I'm trying.
[G2 and Desire Z Android Development] HTCDreamOn:
I'll try PACMAN when I have time, I thought it would be harder at first (more features, more sources, more troubleshooting!) but maybe it's counter- intuitive, and it will work better. Someone said they tried, and had the same problems though, but I might as well try.
[G2 and Desire Z Android Development] rirozizo:
be careful though... it is a JB with loads of stuff, including project butter which the devs found it very hard to deal with.

———————————————————

^ this bar means i'm using my phone :)
[G2 and Desire Z Android Development] Steven How:
other link?

http://elektro-instal.com/napior/3.5 port tools.zip is down :(
[G2 and Desire Z Android Development] ajhavery:
Here are the vision files:

http://d-h.st/OEv

If you want to dig further deep, here is the ultimate vision port package:

http://www.androidfilehost.com/?fid=9390345248346997154
[G2 and Desire Z Android Development] xT4Z1N4TRx:
Why do your holidays start so early, mine starts on bloody june 22nd :'(

I was going to make a sense/ics port guide for you guys, I'll see if I get any time
[G2 and Desire Z Android Development] Cid-Vox:
Hey guys I am already working on a port and I am pretty close. I used CM9 Beta as base and so far nearly everything seems to work. The biggest problem at the moment is that I can't mount the sd card with my PC but adb is working fine.

As well I am sure there are some minor errors to fix from the logcat -> any suggestions how to find the smalis to investigate?
[G2 and Desire Z Android Development] ajhavery:
using audacity b2 as base seems to be a problem however cm9 beta seems to work as posted in the thread. Use it as base.

Finding correct libandroid.runtime.so for audacity base seems to be very big problem, so instead use cm 9 as a base.

@Cid-Vox : Which libandroid.runtime.so you have used to boot in your port??
[G2 and Desire Z Android Development] jspina:
Is this something that you will be working on and releasing? Or is it just for yourself?

Ok I will work on that tomorrow(going to bed now) unless Cid-Vox will be working on it.
[G2 and Desire Z Android Development] magic_android:
omg i just spent ages getting all the way to the end of the guide using audacity beta 2 as a base, *sigh*, looks like i have to start again now lol.
[G2 and Desire Z Android Development] Cid-Vox:
at the moment I use the CM9 one but I will try to make the MIUI one work as well (just need time :D )

Maybe I will try a Andromadus B2 port as well

to make it work I used quite a lot smali files from the CM9 framework.jar

I will share my work, hopefully its a stable release :-)
[G2 and Desire Z Android Development] ajhavery:
You don't need to swap files in framework.jar if you find a rom which is booting with base or port libandroid.runtime.so.

Rest of the steps still apply so your work won't go in vain.
[G2 and Desire Z Android Development] magic_android:
Well, after a few hours of work tonight, i didn't manage to get it to boot haha. I'm too tired to try and get it to work now so i'll try again later. The guide is awesome though and i probably just messed up something between decompiling and compiling stuff again.
[G2 and Desire Z Android Development] evilcuber:
PLEASE DOOOO :D i want to port a sense 4 rom :S also my vacation dosent start till 22nd too here in canada :(
[G2 and Desire Z Android Development] ajhavery:
Use this guide to port sense 3.5 and sense 4.0.

This is intended for desire S but will equally do for Desire Z.

Instead of using a RUU, I would recommend you try porting :

Cooldroid 3.0

Primo-S 3.4

Take the libs and files which you need for our device from mine or from Taz's rom.
[G2 and Desire Z Android Development] ajhavery:
OP Updated with new guides.
[G2 and Desire Z Android Development] lms24:
Thank you for the Sense 4 guide.

I've been working on my own sense 4 port (dircetly from One V) and most things seem to work but I can't get the hw keyboard blacklights working. I guess this has to do something with Android.policy.jar but as I'm a noob when it comes to smali editing I don't know what I have to do. Do you have any ideas?
[G2 and Desire Z Android Development] ajhavery:
Copy hardware files:

/hw/lights.vision.so and edit values in framework-res.apk as written in the first post for MIUI.

But instead of MIUI values, use values from a working sense 3.5 rom framework-res.apk.
[G2 and Desire Z Android Development] ablivian:
I've tried a lot today:)

My miui rom to port to Desire-z was: http://xdaforums.com/showthread.php?t=1512565 (2.4.20)

First I followed the whole guide step by step with audacity beta2.

But it hang on the splashscreen.

download: http://www.mediafire.com/?3ce4n3nb9bf7bax

After that I tried it with CyanogenMod 9.0.0-RC0 BETA [Unofficial]

I used the miui libandroid_runtime.so

It hang on the bootanimation

http://www.mediafire.com/?gigl8t2bi06b4il

At last I tried it with CyanogenMod 9.0.0-RC0 BETA [Unofficial]

and I used the original libandroid_runtime.so

It hang on the splashscreen

http://www.mediafire.com/download.php?cq5m8rjd3xm333z

If anybody can help me? all help is welcome:)
[G2 and Desire Z Android Development] ajhavery:
pm @Cid-Vox , he just posted a MIUI rom:

http://xdaforums.com/showthread.php?t=1613313
[G2 and Desire Z Android Development] jspina:
Ok so I tried to port IceColdSandwich with cm9 as a base and besides for having to also change the paint file in the framework file as well as powermanager I came across this in my logcat.

E/HTC Acoustic( 2765): failed to open A2051 CSV files /system/etc/TPA2051_CFG.cs

v.

I/AudioHardwareMSM7X30( 2765): Speaker amplifies tpa2051 is not supported

D/HTC Acoustic( 2765): int android::support_codec_aic3254(), support_aic3254: 0

I/AudioHardwareMSM7X30( 2765): AIC3254 DSP is not supported

D/HTC Acoustic( 2765): int android::support_back_mic(), support_back_mic: 0

I/AudioHardwareMSM7X30( 2765): HTC DualMic is not supported

does anyone have any idea as to where that file is in system etc? or have any ideas?
[G2 and Desire Z Android Development] Cid-Vox:
@jspina: I think this is no Vision file have a look at this post:

http://xdaforums.com/showthread.php?t=1389756
[G2 and Desire Z Android Development] jspina:
OK thanks. I just dont know what to do now because I looked and neither rom I am using for this has that file...
[G2 and Desire Z Android Development] ajhavery:
Ok dude, try this :

extract icecold sandwich content with kitchen.

Now swap these files :

Overwrite /system/etc with that from cm9 one

now look for files which are not in cm9 and add them manually from Icecold sandwich.

Swap /system/bin from cm9 one

Swap /system/lib

swap boot.img

swap /system/usr

chnage the following lines in build.prop:

ro.product.model=

ro.product.brand=

ro.product.name=

ro.product.device=

ro.product.board=

ro.product.cpu.abi=

ro.product.cpu.abi2=

ro.product.manufacturer=

ro.product.locale.language=

wifi.interface=

debug.sf.hw=1 (ALWAYS =1)

windowsmgr.max_events_per_sec=

with vision one.

In init.d folder delete all files except sysctl and 00banner...

Ask cid-vox how he got the rom to boot. Use correct libandroid.runtime.so and maybe you'll not get into problem.
[G2 and Desire Z Android Development] Cid-Vox:
I tried to use the file from the link (SoundBoostForGB&ICS.zip). I doubt that it has any effect but it should fix the error in the logcat.
[G2 and Desire Z Android Development] jspina:
OK (ran out of thanks, so thanks) I will try that right now.
[G2 and Desire Z Android Development] Cid-Vox:
If you are stuck at the bootanimation have a look at the logcat.

I used ddms and filtered the log for errors.

There you will find errors that show you a path and this path you should find in the framework.jar (eg android\view\GLES20Canvas-> GLES20Canvas.smali)

This might take some time to figure out what files to swap from CM9 to the port ROM but every file is one step closer to a successfull booting port.

ajhavery already mentioned the following files in the OP: Power.smali, Paint.smali, MediaRecorder.smali, GLES20Canvas.smali
[G2 and Desire Z Android Development] jspina:
Thank you very much. I am on it right now. It did not boot up yet but it is because I didnt port over the /etc files yet and I had to change a line in the updater-script that wouldnt let me install it.

I will let you guys know if it boots or not. And thanks again!
[G2 and Desire Z Android Development] magic_android:
This might be a very noob question but what is the point of step 11 in porting MIUI? Is it necessary for the ROM to work? What does it mean for the ROM to be signed?
[G2 and Desire Z Android Development] Cid-Vox:
ah a thing that I missed out for my MIUI ROM but this shouldn't be a problam as long as your s-off
[G2 and Desire Z Android Development] magic_android:
Ah ok, i tried porting MIUI using CM9 as a base again tonight and i couldn't get past the HTC boot screen. I'm gonna start over again tomorrow with a new ROM to port and see how i go. I also tried to save the error report from ddms but i only found out after i restored CM7 again that the log that it saved was completely blank >.<.

In the actual logcat (during the first boot), it didn't say anything about errors anywhere though. I don't know if that's because i don't know what an error looks like in logcat, or because there weren't any errors though.
[G2 and Desire Z Android Development] jspina:
You would have to use the base libandroid_runtime.so file to get past the htc screen. But I think that would just get you to the bootanimation.

---------- Post added at 05:08 AM ---------- Previous post was at 04:35 AM ----------

AHHHH!!! Got it booting! But... software keyboard doesnt work. Also it is SUPER fast!

I will start working on the rest tomorrow. Hopefully I can remember what I did. :rolleyes:

I just have to write in how much I really appreciate all of the help! You guys basically did it all for me:)
[G2 and Desire Z Android Development] ajhavery:
You must have edited wrong lines in android.policy.jar , Use the base file and edit correct lines and you'll get the keyboard to work.

Also those using cm9 as base, please use the file attached and report if they see any improvement with camera.

Again it is not flashable, it's a zip file with correct directory structure.

If you once find yourself successful with cm9 as base, try with the next audacity as base.

You might be successful and the Andromadus team improvements will be there.
[G2 and Desire Z Android Development] xT4Z1N4TRx:
Someone make a doubleshot port with this;) or shall i do it arr
[G2 and Desire Z Android Development] ajhavery:
Untill sense 4.0 is fully functional, I think sense 3.0 is good because sense 3.5 doesn't runs so smooth irrespective of every mod possible.

But instead of double shot, if you go for Desire HD port, then you could have lyapota mods available for you like beats, quick settings, camera etc.

But I would appreciate all the effort you put in any port of yours. :)
[G2 and Desire Z Android Development] xT4Z1N4TRx:
True, but the doubleshot port was so fast, probably the fastest sense rom I've used
[G2 and Desire Z Android Development] ajhavery:
yes, you are right and doubleshot really looks good (i just browsed through forums), maybe you can use some mods from evilD thread.

go for it bro...:)
[G2 and Desire Z Android Development] austrie:
Is it possible to use CM9 as base(the folder which you put the new files in) instead of Sense as a base when port Sense 4.0?
[G2 and Desire Z Android Development] bradley_e_smith:
Doubleshot has the 5 button rosie, which IMHO is much better than the 3 button rosies on typical Sense ROMS. If the doubleshot supported swap (to run faster) plus other speed ups it would be great. Doubleshot as it sits lags way to much to be a DD.
[G2 and Desire Z Android Development] ajhavery:
Not completely, but you can use cm kernel, for that you need to decompile boot.img.

This can easily be done with dsixda kitchen. Then you need to decompile a working kernel, for example decompile virtuous sense kernel and decompile it to grab the ramdisk.

Now put this ramdisk with the zImage of cm kernel and then compile it to get a boot.img with cm kernel.

You have 3 options to choose from:

Tiamat kernel zImage

Andromadus kernel zImage

Cm9 RC0 zImage

This can't be guaranteed that it'll work but proxuser has used lordclockan's kernel in desire hd forums in this way.

You can also use keychars and keylayouts from cm rom and use it.

But you can't just use all libs and other stuff from cm. You can experiment and they might work but you can't be sure that it'll work.
[G2 and Desire Z Android Development] ajhavery:
Swap is kernel depndent, so you can get swap to work with unity kernel.
[G2 and Desire Z Android Development] ajhavery:
Guide as sticky

Guys,

Please ask the forum moderators to put this guide as a sticky in the development forum as it will be helpful to you at any point of time when you need it.
[G2 and Desire Z Android Development] masterismos:
DONE :)
[G2 and Desire Z Android Development] ajhavery:
Guide Updated

Added alternative way to port icecoldsandwich, can be used for LewaOS and AOKP too.

Added credits.
[G2 and Desire Z Android Development] ajhavery:
I'm not sure but it might be due to wrong editing of either android.policy.jar or framework.jar.

Tomorrow is my last exam, till then try to re edit those files and try again and in the meantime, try asking dekky, he is very helpful.

Tomorrow, i'll dig into this and will try to get you some solution if you are not able to get any.
[G2 and Desire Z Android Development] jspina:
Good luck on those exams!!! Ace 'em!