[Android Software/Hacking General [Developers Only]] f1r3skull:
Can't patch CM10 for Motorola Milestone 2

I tried to patch the rom Cyanogenmod (4.1.2) for Motorola Milestone (http://xdaforums.com/showthread.php?t=1827801) using ApG on Windows 7, with pdroid 2.0, opendroid e even pdroid. None worked. (btw, I could only try pdroid 2.0 using the manual patching, since it was not displaied in the list of the patcher)

I used the auto patcher in G:\ApG AutoPatcher (since kobik's post says to not run ApG under C:\ directory) and C:\Patcher (just to try, since it didn't work before), in both cases I tried putting the rom zip in the \ApGPackages\ap\ and then tried again with it in the desktop. I tried the ApG both as regular user and as administrator.

I tried v6supercharger and it worked. At least the auto patcher said so (I didn't flash the zip to test).

Can anyone help?

Here are the logs:

opendroid on C:\

ROOT= /cygdrive/c/Patcher/ApGPackages/ap
TOOL= /cygdrive/c/Patcher/ApGPackages/ap/patch_tools.tgz
ROM= /cygdrive/c/Patcher/ApGPackages/ap/CM10-20121228-NIGHTLY-milestone2.zip
ROMX= C:\Patcher\APGPAC~1\ap\CM10-2~1.ZIP

### verify tools ###
/cygdrive/c/Patcher/ApGPackages/cygwin/bin/patch
/cygdrive/c/Patcher/ApGPackages/cygwin/bin/tar
/cygdrive/c/Patcher/ApGPackages/Java/bin/jar
/cygdrive/c/Patcher/ApGPackages/Java/bin/java
/cygdrive/c/Patcher/ApGPackages/cygwin/bin/cpio

### verify ROM ###
### running ./auto_patcher /cygdrive/c/Patcher/ApGPackages/ap/CM10-20121228-NIGHTLY-milestone2.zip openpdroid cm
PATH= /cygdrive/c/Patcher/ApGPackages/ap/tmp20130127220427:/cygdrive/c/Patcher/ApGPackages/Java/bin:/cygdrive/c/Patcher/ApGPackages/cygwin/bin:/cygdrive/c/Patcher/ApGPackages/cygwin/usr/sbin

### unzip patch tools ###

### unzip patch patches ###

... result of ROM check: RIL= MotoWrigley3GRIL

### probe rom type ###
#### Standard Build Query ####
# VER= v2.5.7
# OS= cygwin 32bit
# VID= 4.1.2
# PID= openpdroid
# MID= cm_milestone2-userdebug
# RID= cm
# ANDR= 4.1
# BDID= 20121228
# DID= milestone2
# BID= 20121212
Patches are openpdroid/4.1/cm/20121212
### DELETE FILES=
### COPY FILES= system/media/PDroid.jpeg
### JAR FILES= system/framework/framework.jar system/framework/core.jar system/framework/services.jar
### APK FILES= system/app/Mms.apk
### IMG FILES=
### TXT FILES=

### unzip rom ###

### create updater script ###

... using Clockworkmod installer ...
# generated updater-script
ui_print("");
ui_print("");
ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
ui_print("* *");
ui_print("* * The Auto-Patcher * *");
ui_print("* * * * * *");
ui_print("* * by mateor * *");
ui_print("* *");
ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
ui_print("");
ui_print(" Attention");
ui_print(" ************************************");
ui_print("");
ui_print(" There is nothing that can go wrong here");
ui_print(" that reflashing your ROM won't fix.");
ui_print("");
mount("ext3", "EMMC", "/dev/block/mmcblk1p21", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/binary/");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/script/");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/recovery/sbin/");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/2nd-boot/sbin/");
set_perm(0, 0, 0755, "/system/bootmenu/2nd-init/init");
set_perm(0, 0, 0755, "/system/bootmenu/2nd-boot/init");
set_perm_recursive(0, 2000, 0775, 0664, "/system/bootmenu/config/");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
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(0, 0, 0755, "/system/etc/wifi/hostap_wrapper.sh");
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_recursive(0, 0, 0755, 0755, "/system/etc/init.d");
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, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/hcitool");
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/tcpdump");
set_perm(0, 0, 0755, "/system/etc/motorola/comm_drv/commdrv_fs.sh");
ui_print(" .");
ui_print(" .");
ui_print(" done!");

### create restore.zip ###

### decompile system files ###

... decompile framework.jar ...

... extract preloaded-classes ...
\cheio: preloaded-classes

... decompile core.jar ...

... decompile services.jar ...
\cheio: system/framework/framework-res.apk

... installing framework files ...

... decompile Mms.apk ...
### copy patch openpdroid/4.1/cm/20121212 ###

... copying system/media/PDroid.jpeg ...
`patches/openpdroid/4.1/cm/20121212/system/media/PDroid.jpeg' -> `./system/media/PDroid.jpeg'

... overwriting GsmServiceStateTracker.smali ...
### delete patch openpdroid/4.1/cm/20121212 ###
### jar patch openpdroid/4.1/cm/20121212 ###

... apply framework.patch ...
Reversed (or previously applied) patch detected! Skipping patch.
6 out of 6 hunks ignored -- saving rejects to file smali/android/view/ViewGroup.smali.rej
Reversed (or previously applied) patch detected! Skipping patch.
5 out of 5 hunks ignored -- saving rejects to file smali/com/android/internal/telephony/gsm/GsmServiceStateTracker.smali.rej

... apply preloaded.patch ...
GARBAGE=
GARBAGE= tmp/system/framework/framework.jar.out/smali/android/view/ViewGroup.smali.rej tmp/system/framework/framework.jar.out/smali/com/android/internal/telephony/gsm/GsmServiceStateTracker.smali.rej

... apply core.patch ...
GARBAGE=
GARBAGE=

... apply services.patch ...
142 out of 143 hunks FAILED -- saving rejects to file smali/com/android/server/ServerThread.smali.rej

!!! PATCHING FAILED FOR com/android/server/ServerThread.smali !!!
!!! patch error for com/android/server/ServerThread.smali !!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!! error: failed com/android/server/ServerThread.smali in services.jar cannot be remedied

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

pdroid 2.0 on c:\

ROOT= /cygdrive/c/Patcher/ApGPackages/ap
TOOL= /cygdrive/c/Patcher/ApGPackages/ap/patch_tools.tgz
ROM= /cygdrive/c/Patcher/ApGPackages/ap/CM10-20121228-NIGHTLY-milestone2.zip
ROMX= C:\Patcher\APGPAC~1\ap\CM10-2~1.ZIP

### verify tools ###
/cygdrive/c/Patcher/ApGPackages/cygwin/bin/patch
/cygdrive/c/Patcher/ApGPackages/cygwin/bin/tar
/cygdrive/c/Patcher/ApGPackages/Java/bin/jar
/cygdrive/c/Patcher/ApGPackages/Java/bin/java
/cygdrive/c/Patcher/ApGPackages/cygwin/bin/cpio

### verify ROM ###
### running ./auto_patcher CM10-20121228-NIGHTLY-milestone2.zip pd2.0
PATH= /cygdrive/c/Patcher/ApGPackages/ap/tmp20130127221327:/cygdrive/c/Patcher/ApGPackages/Java/bin:/cygdrive/c/Patcher/ApGPackages/cygwin/bin:/cygdrive/c/Patcher/ApGPackages/cygwin/usr/sbin

### unzip patch tools ###

### unzip patch patches ###

... result of ROM check: RIL= MotoWrigley3GRIL

### probe rom type ###
#### Standard Build Query ####
# VER= v2.5.7
# OS= cygwin 32bit
# VID= 4.1.2
# PID= pd2.0
# MID= cm_milestone2-userdebug
# RID= cm
# ANDR= 4.1
# BDID= 20121228
# DID= milestone2
# BID= 20121017
Patches are pd2.0/4.1/cm/20121017
### DELETE FILES=
### COPY FILES= system/app/Mms.apk system/media/PDroid.jpeg
### JAR FILES= system/framework/framework.jar system/framework/core.jar system/framework/services.jar
### APK FILES=
### IMG FILES=
### TXT FILES=

### unzip rom ###

### create updater script ###

... using Clockworkmod installer ...
# generated updater-script
ui_print("");
ui_print("");
ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
ui_print("* *");
ui_print("* * The Auto-Patcher * *");
ui_print("* * * * * *");
ui_print("* * by mateor * *");
ui_print("* *");
ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
ui_print("");
ui_print(" Attention");
ui_print(" ************************************");
ui_print("");
ui_print(" There is nothing that can go wrong here");
ui_print(" that reflashing your ROM won't fix.");
ui_print("");
mount("ext3", "EMMC", "/dev/block/mmcblk1p21", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/binary/");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/script/");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/recovery/sbin/");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/2nd-boot/sbin/");
set_perm(0, 0, 0755, "/system/bootmenu/2nd-init/init");
set_perm(0, 0, 0755, "/system/bootmenu/2nd-boot/init");
set_perm_recursive(0, 2000, 0775, 0664, "/system/bootmenu/config/");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
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(0, 0, 0755, "/system/etc/wifi/hostap_wrapper.sh");
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_recursive(0, 0, 0755, 0755, "/system/etc/init.d");
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, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/hcitool");
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/tcpdump");
set_perm(0, 0, 0755, "/system/etc/motorola/comm_drv/commdrv_fs.sh");
ui_print(" .");
ui_print(" .");
ui_print(" done!");

