tihmstar / futurerestore

A hacked up idevicerestore wrapper, which allows specifying SEP and Baseband for restoring
GNU Lesser General Public License v3.0
857 stars 276 forks source link

[kDFUApp] required code signature missing for '/usr/local/lib/libcrippy-1.0.0.dylib' #196

Open janglapuk opened 6 years ago

janglapuk commented 6 years ago

In related with futurerestore, I recently installed kDFUApp from @tihmstar Cydia beta repo. Unfortunately, the kDFUApp won't started.

So, I tried to debug from the console, here the output:

mobile@iPhone-X: ~$ su
Password:
root@iPhone-X: mobile# cd /Applications/kDFUApp.app/
root@iPhone-X: kDFUApp.app# ls
Base.lproj              Down_iPhone5,1_8.4.1_12H321.bundle
Down_iPad2,1_6.1.3_10B329.bundle    Down_iPhone5,2_8.4.1_12H321.bundle
Down_iPad2,2_6.1.3_10B329.bundle    Down_iPhone5,4_7.1.2_11D257.bundle
Down_iPad2,3_6.1.3_10B329.bundle    Info.plist
Down_iPad3,1_7.1.2_11D257.bundle    META-INF
Down_iPad3,3_6.1.3_10B329.bundle    PkgInfo
Down_iPhone3,1_7.1.2_11D257.bundle  embedded.mobileprovision
Down_iPhone3,2_7.1.2_11D257.bundle  kDFUApp
Down_iPhone3,3_7.1.2_11D257.bundle  kDFUApp_
Down_iPhone4,1_6.1.3_10B329.bundle
root@iPhone-X: kDFUApp.app# ./kDFUApp
dyld: Library not loaded: /usr/local/lib/libcrippy-1.0.0.dylib
  Referenced from: /Applications/kDFUApp.app/kDFUApp_
  Reason: no suitable image found.  Did find:
    /usr/local/lib/libcrippy-1.0.0.dylib: required code signature missing for '/usr/local/lib/libcrippy-1.0.0.dylib'

    /usr/local/lib/libcrippy-1.0.0.dylib: required code signature missing for '/usr/local/lib/libcrippy-1.0.0.dylib'

    /usr/local/lib/libcrippy-1.0.0.dylib: required code signature missing for '/usr/local/lib/libcrippy-1.0.0.dylib'

    /usr/local/lib/libcrippy-1.0.0.dylib: required code signature missing for '/usr/local/lib/libcrippy-1.0.0.dylib'

Abort trap: 6
root@iPhone-X: kDFUApp.app# ls -al /usr/local/lib/
total 64
drwxr-xr-x 2 root wheel   204 Jan  9 12:08 .
drwxr-xr-x 6 root wheel   238 Jan  9 12:08 ..
-rwxr-xr-x 1 root wheel 15468 Oct 11  2015 libcrippy-1.0.0.dylib
-rwxr-xr-x 1 root wheel 15468 Oct 11  2015 libcrippy.dylib
-rwxr-xr-x 1 root wheel 14588 Oct 11  2015 libpartialzip-1.0.0.dylib
-rwxr-xr-x 1 root wheel 14588 Oct 11  2015 libpartialzip.dylib
root@iPhone-X: kDFUApp.app# sw_vers
ProductName:    iPhone OS
ProductVersion: 10.3.2
BuildVersion:   14F89
root@iPhone-X: kDFUApp.app# dpkg -l | grep libcrippy
ii  libcrippy-1.0.0                          1.0             iphoneos-arm (no description available)
root@iPhone-X: kDFUApp.app#

Don't know how to fix this code signing issue.

janglapuk commented 6 years ago

Solving the libs with:

CODESIGN_ALLOCATE=$(xcrun -sdk iphoneos -find codesign_allocate) ldid -S libcrippy.dylib
CODESIGN_ALLOCATE=$(xcrun -sdk iphoneos -find codesign_allocate) ldid -S libpartialzip.dylib
# and so on...

The previous error message has gone, but the app still won't starts. Here the syslog:

$ idevicesyslog | grep tihmstar
<SBMainWorkspaceTransitionRequest: 0x1466d0c0; eventLabel: ActivateApplication = org.tihmstar.kDFUApp; display: Main; source: HomeScreen> {
        SBLayoutPrimaryRole = <SBWorkspaceApplication: 0x7adca00; ID: org.tihmstar.kDFUApp; layoutRole: primary>;
Jan 12 23:54:07 iPhone-X assertiond[62] <Notice>: Process already exists for org.tihmstar.kDFUApp; ignoring job submission request from <BSProcessHandle: 0x166160c0; SpringBoard:4296; valid: YES>
Jan 12 23:54:07 iPhone-X SpringBoard(AssertionServices)[4296] <Notice>: [org.tihmstar.kDFUApp] Bootstrap failed with error: <NSError: 0x14552ea0; domain: BKSProcessErrorDomain; code: 1 (bootstrap-failed); reason: "Process already exists for job specification">
Jan 12 23:54:07 iPhone-X SpringBoard(FrontBoard)[4296] <Error>: Bootstrapping failed for <FBApplicationProcess: 0x7b6b7c0; org.tihmstar.kDFUApp; pid: -1> with error: Error Domain=BKSProcessErrorDomain Code=1 "Unable to bootstrap process with bundleID org.tihmstar.kDFUApp" UserInfo={BSErrorCodeDescription=bootstrap-failed, NSLocalizedFailureReason=Process already exists for job specification, NSLocalizedDescription=Unable to bootstrap process with bundleID org.tihmstar.kDFUApp}
Jan 12 23:54:07 iPhone-X SpringBoard(FrontBoard)[4296] <Notice>: <FBApplicationProcess: 0x7b6b7c0; org.tihmstar.kDFUApp; pid: -1> exited.
Jan 12 23:54:08 iPhone-X sharingd[32] <Notice>: SystemUI unknown identifier: 'org.tihmstar.kDFUApp'
Jan 12 23:54:08 iPhone-X SpringBoard[4296] <Notice>: Process exited: <FBApplicationProcess: 0x7b6b7c0; org.tihmstar.kDFUApp; pid: -1> -> <FBApplicationProcessExitContext: 0x19bb4510; exitReason: (none); terminationReason: (none)>

I don't have worked gdb to checking the assertion.

janglapuk commented 6 years ago

The app positively cannot work on iOS 10.x. Solved by using kloader (with host_get_special_port instead task_for_pid 0), a pwnediBSS from 8.4.1 custom firmware, voila!

No matter what if pwnediBSS generated from 8.4.1 CFW, you still able downgrade to any iOS (with blobs).

My 5,2 downgraded from 10.3.3 to 10.2 easily for tweaks compatibility.