[Android Software/Hacking General [Developers Only]] Andromepat:
Hey guys,

just tried to patch OpenPDroid into ReVolt ROM for SGS2 (I9100), but it fails all the time.

As I'm a fancy Windows Clicking guy, I tried ApG first. Here's the log:

ROOT= /cygdrive/c/Users/Patrick/Desktop/GTab/apg/ApGPackages/ap
TOOL= /cygdrive/c/Users/Patrick/Desktop/GTab/apg/ApGPackages/ap/patch_tools.tgz
ROM= /cygdrive/c/Users/Patrick/Desktop/GTab/apg/ReVolt-JB-4.2-i9100.zip
ROMX= C:\Users\Patrick\Desktop\GTab\apg\REVOLT~1.ZIP

### verify tools ###
/cygdrive/c/Users/Patrick/Desktop/GTab/apg/ApGPackages/cygwin/bin/patch
/cygdrive/c/Users/Patrick/Desktop/GTab/apg/ApGPackages/cygwin/bin/tar
/cygdrive/c/Users/Patrick/Desktop/GTab/apg/ApGPackages/Java/bin/jar
/cygdrive/c/Users/Patrick/Desktop/GTab/apg/ApGPackages/Java/bin/java
/cygdrive/c/Users/Patrick/Desktop/GTab/apg/ApGPackages/cygwin/bin/cpio

### verify ROM ###
### running ./auto_patcher /cygdrive/c/Users/Patrick/Desktop/GTab/apg/ReVolt-JB-4.2-i9100.zip openpdroid aosp
PATH= /cygdrive/c/Users/Patrick/Desktop/GTab/apg/ApGPackages/ap/tmp20130413101129:/cygdrive/c/Users/Patrick/Desktop/GTab/apg/ApGPackages/Java/bin:/cygdrive/c/Users/Patrick/Desktop/GTab/apg/ApGPackages/cygwin/bin:/cygdrive/c/Users/Patrick/Desktop/GTab/apg/ApGPackages/cygwin/usr/sbin

### unzip patch tools ###

### unzip patch patches ###

... result of ROM check: RIL= SamsungExynos4RIL

### probe rom type ###
#### Standard Build Query ####
# VER= v2.9.1
# OS= cygwin 32bit
# VID= 4.2.2
# PID= openpdroid
# MID= i9100-userdebug
# RID= aosp
# ANDR= 4.2
# BDID= 20130411
# DID= GT-I9100
# BID= 20130213
Patches are openpdroid/4.2/aosp/20130213
### 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
### APK FILES= system/app/Mms.apk
### IMG FILES=
### TXT FILES=

### unzip rom ###

### create updater script ###

... using Aroma 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/mmcblk0p9", "/system");
package_extract_dir("system", "/system");
set_perm(0, 0, 0755, "/system/addon.d/70-gapps.sh");
set_perm_recursive(0, 0, 0755, 0644, "/system/app");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 1000, 0750, "/system/bin/iptables");
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, 1000, 0750, "/system/bin/tc");
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, 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(0, 2000, 0755, "/system/vendor");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/lib");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor/lib/drm");
set_perm(0, 0, 0644, "/system/vendor/lib/drm/libdrmwvmplugin.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 ...
\vergr�t: preloaded-classes

... decompile core.jar ...

... decompile services.jar ...

... decompile telephony-common.jar ...
\vergr�t: system/framework/framework-res.apk

... installing framework files ...

... decompile Mms.apk ...
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f020243 drawable/listitem_background, config=[DEFAULT]
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:201)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:170)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:135)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:110)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:491)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:74)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:66)
at brut.androlib.Androlib.getResTable(Androlib.java:50)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:189)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
### copy patch openpdroid/4.2/aosp/20130213 ###

... copying system/media/PDroid.jpeg ...
`patches/openpdroid/4.2/aosp/20130213/system/media/PDroid.jpeg' -> `./system/media/PDroid.jpeg'
### delete patch openpdroid/4.2/aosp/20130213 ###
### jar patch openpdroid/4.2/aosp/20130213 ###

... apply framework.patch ...
Reversed (or previously applied) patch detected! Skipping patch.
16 out of 16 hunks ignored -- saving rejects to file smali/android/app/BackStackRecord.smali.rej
The next patch would create the file 'smali/android/app/ContextImpl$41.smali',
which already exists! Skipping patch.
1 out of 1 hunk ignored
5 out of 5 hunks FAILED -- saving rejects to file smali/android/app/Fragment.smali.rej
2 out of 2 hunks FAILED -- saving rejects to file smali/android/content/AsyncTaskLoader.smali.rej
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file smali/android/content/ContentProviderOperation.smali.rej
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file smali/android/content/CursorLoader.smali.rej
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file smali/android/content/pm/VerificationParams.smali.rej
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file smali/android/net/wifi/WifiStateMachine.smali.rej
1 out of 6 hunks FAILED -- saving rejects to file smali/android/os/SystemProperties.smali.rej
1 out of 9 hunks FAILED -- saving rejects to file 'smali/android/provider/Settings$Secure.smali.rej'
Reversed (or previously applied) patch detected! Skipping patch.
6 out of 6 hunks ignored -- saving rejects to file 'smali/android/service/wallpaper/WallpaperService$Engine.smali.rej'
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file 'smali/com/android/internal/os/BatteryStatsImpl$StopwatchTimer.smali.rej'
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file 'smali/com/android/internal/os/BatteryStatsImpl$Timer.smali.rej'