### create restore.zip ###

### decompile system files ###

... decompile framework.jar ...

... extract preloaded-classes ...
\cheio: preloaded-classes

... decompile core.jar ...

... decompile services.jar ...
### copy patch pd2.0/4.1/cm/20121017 ###

... copying system/app/Mms.apk ...

... overwriting system/app/Mms.apk from pd2.0 ...
`patches/pd2.0/4.1/cm/20121017/system/app/Mms.apk' -> `./system/app/Mms.apk'

... copying system/media/PDroid.jpeg ...
`patches/pd2.0/4.1/cm/20121017/system/media/PDroid.jpeg' -> `./system/media/PDroid.jpeg'

... overwriting GsmServiceStateTracker.smali ...
### delete patch pd2.0/4.1/cm/20121017 ###
### jar patch pd2.0/4.1/cm/20121017 ###

... apply framework.patch ...
Reversed (or previously applied) patch detected! Skipping patch.
6 out of 6 hunks ignored -- saving rejects to file smali/android/view/ViewGroup.smali.rej
Reversed (or previously applied) patch detected! Skipping patch.
5 out of 5 hunks ignored -- saving rejects to file smali/com/android/internal/telephony/gsm/GsmServiceStateTracker.smali.rej

... apply preloaded.patch ...
GARBAGE=
GARBAGE= tmp/system/framework/framework.jar.out/smali/android/view/ViewGroup.smali.rej tmp/system/framework/framework.jar.out/smali/com/android/internal/telephony/gsm/GsmServiceStateTracker.smali.rej

