ale5000-git / tingle

Tingle - Android patcher
http://forum.xda-developers.com/showthread.php?t=3438764
GNU General Public License v3.0
160 stars 11 forks source link

Patching impossible Huawei Ascend P7 #13

Closed battosai50 closed 7 years ago

battosai50 commented 7 years ago

Hi,

Your patch sends me errors for both methods. In fact, the Huawei P7 file/folder architectures seems to be my problem (and since i'm not the first Huawei owner encountering difficulties i bet solving this issue would help others too)...i admit i don't know much about file/folder architectures of other devices:

All the *.dex files are in : data/dalvik-cache/arm and are named typically directoryX@directoryY@directoryZ@appname.apk@classes.dex (for AirSharing given above, directoryX is "system", directoryY is "app", directoryZ is "AirSharing", appname is AirSharing)

So what do you advice me in order to spoof app signatures?

I'll try to put all .jar with their associated .dex in tingle-master/input folder and execute main.py... If you think the problem doesn't lie here or if you have a better idea, please let me know. If you implement a new tingle to fix this issue, i'll take it too ;-) Bye

battosai50 commented 7 years ago

H:\Softs\Huawei Ascend P7\tingle-master>python main.py MENU

1 - Patch file from a device (adb)
2 - Patch file from the input folder

1

* OS: Windows 7 (win32) * Mode: 1 * Working dir: C:\Users\batto\AppData\Local\Temp\Tingle-_nh4lzyx * Selected device: 7N2NEF1452015842 * Pulling framework from device... 2329 KB/s (38175 bytes in 0.016s) * Decompressing framework... DEBUG: Decompressing framework.jar *\ Disassembling classes...

ERROR: No dex file(s) found, probably the ROM is odexed.

ERROR CODE: 86

H:\Softs\Huawei Ascend P7\tingle-master>python main.py MENU

1 - Patch file from a device (adb)
2 - Patch file from the input folder

2

* OS: Windows 7 (win32) * Mode: 2 * Working dir: C:\Users\batto\AppData\Local\Temp\Tingle-k0egzcgh * Decompressing framework... DEBUG: Decompressing framework.jar *\ Disassembling classes...

ERROR: No dex file(s) found, probably the ROM is odexed.

ERROR CODE: 86

H:\Softs\Huawei Ascend P7\tingle-master>

ale5000-git commented 7 years ago

For signature spoofing, you only need to patch framework.jar (but it works only for deodexed ROMs). If the ROM is odedex currently you need to deodex it before patching. dalvik-cache is just a cache, it can be overridden at any time.

Usually your error happens with odexed ROMs that aren't deodexed.

battosai50 commented 7 years ago

I'm not sure i understand it well...hope you can help me. OK, but if my rom is odexed, i should find ".odex" files in it, right? All the files i found are ".dex" which is supposed to mean that my rom is dexed, no? Anyway that's what i thought which explains i thought my probleme was due to file/directory architecture. So what i have to look for is framework.dex? Or as i'm under Lollipop, isn't the framework in boot.oat file (need to oat2dex it)?

ale5000-git commented 7 years ago

With dalvik runtime there is odex, with ART runtime there is oat. On deodexed ROMs there is classes.dex inside framework.jar.

Yes, in your case the framework should be in boot.oat file, Tingle won't work until you oat2dex it.

battosai50 commented 7 years ago

Thanks for your concern:

So, yes, i think i managed to patch, following is the methodology i used (see the "but" at the end of the post):

1) i copied folders app+framework+priv-app + build.prop in the sdcard then on my computer (on H:\system\ (path without " " (space) cause it caused me a fail in a previous attempt to deox)

2) used SVADeodexerForArtx32 to deodex evrything, see below for the log: _

32-bit Deodexer for Android Runtime (Version 4.1 ?? 09/03/2016) © Valery Studenikin, 2016

Path to stock /system directory: H:\system Android 5.1.1: HUAWEI P7-L10, P7-L10C900B852, changelist , Mon Nov 23 04:02:03 CST 2015 Processor architecture: \arm\ Files deodexed succesfully: 23, with errors: 0. CPU time: 00:01:09 (68,869 sec.)

List of originally deodexed (within stock firmware) files, are left as they were originally:

