[P8lite Android Development] XTutorials:
UPDATE:

andrei@Andrei-HP-EliteBook:~/patchrom/device$ make workspace

>>> Install vendor resources for apktool...

unzip >/dev/null stockrom.zip "system/framework/*.apk" -d out

install out/system/framework/framework-res.apk

install out/system/framework/org.cyanogenmod.platform-res.apk

unzip >/dev/null stockrom.zip system/framework/framework.jar -d out

/home/andrei/patchrom/tools/apktool --quiet d -f out/system/framework/framework.jar -o framework.jar.out

unzip >/dev/null stockrom.zip system/framework/services.jar -d out

/home/andrei/patchrom/tools/apktool --quiet d -f out/system/framework/services.jar -o services.jar.out

unzip >/dev/null stockrom.zip system/framework/telephony-common.jar -d out

/home/andrei/patchrom/tools/apktool --quiet d -f out/system/framework/telephony-common.jar -o telephony-common.jar.out

unzip >/dev/null stockrom.zip system/framework/wifi-service.jar -d out

/home/andrei/patchrom/tools/apktool --quiet d -f out/system/framework/wifi-service.jar -o wifi-service.jar.out

Prepare workspace completed!

andrei@Andrei-HP-EliteBook:~/patchrom/device$

Have made some progress. Let's hope I don't get many rejects, I am using my AOKP as "stockrom.zip"

UPDATE 2:

andrei@Andrei-HP-EliteBook:~/patchrom/device$ make firstpatch

/home/andrei/patchrom/tools/patch_miui_framework.sh /home/andrei/patchrom/android/base-framework /home/andrei/patchrom/android/primary-patch `pwd`

<<< create temp directory to store the old, new source and destination smali code with .line removed

<<< compute the difference between /home/andrei/patchrom/device/temp/old_smali/telephony-common.jar.out and /home/andrei/patchrom/device/temp/new_smali/telephony-common.jar.out

<<< apply the patch into the /home/andrei/patchrom/device/telephony-common.jar.out

<<< compute the difference between /home/andrei/patchrom/device/temp/old_smali/wifi-service.jar.out and /home/andrei/patchrom/device/temp/new_smali/wifi-service.jar.out

<<< apply the patch into the /home/andrei/patchrom/device/wifi-service.jar.out

<<< compute the difference between /home/andrei/patchrom/device/temp/old_smali/framework.jar.out and /home/andrei/patchrom/device/temp/new_smali/framework.jar.out

<<< apply the patch into the /home/andrei/patchrom/device/framework.jar.out

patching file /home/andrei/patchrom/device/framework.jar.out/./smali/com/android/internal/os/ZygoteInit.smali

Hunk #1 succeeded at 348 (offset 1 line).

patching file /home/andrei/patchrom/device/framework.jar.out/./smali/android/content/res/Resources.smali

Hunk #1 succeeded at 238 (offset 23 lines).

Hunk #2 succeeded at 880 (offset 29 lines).

Hunk #3 FAILED at 4527.

1 out of 3 hunks FAILED -- saving rejects to file /home/andrei/patchrom/device/temp/reject/framework.jar.out/./smali/android/content/res/Resources.smali.rej

patching file /home/andrei/patchrom/device/framework.jar.out/./smali/android/content/pm/PackageParser.smali

Hunk #1 FAILED at 9660.

Hunk #2 succeeded at 10335 with fuzz 2 (offset 663 lines).

1 out of 2 hunks FAILED -- saving rejects to file /home/andrei/patchrom/device/temp/reject/framework.jar.out/./smali/android/content/pm/PackageParser.smali.rej

patching file /home/andrei/patchrom/device/framework.jar.out/./smali/android/graphics/Bitmap.smali

Hunk #1 succeeded at 43 (offset 2 lines).

patching file /home/andrei/patchrom/device/framework.jar.out/./smali/android/app/SystemServiceRegistry.smali

Hunk #1 succeeded at 834 (offset 84 lines).

patching file /home/andrei/patchrom/device/framework.jar.out/./smali/android/app/ResourcesManager.smali

Hunk #1 FAILED at 986.

1 out of 1 hunk FAILED -- saving rejects to file /home/andrei/patchrom/device/temp/reject/framework.jar.out/./smali/android/app/ResourcesManager.smali.rej

<<< compute the difference between /home/andrei/patchrom/device/temp/old_smali/services.jar.out and /home/andrei/patchrom/device/temp/new_smali/services.jar.out

<<< apply the patch into the /home/andrei/patchrom/device/services.jar.out

patching file /home/andrei/patchrom/device/services.jar.out/./smali/com/android/server/policy/PhoneWindowManager.smali

Hunk #1 succeeded at 581 (offset 118 lines).

patching file /home/andrei/patchrom/device/services.jar.out/./smali/com/android/server/power/ShutdownThread.smali

Hunk #1 FAILED at 312.

1 out of 1 hunk FAILED -- saving rejects to file /home/andrei/patchrom/device/temp/reject/services.jar.out/./smali/com/android/server/power/ShutdownThread.smali.rej

patching file /home/andrei/patchrom/device/services.jar.out/./smali/com/android/server/am/ActivityStack.smali

Hunk #1 FAILED at 6636.

1 out of 1 hunk FAILED -- saving rejects to file /home/andrei/patchrom/device/temp/reject/services.jar.out/./smali/com/android/server/am/ActivityStack.smali.rej

patching file /home/andrei/patchrom/device/services.jar.out/./smali/com/android/server/am/ActivityManagerService.smali

Hunk #1 succeeded at 85731 with fuzz 1 (offset 2752 lines).

patching file /home/andrei/patchrom/device/services.jar.out/./smali/com/android/server/SystemServer.smali

Hunk #1 succeeded at 153 (offset 11 lines).

patching file /home/andrei/patchrom/device/services.jar.out/./smali/com/android/server/wm/WindowManagerService.smali

Hunk #1 FAILED at 708.

1 out of 1 hunk FAILED -- saving rejects to file /home/andrei/patchrom/device/temp/reject/services.jar.out/./smali/com/android/server/wm/WindowManagerService.smali.rej

>>> patch miui into target framework is done. Please look at /home/andrei/patchrom/device/temp/reject to resolve any conflicts!

andrei@Andrei-HP-EliteBook:~/patchrom/device$

Firstpatch was done. I got "some" rejects what I'm going to try to fix tommorow, I have a lot of work, so I won't promise you. But I'll try.