... apply core.patch ...
GARBAGE=
GARBAGE=

... apply services.patch ...
142 out of 143 hunks FAILED -- saving rejects to file smali/com/android/server/ServerThread.smali.rej

!!! PATCHING FAILED FOR com/android/server/ServerThread.smali !!!
!!! patch error for com/android/server/ServerThread.smali !!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!! error: failed com/android/server/ServerThread.smali in services.jar cannot be remedied

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

opendroid on G:\

ROOT= /cygdrive/g/ApG AutoPatcher/ApGPackages/ap
TOOL= /cygdrive/g/ApG AutoPatcher/ApGPackages/ap/patch_tools.tgz
ROM= /cygdrive/g/ApG AutoPatcher/ApGPackages/ap/CM10-20121228-NIGHTLY-milestone2.zip
ROMX= G:\APGAUT~1\APGPAC~1\ap\CM10-2~1.ZIP

### verify tools ###
/cygdrive/g/ApG AutoPatcher/ApGPackages/cygwin/bin/patch
/cygdrive/g/ApG AutoPatcher/ApGPackages/cygwin/bin/tar
/cygdrive/g/ApG AutoPatcher/ApGPackages/Java/bin/jar
/cygdrive/g/ApG AutoPatcher/ApGPackages/Java/bin/java
/cygdrive/g/ApG AutoPatcher/ApGPackages/cygwin/bin/cpio

### verify ROM ###
### running ./auto_patcher /cygdrive/g/ApG AutoPatcher/ApGPackages/ap/CM10-20121228-NIGHTLY-milestone2.zip openpdroid cm
PATH= /cygdrive/g/ApG AutoPatcher/ApGPackages/ap/tmp20130127221818:/cygdrive/g/ApG AutoPatcher/ApGPackages/Java/bin:/cygdrive/g/ApG AutoPatcher/ApGPackages/cygwin/bin:/cygdrive/g/ApG AutoPatcher/ApGPackages/cygwin/usr/sbin

### unzip patch tools ###

### unzip patch patches ###

... result of ROM check: RIL= MotoWrigley3GRIL

### probe rom type ###
#### Standard Build Query ####
# VER= v2.5.7
# OS= cygwin 32bit
# VID= 4.1.2
# PID= openpdroid
# MID= cm_milestone2-userdebug
# RID= cm
# ANDR= 4.1
# BDID= 20121228
# DID= milestone2
# BID= 20121212
Patches are openpdroid/4.1/cm/20121212
### DELETE FILES=
### COPY FILES= system/media/PDroid.jpeg
### JAR FILES= system/framework/framework.jar system/framework/core.jar system/framework/services.jar
### APK FILES= system/app/Mms.apk
### IMG FILES=
### TXT FILES=