/system/framework/am.jar /system/framework/android.test.runner.jar /system/framework/appops.jar /system/framework/appwidget.jar /system/framework/bmgr.jar /system/framework/bu.jar /system/framework/com.android.future.usb.accessory.jar /system/framework/com.android.location.provider.jar /system/framework/com.android.media.remotedisplay.jar /system/framework/com.android.mediadrm.signer.jar /system/framework/com.android.nfc_extras.jar /system/framework/com.google.android.maps.jar /system/framework/com.google.android.media.effects.jar /system/framework/com.google.widevine.software.drm.jar /system/framework/com.gsma.services.nfc.jar /system/framework/content.jar /system/framework/dpm.jar /system/framework/ethernet-service.jar /system/framework/hwBrowserConfig.jar /system/framework/hwServices.jar /system/framework/hwtransition.jar /system/framework/hwWifi-service.jar /system/framework/ime.jar /system/framework/input.jar /system/framework/javax.obex.jar /system/framework/media_cmd.jar /system/framework/monkey.jar /system/framework/pm.jar /system/framework/requestsync.jar /system/framework/services.jar /system/framework/settings.jar /system/framework/svc.jar /system/framework/uiautomator.jar /system/framework/wifi-service.jar /system/framework/wm.jar /system/app/AirSharing.apk /system/app/BasicDreams.apk /system/app/Bluetooth.apk /system/app/BrowserProviderProxy.apk /system/app/Calculator.apk /system/app/Calendar.apk /system/app/CalendarProvider.apk /system/app/CaptivePortalLogin.apk /system/app/CertInstaller.apk /system/app/Chrome.apk /system/app/ConfigUpdater.apk /system/app/DocumentsUI.apk /system/app/DownloadProviderUi.apk /system/app/Drive.apk /system/app/EmergencyData.apk /system/app/Gmail2.apk /system/app/GoogleCalendarSyncAdapter.apk /system/app/GoogleContactsSyncAdapter.apk /system/app/GoogleTTS.apk /system/app/Hangouts.apk /system/app/HoloSpiralWallpaper.apk /system/app/HTMLViewer.apk /system/app/HwBluetoothImport.apk /system/app/HwDeskClock.apk /system/app/HwFileManager.apk /system/app/HwFloatMms.apk /system/app/HwFloatTasks.apk /system/app/HwFMRadio.apk /system/app/HwInternetAudioService.apk /system/app/HwKaraokeEffect.apk /system/app/HwLauncher6.apk /system/app/HwMediaCenter.apk /system/app/HwMMIFunctionTest.apk /system/app/HwMOCALite.apk /system/app/HwMotionRecognition.apk /system/app/HwOUC.apk /system/app/HwPowerGenieEngine3.apk /system/app/HwPrivacyMode.apk /system/app/HwProjectMenu.apk /system/app/HwQrcodeDispatcher.apk /system/app/HwResolver.apk /system/app/HwSoundRecorder.apk /system/app/HwStartupGuide.apk /system/app/HwSystemManager.apk /system/app/HwThemeManager.apk /system/app/HwTrustAgent.apk /system/app/HwUserExperience.apk /system/app/HwWiFiDirect.apk /system/app/KeyChain.apk /system/app/LatinImeGoogle.apk /system/app/LiveWallpapersPicker.apk /system/app/Maps.apk /system/app/NfcNci.apk /system/app/OMACP.apk /system/app/PackageInstaller.apk /system/app/PacProcessor.apk /system/app/PartnerBookmarksProvider.apk /system/app/PhaseBeam.apk /system/app/PlusOne.apk /system/app/PrintSpooler.apk /system/app/SmartcardService.apk /system/app/Stk.apk /system/app/talkback.apk /system/app/UserDictionaryProvider.apk /system/app/VisualizationWallpapers.apk /system/app/webview.apk /system/app/YouTube.apk /system/priv-app/BackupRestoreConfirmation.apk /system/priv-app/Browser.apk /system/priv-app/CellBroadcastReceiver.apk /system/priv-app/Contacts.apk /system/priv-app/ContactsProvider.apk /system/priv-app/DefaultContainerService.apk /system/priv-app/DownloadProvider.apk /system/priv-app/Email.apk /system/priv-app/Exchange2.apk /system/priv-app/ExternalStorageProvider.apk /system/priv-app/FusedLocation.apk /system/priv-app/Gallery2.apk /system/priv-app/HwCamera.apk /system/priv-app/InCallUI.apk /system/priv-app/InputDevices.apk /system/priv-app/Keyguard.apk /system/priv-app/ManagedProvisioning.apk /system/priv-app/MediaProvider.apk /system/priv-app/MmsService.apk /system/priv-app/ProxyHandler.apk /system/priv-app/Settings.apk /system/priv-app/SettingsProvider.apk /system/priv-app/SharedStorageBackup.apk /system/priv-app/Shell.apk /system/priv-app/SystemUI.apk /system/priv-app/Telecom.apk /system/priv-app/TelephonyProvider.apk /system/priv-app/TeleService.apk /system/priv-app/VpnDialogs.apk /system/priv-app/WallpaperCropper.apk

