yashsingh1/xdaforums huggingface dataset:
[Android Software Development] fedevd:
[MENTION=3141383]ZduneX25[/MENTION] Yeps, I know and i'm using the entire framework and apps folder from MIUI so if any method of MiuiFramework.apk calls any line of framework2.jar then it should be there, not missing..
[Android Software Development] Tyrany:
what version of miui? try using the first leak, this is only a wild guess, but it could be a problem with the current version of miui =S, since all the files are present it shouldn't have problems reading them
[Android Software Development] Tyrany:
Thanks for the tip log is starting to look like something, i can see sensors firing up now, i've merged the files you mentioned, (i've picked all the camera and lcamera smalis from base into port rom but havent merged them yet, its time to go work =S,) Can you please help me on this one =S, i'm being a pita i know but you guys are like my porting masters hehehe

E/AndroidRuntime( 806): *** FATAL EXCEPTION IN SYSTEM PROCESS: ActivityManager

E/AndroidRuntime( 806): java.lang.NoClassDefFoundError: miui.os.FileUtils

E/AndroidRuntime( 806):	at com.android.server.am.ExtraActivityManagerService.init(ExtraActivityManagerService.java:143)

E/AndroidRuntime( 806):	at com.android.server.am.ActivityManagerService.<init>(ActivityManagerService.java:1993)

E/AndroidRuntime( 806):	at com.android.server.am.ActivityManagerService.<init>(ActivityManagerService.java:210)

E/AndroidRuntime( 806):	at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1866)

E/AndroidRuntime( 806): Error reporting crash

E/AndroidRuntime( 806): java.lang.NullPointerException

E/AndroidRuntime( 806):	at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:84)

E/AndroidRuntime( 806):	at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)

E/AndroidRuntime( 806):	at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
[Android Software Development] Notorious:
Wait did you compare your bootclasspath with the v6 in the boot.IMG and add the differences? That could explain why it can't find certain smali
[Android Software Development] fedevd:
Did you patched your framework? Can you share it or share 'AssetManager.smali'? I can't fix it yet..
[Android Software Development] Tyrany:
I've found what u mentioned in bootclasspath it was missing all the miui frameworks ( noob error), should i replace all the framework/hardware libs ? Or since they are not throwing errors let them stay

?
[Android Software Development] Notorious:
Framework/ hardware libs?
[Android Software Development] datagutt:
It worries me that i don't run into ANY of the issues you guys do. I have been pretty close to booting (i can see a "blablalbla has crashed" dialog for a split second before it reboots). I simply use MIUI + Omni base.

