mateor / auto-patcher

smali patcher for Android code injection
MIT License
74 stars 42 forks source link

error: Settings$Secure.patch in framework.jar cannot be remedied #281

Closed myplane closed 10 years ago

myplane commented 10 years ago

Forgive my poor English !

http://forum.xda-developers.com/showthread.php?t=2517309 LG-D802 OmniRom 4.4.2 Build 1.7

ROOT= /home/deep/patcher TOOL= /home/deep/patcher/patch_tools.tgz ROM= /home/deep/patcher/omni.zip ROMX= /home/deep/patcher/omni.zip

Updater: disabled

You will not be able to get automatic updates because we could not find 'git'.

Find out how to install git for your system and that feature should work automatically

verify tools

/usr/bin/patch /bin/tar /usr/bin/jar /usr/bin/java /bin/cpio

verify ROM

running ./auto_patcher omni.zip openpdroid

PATH= /home/deep/patcher/tmp20140129212050:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

unzip patch tools

unzip patch patches

... result of ROM check: RIL= LgeLteRIL

probe rom type

GNU Build Query

VER= v3.8.25

OS= linux-gnu 32bit

VID= 4.4.2

PID= openpdroid

MID= omni_d802-userdebug

RID= .aosp-omni

ANDR= 4.4

BDID= 20140124

DID= d802

BID= 20131115

unzip rom

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/priv-app/Mms.apk

APK FILES=

IMG FILES=

TXT FILES=

create updater script

... using Clockworkmod installer ...

generated updater-script

ui_print(""); ui_print(""); ui_print("~~~~~~~~~~~~"); uiprint("* "); uiprint(" * The * _"); uiprint(" * * Auto-Patcher * * _"); uiprint(" * * _"); uiprint(" *"); ui_print("~~~~~~~~~~~~"); ui_print(""); ui_print(" Attention"); uiprint(" ***"); ui_print(""); ui_print(" No ART support!"); ui_print(" Only use the davlik runtime with OpenPDroid!"); uiprint(" *"); 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/platform/msm_sdcc.1/by-name/system", "/system"); package_extract_dir("system", "/system"); 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.4

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

... overwriting system/media/PDroid.jpeg from openpdroid ... 'patches/openpdroid/4.4/.aosp-omni/20131115/system/media/PDroid.jpeg' -> './system/media/PDroid.jpeg'

jar patch openpdroid/4.4

... apply framework.patch ... Matching the created file: ContextImpl$45 for openpdroid/4.4/.aosp-omni We found 1 Context match: Using: patches/openpdroid/4.4/.aosp-omni/20131115

3 out of 10 hunks FAILED -- saving rejects to file 'smali/android/provider/Settings$Secure.smali.rej' We did not find a working patch for framework_82_Settings$Secure.patch...looking for other solutions!

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

!!! error: Settings$Secure.patch in framework.jar cannot be remedied

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

If your deodexed rom is not on the supported list and you want it added:

- Upload your log and a link to the rom's source code (mandatory)

 and be patient, please!
mateor commented 10 years ago

I have updated the patches and confirmed them to work on a 01292014 build of omnirom. Good luck.

closes #281

myplane commented 10 years ago

Best Regards & Thanks! Now it patches correctly,but the camera will FC when camera starts focus on something. 2014-1-30 ÉÏÎç11:44ÓÚ "mateor" notifications@github.comдµÀ£º

I have updated the patches and confirmed them to work on a 01292014 build of omnirom. Good luck.

closes #281

¡ª Reply to this email directly or view it on GitHubhttps://github.com/mateor/auto-patcher/issues/281#issuecomment-33657965 .

mateor commented 10 years ago

Okay. I had another user report the same issue. Please upload your auto_patcher log from this most recent patching so I have all the information.

Please also read my comment to the other user here https://github.com/mateor/auto-patcher/issues/278#issuecomment-33648883. I will not be carrying this project forward to Android 4.5, and if significant work is going to be required to solve your current issue, I will not be able to do that.

I will take a look at the logs though, and if the problem looks like a solvable auto_patcher issue then I will give it a shot.

mateor commented 10 years ago