### unzip rom ###

### create updater script ###

... using Clockworkmod installer ...
# generated updater-script
ui_print("");
ui_print("");
ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
ui_print("* *");
ui_print("* * The Auto-Patcher * *");
ui_print("* * * * * *");
ui_print("* * by mateor * *");
ui_print("* *");
ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
ui_print("");
ui_print(" Attention");
ui_print(" ************************************");
ui_print("");
ui_print(" There is nothing that can go wrong here");
ui_print(" that reflashing your ROM won't fix.");
ui_print("");
mount("ext3", "EMMC", "/dev/block/mmcblk1p21", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/binary/");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/script/");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/recovery/sbin/");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/2nd-boot/sbin/");
set_perm(0, 0, 0755, "/system/bootmenu/2nd-init/init");
set_perm(0, 0, 0755, "/system/bootmenu/2nd-boot/init");
set_perm_recursive(0, 2000, 0775, 0664, "/system/bootmenu/config/");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
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(0, 0, 0755, "/system/etc/wifi/hostap_wrapper.sh");
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_recursive(0, 0, 0755, 0755, "/system/etc/init.d");
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, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/hcitool");
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/tcpdump");
set_perm(0, 0, 0755, "/system/etc/motorola/comm_drv/commdrv_fs.sh");
ui_print(" .");
ui_print(" .");
ui_print(" done!");

### create restore.zip ###

### decompile system files ###

... decompile framework.jar ...

... extract preloaded-classes ...
\cheio: preloaded-classes

... decompile core.jar ...

... decompile services.jar ...
\cheio: system/framework/framework-res.apk

... installing framework files ...

... decompile Mms.apk ...
### copy patch openpdroid/4.1/cm/20121212 ###

... copying system/media/PDroid.jpeg ...
`patches/openpdroid/4.1/cm/20121212/system/media/PDroid.jpeg' -> `./system/media/PDroid.jpeg'

... overwriting GsmServiceStateTracker.smali ...
### delete patch openpdroid/4.1/cm/20121212 ###
### jar patch openpdroid/4.1/cm/20121212 ###

... apply framework.patch ...
Reversed (or previously applied) patch detected! Skipping patch.
6 out of 6 hunks ignored -- saving rejects to file smali/android/view/ViewGroup.smali.rej
Reversed (or previously applied) patch detected! Skipping patch.
5 out of 5 hunks ignored -- saving rejects to file smali/com/android/internal/telephony/gsm/GsmServiceStateTracker.smali.rej

... apply preloaded.patch ...
GARBAGE=
GARBAGE= tmp/system/framework/framework.jar.out/smali/android/view/ViewGroup.smali.rej tmp/system/framework/framework.jar.out/smali/com/android/internal/telephony/gsm/GsmServiceStateTracker.smali.rej

... apply core.patch ...
GARBAGE=
GARBAGE=

... apply services.patch ...
142 out of 143 hunks FAILED -- saving rejects to file smali/com/android/server/ServerThread.smali.rej

!!! PATCHING FAILED FOR com/android/server/ServerThread.smali !!!
!!! patch error for com/android/server/ServerThread.smali !!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!! error: failed com/android/server/ServerThread.smali in services.jar cannot be remedied

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

pdroid 2.0 on G:\

ROOT= /cygdrive/g/ApG AutoPatcher/ApGPackages/ap
TOOL= /cygdrive/g/ApG AutoPatcher/ApGPackages/ap/patch_tools.tgz
ROM= /cygdrive/g/ApG AutoPatcher/ApGPackages/ap/CM10-20121228-NIGHTLY-milestone2.zip
ROMX= G:\APGAUT~1\APGPAC~1\ap\CM10-2~1.ZIP

### verify tools ###
/cygdrive/g/ApG AutoPatcher/ApGPackages/cygwin/bin/patch
/cygdrive/g/ApG AutoPatcher/ApGPackages/cygwin/bin/tar
/cygdrive/g/ApG AutoPatcher/ApGPackages/Java/bin/jar
/cygdrive/g/ApG AutoPatcher/ApGPackages/Java/bin/java
/cygdrive/g/ApG AutoPatcher/ApGPackages/cygwin/bin/cpio