I have some really hard-to-fix errors that prevents me from getting past the instant reboot problem though... Seems MIUI modified dex and dalvik-related libraries and binaries, and this prevents the system from correctly loading the framework (even though you guys get missing methods errors, this doesn't mean everything loads correctly).
[Android Software Development] fedevd:
Hmm, can you tell me which libs did you used/replaced from MIUI? I'm starting all over again with Omni trying to find where did I messed up..
[Android Software Development] Notorious:
I'm gonna guess these and whatever New libs v6 introduced

https://github.com/MiCode/patchrom_miui/tree/kitkat/XHDPI/system/lib
[Android Software Development] Notorious:
[MENTION=3141383]ZduneX25[/MENTION] have you ever thought of making your own guide for patchrom? You seem to be the only one that has the knowledge on building with it for unsupported devices. The guides I see all assume the device you're trying to build for is officially supported
[Android Software Development] ZduneX25:
I never found patchrom hard to use. When I was starting the only known guide was the one provided with the code: https://github.com/MiCode/patchrom and it was miui v4.

I did not even have optimus l9 and I was able to build the most bugsfree (users opionon) custom rom for this device. I will always choose potchrom over manual porting, but for me whole patchrom seems so simple.

I would rather answer questions I guess.
[Android Software Development] Notorious:
Okay I'll let you know if I have any problems just reinstalled Ubuntu and am repo syncing KitKat branch now
[Android Software Development] fedevd:
Was PatchROM updated to MIUI v6?
[Android Software Development] Notorious:
No v6 is still in closed beta patchrom will not be updated until v6 finishes close beta testing and when Xiaomi decides to update patchrom. I'm going to try patchrom for KitKat MIUI v5
[Android Software Development] Tyrany:
Sorry man i was too sleepy what i mean was the libs inside the decompiled framework inside the hardware folder =S :silly:
[Android Software Development] Notorious:
Do you mean smali and not libs?
[Android Software Development] Tyrany:
i must have brain damage, two times i post and two times i write the same error, its smalis i mean =S

That post from datagut is worrying me, he knows more and its giving him problems =(, for me that i'm still learning even worse...
[Android Software Development] Notorious:
I would just add the camera.smali* tree to the framework/hardware and yea datagutt is a good porter so seeing him struggle brings realization to some
[Android Software Development] Slimegod:
Getting this error in patchrom:

"[481,4] All register args must fit in 4bits

[507,4] All register args must fit in 4bits

[510,4] mismatched tree node: I_STATEMENT_FORMAT22x expecting I_CATCHES". Got this in my framework.jar build out. How do I fix that? Also those numbers in those brackets are they where the lines in the smali's are?
[Android Software Development] ZduneX25:
[MENTION=4229751]Notorious[/MENTION] revert latest commit on patchrom_tools i left my comment there

[MENTION=3794018]shakim24[/MENTION] Log has to be specyfic and for me it always throws direct smali file, but I can tell you it's about your rejects you megred them wrong. Saying wrong i mean you cannot just copy and pase code from rej file bacause most of the time your base uses different v and p (numbers/levels).
[Android Software Development] Slimegod:
That's exactly what I did to. All my other jars were fine. This is my last jar build. Also I noticed a lot of the times there are more rejects then originally shown. I would click on say reject/service.jar and search smali and like 4 rejects would be there. They were minor but still. Have no idea where this error is either. Have to dig for it.
[Android Software Development] ZduneX25:
You dig in smali files you have merged rejects with.
[Android Software Development] Notorious:
Will do! I had to start over I made partition to small and have now gotten into a huge mess with my partitions trying to resize them[emoji52]
[Android Software Development] Tyrany:
Is there a way to set patchrom on cygwin?

Do anybody knows the location of miui.so.fileutils?
[Android Software Development] Slimegod:
Good to see you have a change of heart to learn patchrom. What made you change your mind :cool:
[Android Software Development] Notorious:
[MENTION=3531145]fedevd[/MENTION] I made my stockrom.zip but am confused on makefile Im supposed to modify or am I supposed to create a makefile in patchrom/jewel(this is where my stockrom.zip and metadata and out) and modify accordingly?

Nvm pretty sure I have to make a makefile in same folder where my stockrom.zip is
[Android Software Development] Notorious:
Already made makefile using Zdunex25s makefile for I9300 as a template. Just had to remove some specific things like Galaxys3settinge and change name to MIUI_jewel.zip. Just did make first patch and now looks like more work
[Android Software Development] fedevd:
I'm stuck on 'local-miui-modified-apps' when I exec 'make fullota'.. Missing every app defined in that value..

/home/federico/patchrom/tools/apktool --quiet d -t miui -f /home/federico/patchrom/miui/XHDPI/system/app/AntiSpam.apk out/AntiSpam
/home/federico/patchrom/tools/patch_miui_app.sh >/dev/null AntiSpam out/AntiSpam
find: «AntiSpam»: No such file or directory
>>> build out/AntiSpam.apk...
cp: can not 'stat' on «AntiSpam»: No such file or directory
make: *** [out/AntiSpam.apk] Error 1
federico@Aspire-Z3761:~/patchrom/mako$
[Android Software Development] Slimegod:
Have a line that is "move-reject v0, v1". Get a mismatch input 'move-reject' expecting COMMA. What is that from?
[Android Software Development] lbxmobbin_1:
[MENTION=3141383]ZduneX25[/MENTION] Was wondering if you can help I've done some work with patchrom but trying now with 4.4.4 miui and get an error when building

#for call ./customize_framework-res.sh

Invalid resource directory name: out/framework-res/res/xml-mcc310-mnc-1

If you can help let me know thanks
[Android Software Development] Slimegod:
Just delete that xml in framework-res, shouldn't get that error anymore. Had that same error.
[Android Software Development] lbxmobbin_1:
I did that but then I get

Out/framework-res/red/values/public.XML:5228: error: Public symbol drawable/notification_BG declared here is not defined.
[Android Software Development] Slimegod:
Never ran into that error dude. Does it give you a line?
[Android Software Development] lbxmobbin_1:
Nope I don't get a line just what I wrote on their
[Android Software Development] Slimegod:
Dam, yeah Z might know more about that or anyone who ran into a error like that. What did you use as your base?
[Android Software Development] lbxmobbin_1:
I used cm 4.4.4 nightly build
[Android Software Development] Slimegod:
ASOP is better. Less rejects. Might not help your situation but I'm just saying.
[Android Software Development] lbxmobbin_1:
I will try with that see if any difference if not then I'll see if I can find the issues
[Android Software Development] Slimegod:
You'll see the difference. Sorry I couldn't dude.
[Android Software Development] Notorious:
I found this helpful it might help some of you understand rejects like it did me http://xdaforums.com/showpost.php?p=25713236&postcount=171
[Android Software Development] fedevd:
I was able to compile with some nasty tricks and poor makefile but didn't boot.. I'm still testing some 'makefiles' templates but that file still being complicated with really really poor documentation..
[Android Software Development] Notorious:
I don't know if this means anything but I don't have a framework-res folder in my rejects folder. I have all the other frameworks decompiled in there after doing make firstpatch. Does that mean something went wrong during the make firstpatch command in the terminal? Should I type the command again?

---------- Post added at 10:12 PM ---------- Previous post was at 10:10 PM ----------

What did your logcat say?
[Android Software Development] fedevd:
Nothing, didn't started adb service because it was a dirty zip file too.. The fullota.zip built from PatchROM didn't flashed, updater-script issues..
[Android Software Development] Notorious:
Nvm
[Android Software Development] ZduneX25:
I just woke up, gonna take a.shower and I will tell you everything.

No needs for framework-res, there is no smali in this apk.

Which bases are you using seems you resolved your rejects quick and IMO reject are hardest part of porting with patchrom.

EDIT: [MENTION=3531145]fedevd[/MENTION]

local-modified-apps - you type here any app from stockrom that you wanna edit, you can leave it empty

local-modified-priv-apps - it's for kitkat and means the same

local-modified-jars - leave this empty

local-miui-removed-apps - apps that you wanna remove from miui like 100% chinese stuff

local-miui-removed-priv-apps - for kitkat and means the same (but to be honest there is nothing to remove so leave empty)

local-miui-modified-apps 0 any miui app that you wanna edit, since i add my native langiage to whole system, i had to type every single app

local-remove-apps - apps that you need to remove from base, like google launcher, aosp systemui, google gallery

local-pre-zip-misc - you can put anything to prepare future fixes

for example:

cp other/apns-conf.xml $(ZIP_DIR)/system/etc/apns-conf.xml - miui has only few chinese apns so i prepared my own list and script simply copy my file while porting

cp other/boot.img $(ZIP_DIR)/boot.img - miui needs changes in ramdisk, so i also created patched kernel and used this command to force use my kernel

cp -f other/libsqlite.so $(ZIP_DIR)/system/lib/libsqlite.so - this fixes gsm in kitkat ports and i took libsqlite.so from miui for nexus 5

about build error simply add such image to drawable

every single entry from 'local-miui-modified-apps' has to exist in https://github.com/zdunex25/patchrom_m0/blob/kitkat/customize_miui_app.sh as well and you need a dir in your device directory like AntiSpam etc. I am using mkdir to create all empty dirs (empty because all i add is Polish language) https://github.com/zdunex25/patchrom_m0/blob/kitkat/build_miui.sh#L6

Use my github as template: https://github.com/zdunex25?tab=repositories you will find files for 4.1, 4.2 and 4.4 and I wrote build_miui.sh to do things that patchrom cannot do itself.

[MENTION=4229751]Notorious[/MENTION] official patchrom guide translated from chinese: http://en.miui.com/thread-9630-1-1.html
[Android Software Development] Slimegod:
The "mismatch move-reject expecting COMMA"error I'm getting what is that derived from? You give a real detailed understanding about patchrom. Like I didn't know it's so much more modifications needed to be done. There are a few templates you mentioned that's needed. Your customize_framework.sh and build_miui.sh where do they go under makefile?

Edit: Looking at your makefile pretty much answers my question. What does your customize_framework.sh modify in framework?
[Android Software Development] Notorious:
Need full log
[Android Software Development] Tyrany:
its here, i noticed i've put the wrong path file framework-miui-res.apk on bootclasspath, and for some reason cloud-common.jar isnt detected by a lot of apps (the file is present on rom files), but that crapp of permissions and stuff i cant really figure why
[Android Software Development] fedevd:
That helps a lot, thanks mate!! I added ic_lockscreen_xx.png into drawable folder and that gave me bad xml output.. Was compiled without that file and removed from the xml.. Tomorrow I will start again from scratch and find where did I messed up, for sure my makefile have some errors.. My build size is 600+ mb so gotta start all again..

Anyway, will be better if we make a general makefile, can be done 'cus every device have, in bases, same apps.. Maybe create a script to detect which apps have the rom and automatically remove the not needed ones and, at least the common apps..

I vote +1 for [MENTION=3141383]ZduneX25[/MENTION] guide for PatchROM or we can create a new updated thread for PatchROM and stop flooding this 'how to port' thread.. If he do not wanna make it then I can be the maintainer but WE NEED an updated guide or create some documentation about it..
[Android Software Development] ZduneX25:
Go for it, it would be time consuming guide to write I will correct your content, open dev thread and add me so I can edit it as well.

Just one more handy tips:

- i never pull my stockrom from device (waste of time), whole ota target from phone thing is all about creating metadata directory which contains apk sing keyes, permissions and partitions for updater-script, so if you wanna skip this step just take my metadata from any project and adjust apkcerts.txt (log will throw what needs to be add after make fullota), then use your stockrom updater-script https://github.com/zdunex25/patchrom_m0/blob/kitkat/build_miui.sh#L29 (you just need to update your file with shelld and su permissions: https://github.com/zdunex25/patchrom_m0/blob/kitkat/other/updater-script-rom#L168) and finally rename your rom to stockrom.zip and place in your device directory, now you can go for make workspare, make fullota and resolve rejects
[Android Software Development] Notorious:
Okay is there a reason the rejects dont match the regular smali at all? Like the lines rejects have do not match what so ever. I understand the values might be different but some don't exist at all

Specifically phonewindowmanager$21.smali and its reject
[Android Software Development] fedevd:
I will create it then.. I pull my stockrom 'cus in my case is pure AOSP (Nexus 4), I don't have a zip file here of stock AOSP for Nexus 4, just 'img' files so I create the stockrom zip file to be sure that is pure stock AOSP.. Beside that, I can build with some rejects but everything compiles, the main problem is the 'makefile' zip so tonight I will take a look, make some changes and prepare a thread for PatchROM.. Anyway, will be better if you and [MENTION=4229751]Notorious[/MENTION] send me via PM a Hangouts contact and prepare a thread with you guys..
[Android Software Development] ZduneX25:
[MENTION=4229751]Notorious[/MENTION] patchrom does not really compare your stockrom code during firstpatch it compares code from patchrom_android (miui and aosp code), the more your base is different from aosp the more rejects you get, and if you mean phonewindowmanager$21.smali and phonewindowmanager$21$1.smali then just find phonewindowmanager$number$1.smali for me it's 18 and your reject will fit that file, i am willing to show you how to merge such rejects through teamviewer it's really easy and anyone else would be free to join if Notorious would agree to share his desktop of course

---------- Post added at 04:50 PM ---------- Previous post was at 04:49 PM ----------

[MENTION=3531145]fedevd[/MENTION] you have to deodex it once you get it
[Android Software Development] Notorious:
Yes I have no problem sharing in order to show a demonstration to others.
[Android Software Development] ZduneX25:
Ok so it's 5pm at my place now and I should be free 6-7:30pm for the next 3 evenings. If you wanna my hangouts email me: http://xdaforums.com/sendmessage.php?do=mailmember&u=3141383
[Android Software Development] Notorious:
Okay i should be available since its 10am here so i should be available hopefully nothing comes up in the mornings
[Android Software Development] Slimegod:
Yeah it's 11:40am here in NYC for me and I work and I'm pretty sure others will like to get in on it to who's schedules won't allow them to. Any way you'll be open to doing it for others as well who's interested when your free in the future?
[Android Software Development] Tyrany:
[MENTION=4229751]Notorious[/MENTION], i've found some missing libs, and removed framework-miui-res.apk from bootclass path, now the log its a little cleaner ;)

is framework-miui-res.apk necessary on bootclass or not?

[MENTION=4229751]Notorious[/MENTION];@ZduneX25;@shakim24 can you guys give some piece of advice on this logcat please?

Ps. sorry for being a pain in the ass =S
[Android Software Development] fedevd:
ActivityManager derped and yes, you will need framework-miui-res.apk 'cus is part of the framework.. Is a port or source build?
[Android Software Development] Notorious:
I/dalvikvm( 5839): Could not find method miui.os.FileUtils.mkdirs, referenced from method com.android.server.am.ExtraActivityManagerService.init

And you have to compare your bootclaaspath with MIUI v6 bootclasspath and add it if mi3 has it. I don't have MIUI v6 and have never looked at it so all I can say is go off the bootclasspath
[Android Software Development] Slimegod:
You not being a ass, you just trying to learn. Only way you learn is by asking questions. Everybody started where you are so it's really nothing wrong with asking. Commend you though for trying to port v6 to the Nexus device.
[Android Software Development] Notorious:
43 rejects total 8 done so far I'm on a role [emoji1] [emoji41]
[Android Software Development] Tyrany:
im tying to port miui 6

[MENTION=4229751]Notorious[/MENTION] This is the miui bootclasspath, in red not present even in the original miui rom, in blue is the one i think corresponds to framework-miui-res.apk,

export BOOTCLASSPATH /system/framework/core.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/webviewchromium.jar:/system/framework/qcmediaplayer.jar:/system/framework/WfdCommon.jar:/system/framework/oem-services.jar:/system/framework/org.codeaurora.Performance.jar[COLOR="Red"]:/system/framework/qcom.fmradio.jar[/COLOR]:/system/framework/security-bridge.jar:/system/framework/qsb-port.jar:/system/framework/vcard.jar:[COLOR="red"]/data/app/com.miui.sdk-1.apk:/data/app/com.miui.sdk-2.apk:[/COLOR]/system/app/miui.apk[COLOR="red"]:/data/app/com.miui.framework-1.apk:/data/app/com.miui.framework-2.apk[/COLOR][COLOR="blue"]:/system/app/MiuiFramework.apk[/COLOR]

But when i add framework-miui-res to bootclasspath it gives this error:

I/dalvikvm( 962): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory

D/dalvikvm( 962): Unable to process classpath element '/system/framework/framework-miui-res.apk

I've run the kitchen just to make sure and deodex all the rom but kitchen reports rom already deodexed

miui.os.FileUtils:I cant figure this out ive extracted original rom frameworks and crap and i dont find this sh*t

only found .class public Landroid/os/FileUtils; do any of th older miui roms have this file?
[Android Software Development] ZduneX25:
[MENTION=4264999]Tyrany[/MENTION] there is no framework-miui-res in v6 replace it with framework-ext-res and com.miui.sdk is miui.apk in /system/app, i told probably to you (since only you work on v6) long time ago v6 has more frameworks and i just found your missing class in 3 seconds in miuiframework...
[Android Software Development] Tyrany:
what version of v6 did you look? on 4.8.16 it is called framework-miui-res =S pi didnt think of updating miui base

the miui.os.fileutils one? Where is located? i got is android.os.fileutils
[Android Software Development] ZduneX25:
Your BOOTCLASSPATH is just the same as mine from 4.8.25 build. Well you should be able to find everything from miuiframework.apk in framework2.jar (if it comes to first build).