One last thing to mention, because of the nature of this error (silent and something I haven't seen in the two years of the project) I can try a couple things but it will require testing and reporting from you guys...I won't know if it works until you tell me.

just an FYI. Thanks for the patience.

myplane commented 10 years ago

ROOT= /home/deep/patch TOOL= /home/deep/patch/patch_tools.tgz ROM= /home/deep/patch/omni-110.zip ROMX= /home/deep/patch/omni-110.zip

verify tools

/usr/bin/patch /bin/tar /usr/bin/jar /usr/bin/java /bin/cpio

verify ROM

running ./auto_patcher omni-110.zip openpdroid aosp

PATH= /home/deep/patch/tmp20140130160836:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

unzip patch tools

unzip patch patches

... result of ROM check: RIL= LgeLteRIL

probe rom type

GNU Build Query

VER= v3.8.27

OS= linux-gnu 32bit

VID= 4.4.2

PID= openpdroid

MID= omni_d802-userdebug

RID= .aosp-omni

ANDR= 4.4

BDID= 20140124

DID= d802

BID= 20131115

unzip rom

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/priv-app/Mms.apk

APK FILES=

IMG FILES=

TXT FILES=

create updater script

... using Clockworkmod installer ...

generated updater-script

ui_print(""); ui_print(""); ui_print("~~~~~~~~~~~~"); uiprint("* "); uiprint(" * The * _"); uiprint(" * * Auto-Patcher * * _"); uiprint(" * * _"); uiprint(" *"); ui_print("~~~~~~~~~~~~"); ui_print(""); ui_print(" Attention"); uiprint(" ***"); ui_print(""); ui_print(" No ART support!"); ui_print(" Only use the davlik runtime with OpenPDroid!"); uiprint(" *"); 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/platform/msm_sdcc.1/by-name/system", "/system"); package_extract_dir("system", "/system"); 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.4

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

... overwriting system/media/PDroid.jpeg from openpdroid ... 'patches/openpdroid/4.4/.aosp-omni/20131115/system/media/PDroid.jpeg' -> './system/media/PDroid.jpeg'

jar patch openpdroid/4.4

... apply framework.patch ... Matching the created file: ContextImpl$45 for openpdroid/4.4/.aosp-omni We found 1 Context match: Using: patches/openpdroid/4.4/.aosp-omni/20131115

...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_00_preloaded.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_14_Instrumentation$1.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_15_Instrumentation$2.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_16_Instrumentation$3.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_17_Instrumentation$4.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_18_Instrumentation.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_21_ContentResolver.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_29_Camera.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_30_AudioRecord.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_31_MediaRecorder$PrivacyRunner.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_32_MediaRecorder.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_39_NetworkInfo.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_47_WifiInfo.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_60_SystemProperties.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_61_IPrivacySettingsManager.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_62_IPrivacySettingsManager$Stub$Proxy.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_63_IPrivacySettingsManager$Stub.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_64_PrivacyFileObserver.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_65_PrivacyPersistenceAdapter.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_66_PrivacySettings$1.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_67_PrivacySettingsManagerService.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_68_PrivacySettingsManager.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_69_PrivacySettings.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_70_PrivacySettingsStub.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_71_PrivacyAccountManager$PrivacyAccountManagerFuture.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_72_PrivacyAccountManager.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_73_PrivacyActivityManagerService.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_74_PrivacyConnectivityManager.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_75_PrivacyContentResolver.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_76_PrivacyCursor.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_77_PrivacyLocationManager$PrivacyLocationUpdater.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_78_PrivacyLocationManager.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_79_PrivacyTelephonyManager.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_80_PrivacyWifiManager.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_82_Settings$Secure.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_83_MicrophoneInputStream.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_86_PhoneStateListener$1.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_87_PhoneStateListener.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_88_ServiceState.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_0_ContextImpl$11.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_10_ContextImpl$44.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_11_ContextImpl$45.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_12_ContextImpl$4.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_13_ContextImpl.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_1_ContextImpl$23.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_2_ContextImpl$24.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_3_ContextImpl$32.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_4_ContextImpl$37.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_5_ContextImpl$39.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_6_ContextImpl$40.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_7_ContextImpl$41.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_8_ContextImpl$42.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/framework_9_ContextImpl$43.patch ... GARBAGE= tmp/system/framework/framework.jar.out/smali/android/telephony/ServiceState.smali.orig tmp/system/framework/framework.jar.out/smali/android/provider/Settings$Secure.smali.orig GARBAGE=

... apply core.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/core_0_PrivacyInputStream.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/core_1_PrivacyProcessManager$PrivacyFileReader.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/core_2_PrivacyProcessManager.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/core_3_ProcessManager$ProcessImpl.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/core_4_ProcessManager.patch ... GARBAGE= GARBAGE=

... apply services.patch ... Succesful match found! Swapping patches/openpdroid/4.4/.reservoir/.aosp-omni/20131209/services_0_BroadcastQueue.patch for services_0_BroadcastQueue.patch!! Succesful match found! Swapping patches/openpdroid/4.4/.reservoir/.aosp-omni/20131209/services_3_ServerThread.patch for services_3_ServerThread.patch!! ...applying patches/openpdroid/4.4/.aosp-omni/20131115/services_1_PrivacyTelephonyRegistry$1.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/services_2_PrivacyTelephonyRegistry.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/services_4_TelephonyRegistry$1.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/services_5_TelephonyRegistry$2.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/services_6_TelephonyRegistry$Record.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/services_7_TelephonyRegistry.patch ... ...applying patches/openpdroid/4.4/.reservoir/.aosp-omni/20131209/services_0_BroadcastQueue.patch ... ...applying patches/openpdroid/4.4/.reservoir/.aosp-omni/20131209/services_3_ServerThread.patch ... GARBAGE= GARBAGE=

... apply telephony-common.patch ... Succesful match found! Swapping patches/openpdroid/4.4/.reservoir/.aosp-omni/20131209/telephony-common_12_SipPhoneFactory.patch for telephony-common_10_PhoneFactory.patch!! Succesful match found! Swapping patches/openpdroid/4.4/.reservoir/.aosp-omni/20131209/telephony-common_15_SMSDispatcher.patch for telephony-common_14_SMSDispatcher.patch!! 39 out of 85 hunks FAILED -- saving rejects to file smali/com/android/internal/telephony/cdma/CdmaServiceStateTracker.smali.rej We did not find a working patch for telephony-common_6_CdmaServiceStateTracker.patch...looking for other solutions! Succesful match found! Swapping patches/openpdroid/4.4/.reservoir/pa/20131125/telephony-common_8_GsmServiceStateTracker.patch for telephony-common_8_GsmServiceStateTracker.patch!! We are substituting a patchable version of CdmaServiceStateTracker.smali ... failed patch sucessfully resolved ... Succesful match found! Swapping patches/openpdroid/4.4/cm/20131109/telephony-common_6_CdmaServiceStateTracker.patch for telephony-common_6_CdmaServiceStateTracker.patch!! ...applying patches/openpdroid/4.4/.aosp-omni/20131115/telephony-common_0_PrivacyCDMALTEPhone.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/telephony-common_11_SipPhoneFactory.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/telephony-common_12_SipPhone.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/telephony-common_16_VoiceMailConstants.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/telephony-common_1_PrivacyCDMAPhone.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/telephony-common_2_PrivacyGSMPhone.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/telephony-common_3_PrivacyPhoneProxy.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/telephony-common_4_PrivacySipPhone.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/telephony-common_5_CDMAPhone.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/telephony-common_7_GSMPhone.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/telephony-common_9_IccSmsInterfaceManager.patch ... ...applying patches/openpdroid/4.4/.reservoir/.aosp-omni/20131209/telephony-common_12_SipPhoneFactory.patch ... ...applying patches/openpdroid/4.4/.reservoir/.aosp-omni/20131209/telephony-common_15_SMSDispatcher.patch ... ...applying patches/openpdroid/4.4/.reservoir/pa/20131125/telephony-common_8_GsmServiceStateTracker.patch ... ...applying patches/openpdroid/4.4/cm/20131109/telephony-common_6_CdmaServiceStateTracker.patch ... Reversed (or previously applied) patch detected! Skipping patch. 1 out of 1 hunk ignored -- saving rejects to file smali/com/android/internal/telephony/sip/SipPhoneFactory.smali.rej GARBAGE= tmp/system/framework/telephony-common.jar.out/smali/com/android/internal/telephony/gsm/GsmServiceStateTracker.smali.orig tmp/system/framework/telephony-common.jar.out/smali/com/android/internal/telephony/gsm/GSMPhone.smali.orig tmp/system/framework/telephony-common.jar.out/smali/com/android/internal/telephony/IccSmsInterfaceManager.smali.orig tmp/system/framework/telephony-common.jar.out/smali/com/android/internal/telephony/cdma/CDMAPhone.smali.orig GARBAGE= tmp/system/framework/telephony-common.jar.out/smali/com/android/internal/telephony/sip/SipPhoneFactory.smali.rej

No Mms.apk in ROM

... apply Mms.apk.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/Mms.apk_0_HttpUtils$APNInfo.patch ... ...applying patches/openpdroid/4.4/.aosp-omni/20131115/Mms.apk_1_HttpUtils.patch ... GARBAGE= GARBAGE=

rebuild jar

... rebuild framework.jar ... adding: classes.dex(in = 7630296) (out= 2984566)(deflated 60%) adding: preloaded-classes(in = 103802) (out= 17343)(deflated 83%)

... rebuild core.jar ... adding: classes.dex(in = 2382652) (out= 973315)(deflated 59%)

... rebuild services.jar ... adding: classes.dex(in = 2696256) (out= 1158897)(deflated 57%)

... rebuild telephony-common.jar ... adding: classes.dex(in = 1172112) (out= 451529)(deflated 61%)

... rebuild Mms.apk ... adding: classes.dex(in = 778216) (out= 328855)(deflated 57%)

create update-openpdroid-20140124.zip

added manifest adding: system/framework/framework.jar(in = 3002494) (out= 2981977)(deflated 0%) adding: system/framework/core.jar(in = 976550) (out= 970629)(deflated 0%) adding: system/framework/services.jar(in = 1159356) (out= 1156921)(deflated 0%) adding: system/framework/telephony-common.jar(in = 451988) (out= 448914)(deflated 0%) adding: system/priv-app/Mms.apk(in = 1902174) (out= 964708)(deflated 49%) adding: system/media/PDroid.jpeg(in = 26898) (out= 25744)(deflated 4%) ignoring entry META-INF/ adding: META-INF/com/(in = 0) (out= 0)(stored 0%) adding: META-INF/com/google/(in = 0) (out= 0)(stored 0%) adding: META-INF/com/google/android/(in = 0) (out= 0)(stored 0%) adding: META-INF/com/google/android/update-binary(in = 275388) (out= 176805)(deflated 35%) adding: META-INF/com/google/android/updater-script(in = 1218) (out= 304)(deflated 75%)

finished

Congratulations(B, the patching was successful(B.

Any errors you may have seen were succesfully handled!

!!! Only file a bug report if the software is not(B behaving as expected !!!

--- update-openpdroid-20140124.zip(B

to restore original system, flash:

--- restore-from-openpdroid-20140124.zip(B

myplane commented 10 years ago

PS: ROM patched failed after the patch code updated at first,compared with the file Setting$Security.smali of nexus 4,the difference just the line number(.line XXXX),when i replace the file,it was patched smoothly.

My English is too horrible,if you can't understand the mean just contact me

mateor commented 10 years ago

I have updated the omnirom patches if anyone is having trouble. I heard some reports of a camera FC. I have also heard that it may have been an upstream issue. Either way, i updated patches for the 0204 of omnirom so let me know about your experience.

myplane commented 10 years ago

I'm sorry!

my phone d802 is returned to the seller and I no longer have this phone.

I'll test it as soon as my new phone is in my hands. 2014-2-9 ÉÏÎç4:03ÓÚ "mateor" notifications@github.comдµÀ£º

Closed #281 https://github.com/mateor/auto-patcher/issues/281 via 0fcbaa7https://github.com/mateor/auto-patcher/commit/0fcbaa7aa13b8cb211fc41366f486e9db1d6cc8d .

¡ª Reply to this email directly or view it on GitHubhttps://github.com/mateor/auto-patcher/issues/281 .