_ 3) then i copied the "framework.jar" file (the deodexed one) located in framework folder and pasted it in tingle-master/input

4) then opened a cmd and executed your program:


> H:\Softs\HuaweiAscendP7\tingle-master>python main.py
> MENU
> 
>     1 - Patch file from a device (adb)
>     2 - Patch file from the input folder
> 
> > 2
> 
>  *** OS: Windows 7 (win32)
>  *** Mode: 2
>  *** Working dir: C:\Users\batto\AppData\Local\Temp\Tingle-s3clevzj
>  *** Decompressing framework...
>       DEBUG: Decompressing framework.jar
>  *** Disassembling classes...
>       DEBUG: Disassembling framework/classes.dex
>  *** Patching...
>  *** Detected: CyanogenMod 12
>  *** Patching succeeded.
>  *** Reassembling classes...
>       DEBUG: Assembling out/classes.dex
>  *** Recompressing framework...
>       DEBUG: Compressing framework.jar
>  *** Copying the patched file to the output folder...
>  *** All done! :)

Replaced the deodexed framework.jar (5.8 Mo) by the new one in output folder (5.7 Mo)

Replaced all app+priv-app+framework folders of the phone by the new one... Phone reboots normally...hurray!!

BUT self-check in microG settings still fails!!! (i tried tingle because fakeGapps failed in the first place).

So i have a few questions: Can you see what the problem could be? How come, if framework.jar is effectively deodexed+patched (spoof signed), it does not work? Can i check the signature?

If you have any idea i'll take it.... Thanks in advance for your help and, again, for your concern.

Edit: thinking of it: do i have to reinject the patched framework.jar in boot.oat myself? If yes, how can i do that, pls (dex2oat)?

ale5000-git commented 7 years ago

I don't have an odexed phone to test but I think you should no longer have boot.oat after deodexing.

Try this:

battosai50 commented 7 years ago

I'm on it... besides i flashed " Delete odex app,priv-app,framework.zip " & " Install DeOdex app,priv-app,framework.zip " in recovery to replace app/framework/priv-app folders

battosai50 commented 7 years ago

Sadly, uninstalling/clearcache/booting/resintalling does not work... I think about one more thing: Xposed was installed (with fakeGapps active) before i deodexed all files and there were files *.odex.xposed in /system/framework/arm...could it be part of the problem? Should i uninstall xposed and start over with deodexing/patching? Once again, thx for your help...i'm done for tonight, it's 3am here in France and my wife will start to worry if i dont go to bed ;-) Hope i'll read you tomorrow with a new idea. Bye

ale5000-git commented 7 years ago

I'm not sure about Xposed since I don't have it but it will likely complicate things. If you can, it is best to start with a clean /system partition and redo the process.

If you need Xposed I suggest to first deodexing and patching correctly with Tingle and then after signature spoofing works, make a backup and install Xposed.

battosai50 commented 7 years ago

That's exactly what i plan to do. Will come back with news soon. Thx

Le dimanche 2 octobre 2016, ale5000 notifications@github.com a écrit :

I'm not sure about Xposed since I don't have it but it will likely complicate things. If you can, it is best to start with a clean /system partition and redo the process.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.< https://ci5.googleusercontent.com/proxy/OIdwoQPbeGfhneIzgil8BLAhk-L7C_Zt2-szKuO-Q5xohr8nF957lLoevY7IjgqvHVTqQ1TFjE-6j5QWLmeEWK4BGFlBiAzAG2iq58ojE74HI7lqeHVbMr--fRJ3A0dLd9DKj1WOgFnNVzXseqOzwfVCT1VNRA=s0-d-e1-ft#https://github.com/notifications/beacon/AVfalICysSQKC9aVJXRXJp-T2esbTf7Jks5qv3jXgaJpZM4KLQ7R.gif>

battosai50 commented 7 years ago

Hello, my problem was indeed xposed... So if someone fails to get signature spoofing ok, try to uninstall magisk then xposed framework and reinstall magisk+phh superuser (if you try to uninstall xposed only - before magisk - you may bootloop), then deodex your rom (if needed) and patch your framework.jar with tingle, reboot in twrp, install the directory you deodexed, wipe dalvik cache+cache, reboot, let the system optimise and voila! Then you just have to install microG (gms, gsf, droid guard, store). (Reboot), install material design xposed installer reboot in TWRP and install 86.5 SDK22 framework systemless, reboot system, let the system optimise and you're done. Now all is OK under microG selftest (signature spoofing included)...time to use it and make my own opinion. Safetynet helper OK if i deactivate root with magisk Thx a lot for all your help.

ale5000-git commented 7 years ago

Good that you have been able to resolve your problem. Thanks for reporting back :)