... apply preloaded.patch ...

!!! PATCHING FAILED FOR android/app/Fragment.smali android/content/AsyncTaskLoader.smali android/os/SystemProperties.smali android/provider/Settings$Secure.smali' !!!
!!! patch error for android/app/Fragment.smali !!!

File for which patching failed:

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

Fragment.smali

You only need to report this if running the program gives you problems!!!
askconsent final = yes: for android/app/Fragment.smali

... 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'
!!! patch error for android/content/AsyncTaskLoader.smali !!!

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

!!! error: failed android/content/AsyncTaskLoader.smali in framework.jar cannot be remedied

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

I tried all ROM options (AOKP, AOSP, CM, PA), all did not work. This is log from my try with AOSP, as the ApG check says it is AOSP based (see above).

As you can see in ROM's thread, the devs say it is AOKP based, so I tried this one using the Autopatcher in a Linux terminal. This did'nt work either:

The Auto-Patcher v2.9.1

### verify tools ###
### verify ROM ###
### unzip patch tools ###
### unzip patch patches ###
\vergrößert: system/build.prop
... result of ROM check: RIL= SamsungExynos4RIL
### probe rom type ###
... result of ROM check: version= 4.2.2 rom= aosp ...
... Using aokp patches ...
... openpdroid patch date has been set to: 20130405 ...
### unzip rom ###
\vergrößert: system/app/Mms.apk
\vergrößert: system/framework/core.jar
\vergrößert: system/framework/framework.jar
\vergrößert: system/framework/services.jar
\vergrößert: system/framework/telephony-common.jar
### create updater script ###
\vergrößert: META-INF/com/google/android/update-binary
\vergrößert: META-INF/com/google/android/update-binary-installer
\vergrößert: META-INF/com/google/android/updater-script
... using Aroma installer ...
### create restore.zip ###
### decompile system files ###
... decompile framework.jar ...
... extract preloaded-classes ...
... decompile core.jar ...
... decompile services.jar ...
... decompile telephony-common.jar ...
... installing framework files ...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x010800ce drawable/background_holo_dark, config=-nodpi
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:201)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:170)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:135)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:110)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:40)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResources.java:562)
at brut.androlib.Androlib.installFramework(Androlib.java:473)
at brut.apktool.Main.cmdInstallFramework(Main.java:250)
at brut.apktool.Main.main(Main.java:81)
... decompile Mms.apk ...
### copy patch openpdroid/4.2/aokp/20130405 ###
... copying system/media/PDroid.jpeg ...
### jar patch openpdroid/4.2/aokp/20130405 ###
... apply framework.patch ...
Reversed (or previously applied) patch detected! Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file smali/android/app/Activity.smali.rej
1 out of 1 hunk FAILED -- saving rejects to file 'smali/android/app/ContextImpl$41.smali.rej'
1 out of 1 hunk FAILED -- saving rejects to file 'smali/android/app/ContextImpl$42.smali.rej'
The next patch would create the file 'smali/android/app/ContextImpl$43.smali',
which already exists! Skipping patch.
1 out of 1 hunk ignored
Reversed (or previously applied) patch detected! Skipping patch.
15 out of 15 hunks ignored -- saving rejects to file smali/android/app/Fragment.smali.rej
Reversed (or previously applied) patch detected! Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file 'smali/android/app/LoaderManagerImpl$LoaderInfo.smali.rej'
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file smali/android/app/WallpaperInfo.smali.rej
Reversed (or previously applied) patch detected! Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file smali/android/content/CursorLoader.smali.rej
Reversed (or previously applied) patch detected! Skipping patch.
6 out of 6 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/ContextImpl$41.smali' android/app/ContextImpl$42.smali' android/provider/Settings$Secure.smali' !!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! error: failed android/app/ContextImpl$41.smali' in framework.jar cannot be remedied
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

usage: ./auto_patcher <ROM> <MODS> <ROMTYPE>
example: ./auto_patcher CM10.zip openpdroid cm

Use ./auto_patcher -h for the help menu

You can see above, I tried Autopatcher 2.9.1 and ReVolt ROM JB 4.2 from 2013/04/03. Just saw, the two error messages from ApG and Linux Autopatcher are not the same.

Can someone provide help? Or is this the devs' thing?