### verify ROM ###
### running ./auto_patcher CM10-20121228-NIGHTLY-milestone2.zip pd2.0
PATH= /cygdrive/g/ApG AutoPatcher/ApGPackages/ap/tmp20130127222901:/cygdrive/g/ApG AutoPatcher/ApGPackages/Java/bin:/cygdrive/g/ApG AutoPatcher/ApGPackages/cygwin/bin:/cygdrive/g/ApG AutoPatcher/ApGPackages/cygwin/usr/sbin

### unzip patch tools ###

### unzip patch patches ###

... result of ROM check: RIL= MotoWrigley3GRIL

### probe rom type ###
#### Standard Build Query ####
# VER= v2.5.7
# OS= cygwin 32bit
# VID= 4.1.2
# PID= pd2.0
# MID= cm_milestone2-userdebug
# RID= cm
# ANDR= 4.1
# BDID= 20121228
# DID= milestone2
# BID= 20121017
Patches are pd2.0/4.1/cm/20121017
### DELETE FILES=
### COPY FILES= system/app/Mms.apk system/media/PDroid.jpeg
### JAR FILES= system/framework/framework.jar system/framework/core.jar system/framework/services.jar
### APK FILES=
### IMG FILES=
### TXT FILES=

### unzip rom ###

### create updater script ###

... using Clockworkmod installer ...
# generated updater-script
ui_print("");
ui_print("");
ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
ui_print("* *");
ui_print("* * The Auto-Patcher * *");
ui_print("* * * * * *");
ui_print("* * by mateor * *");
ui_print("* *");
ui_print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
ui_print("");
ui_print(" Attention");
ui_print(" ************************************");
ui_print("");
ui_print(" There is nothing that can go wrong here");
ui_print(" that reflashing your ROM won't fix.");
ui_print("");
mount("ext3", "EMMC", "/dev/block/mmcblk1p21", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/binary/");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/script/");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/recovery/sbin/");
set_perm_recursive(0, 0, 0755, 0755, "/system/bootmenu/2nd-boot/sbin/");
set_perm(0, 0, 0755, "/system/bootmenu/2nd-init/init");
set_perm(0, 0, 0755, "/system/bootmenu/2nd-boot/init");
set_perm_recursive(0, 2000, 0775, 0664, "/system/bootmenu/config/");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
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(0, 0, 0755, "/system/etc/wifi/hostap_wrapper.sh");
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_recursive(0, 0, 0755, 0755, "/system/etc/init.d");
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, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/hcitool");
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/tcpdump");
set_perm(0, 0, 0755, "/system/etc/motorola/comm_drv/commdrv_fs.sh");
ui_print(" .");
ui_print(" .");
ui_print(" done!");

### create restore.zip ###

### decompile system files ###

... decompile framework.jar ...

... extract preloaded-classes ...
\cheio: preloaded-classes

... decompile core.jar ...

... decompile services.jar ...
### copy patch pd2.0/4.1/cm/20121017 ###

... copying system/app/Mms.apk ...

... overwriting system/app/Mms.apk from pd2.0 ...
`patches/pd2.0/4.1/cm/20121017/system/app/Mms.apk' -> `./system/app/Mms.apk'

... copying system/media/PDroid.jpeg ...
`patches/pd2.0/4.1/cm/20121017/system/media/PDroid.jpeg' -> `./system/media/PDroid.jpeg'

... overwriting GsmServiceStateTracker.smali ...
### delete patch pd2.0/4.1/cm/20121017 ###
### jar patch pd2.0/4.1/cm/20121017 ###

... apply framework.patch ...
Reversed (or previously applied) patch detected! Skipping patch.
6 out of 6 hunks ignored -- saving rejects to file smali/android/view/ViewGroup.smali.rej
Reversed (or previously applied) patch detected! Skipping patch.
5 out of 5 hunks ignored -- saving rejects to file smali/com/android/internal/telephony/gsm/GsmServiceStateTracker.smali.rej

... apply preloaded.patch ...
GARBAGE=
GARBAGE= tmp/system/framework/framework.jar.out/smali/android/view/ViewGroup.smali.rej tmp/system/framework/framework.jar.out/smali/com/android/internal/telephony/gsm/GsmServiceStateTracker.smali.rej

... apply core.patch ...
GARBAGE=
GARBAGE=

... apply services.patch ...
142 out of 143 hunks FAILED -- saving rejects to file smali/com/android/server/ServerThread.smali.rej

!!! PATCHING FAILED FOR com/android/server/ServerThread.smali !!!
!!! patch error for com/android/server/ServerThread.smali !!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!! error: failed com/android/server/ServerThread.smali in services.jar cannot be remedied

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!