[Android Software/Hacking General [Developers Only]] xoxo_xdagirl91:
I'm having some trouble with apg. I'm trying to patch illusion rom for d2tmo but it keeps failing. I can patch the latest cm nightly with no issues but I can't patch illusion rom for some reason. Here's the error:

ROOT= /cygdrive/c/Users/Jenn/Downloads/ApGPackages/ap
TOOL= /cygdrive/c/Users/Jenn/Downloads/ApGPackages/ap/patch_tools.tgz
ROM= /cygdrive/c/Users/Jenn/Downloads/Illusion-d2tmo-4.2.2-2.1.beta-20130716-2221.zip
ROMX= C:\Users\Jenn\DOWNLO~1\ILLUSI~1.ZIP

### verify tools ###
/cygdrive/c/Users/Jenn/Downloads/ApGPackages/cygwin/bin/patch
/cygdrive/c/Users/Jenn/Downloads/ApGPackages/cygwin/bin/tar
/cygdrive/c/Users/Jenn/Downloads/ApGPackages/Java/bin/jar
/cygdrive/c/Users/Jenn/Downloads/ApGPackages/Java/bin/java
/cygdrive/c/Users/Jenn/Downloads/ApGPackages/cygwin/bin/cpio

### verify ROM ###
### running ./auto_patcher /cygdrive/c/Users/Jenn/Downloads/Illusion-d2tmo-4.2.2-2.1.beta-20130716-2221.zip openpdroid cm
PATH= /cygdrive/c/Users/Jenn/Downloads/ApGPackages/ap/tmp20130723010318:/cygdrive/c/Users/Jenn/Downloads/ApGPackages/Java/bin:/cygdrive/c/Users/Jenn/Downloads/ApGPackages/cygwin/bin:/cygdrive/c/Users/Jenn/Downloads/ApGPackages/cygwin/usr/sbin

### unzip patch tools ###

### unzip patch patches ###

... result of ROM check: RIL= SamsungQualcommRIL

### probe rom type ###
#### Standard Build Query ####
# VER= v2.9.931
# OS= cygwin 32bit
# VID= 4.2.2
# PID= openpdroid
# MID= JDQ39E
# RID= cm
# ANDR= 4.2
# BDID= 20130716
# DID= d2tmo
# BID= 20130626
Patches are openpdroid/4.2/cm/20130626

Current HEAD: ec7f3abdb5d8c7544822fd764241748272451643 I see a 10.1-M3 tag...

### DELETE FILES=
### COPY FILES= system/media/PDroid.jpeg
### JAR FILES= system/framework/framework.jar system/framework/core.jar system/framework/services.jar system/framework/telephony-common.jar system/app/Mms.apk
### 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("ext4", "EMMC", "/dev/block/mmcblk0p14", "/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, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 0, 0755, "/system/bin/ping");
set_perm(0, 2000, 0750, "/system/bin/run-as");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm_recursive(0, 2000, 0755, 0755, "/system/etc/init.d");
set_perm(0, 0, 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, 0644, "/system/vendor");
set_perm(0, 0, 0644, "/system/vendor/etc/audio_effects.conf");
set_perm(0, 0, 0644, "/system/vendor/lib/libbt-vendor.so");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
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");
unmount("/system");
ui_print(" .");
ui_print(" .");
ui_print(" done!");

### create restore.zip ###

### decompile system files ###

... decompile framework.jar ...

... extract preloaded-classes ...
inflated: preloaded-classes

... decompile core.jar ...

... decompile services.jar ...

... decompile telephony-common.jar ...

... decompile Mms.apk ...
### copy patch openpdroid/4.2/cm/20130626 ###

... copying system/media/PDroid.jpeg ...

... overwriting system/media/PDroid.jpeg from openpdroid ...
`patches/openpdroid/4.2/cm/20130626/system/media/PDroid.jpeg' -> `./system/media/PDroid.jpeg'

... overwriting ContentResolver.smali ...
### delete patch openpdroid/4.2/cm/20130626 ###
### jar patch openpdroid/4.2/cm/20130626 ###

... apply framework.patch ...
The next patch would create the file 'smali/android/app/ContextImpl$45.smali',
which already exists! Skipping patch.
1 out of 1 hunk ignored
10 out of 15 hunks FAILED -- saving rejects to file smali/android/app/Fragment.smali.rej
Reversed (or previously applied) patch detected! Skipping patch.
7 out of 7 hunks ignored -- saving rejects to file smali/android/os/Looper.smali.rej
1 out of 9 hunks FAILED -- saving rejects to file 'smali/android/provider/Settings$Secure.smali.rej'

... apply preloaded.patch ...
!!! PATCHING FAILED FOR android/app/Fragment.smali android/provider/Settings$Secure.smali' !!!
!!! patch error for android/app/Fragment.smali !!!
File for which patching failed:
---------------------------------------------

Fragment.smali

---------------------------------------------

We are adding a pre-patched copy of those files.

Please only file a bug report if running the program gives you problems!!!
... replace android/app/Fragment.smali ...
`patches/openpdroid/4.2/.provisionals/system/framework/framework.jar.out/smali/android/app/Fragment.smali' -> `tmp/system/framework/framework.jar.out/smali/android/app/Fragment.smali'
... failed patch sucessfully resolved ...

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

!!! error: failed android/provider/Settings$Secure.smali' in framework.jar cannot be remedied

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