Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tools/codesign][tvOS] Do fake sign, needed for jailbroken devices #18315

Merged
merged 2 commits into from Aug 26, 2020

Conversation

sy6sy2
Copy link
Member

@sy6sy2 sy6sy2 commented Aug 21, 2020

Description

At the moment fake sign with ldid tool is only performed on iOS deb. This PR enable it for both iOS and tvOS.
Without this fake sign step we can install Kodi on jailbroken Apple TV with dpkg -i but Kodi will crash instantly during start.

Motivation and Context

To be able to easily install Kodi on jailbroken Apple TV devices. The user will not have to perform the fake sign by himself.

How Has This Been Tested?

  • dpkg -i of the iOS deb file correctly install Kodi on jailbroken iPhone (checkra1n) and Kodi runs well
  • dpkg -i of the tvOS deb file correctly install Kodi on jailbroken Apple TV 4K (checkra1n) and Kodi runs well

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

@sy6sy2 sy6sy2 added Don't merge PR that should not be merged (yet) WIP PR that is still being worked on labels Aug 21, 2020
@sy6sy2 sy6sy2 added this to the Matrix 19.0-alpha 2 milestone Aug 21, 2020
@sy6sy2 sy6sy2 force-pushed the fix-tvos-dpkg-install-JB branch 2 times, most recently from 756866f to f6ee1f5 Compare August 21, 2020 22:42
@sy6sy2 sy6sy2 removed Don't merge PR that should not be merged (yet) WIP PR that is still being worked on labels Aug 22, 2020
tools/darwin/Support/Codesign.command Outdated Show resolved Hide resolved
tools/darwin/Support/Codesign.command Outdated Show resolved Hide resolved
tools/darwin/Support/Codesign.command Outdated Show resolved Hide resolved
tools/darwin/Support/Codesign.command Outdated Show resolved Hide resolved
tools/darwin/Support/Codesign.command Outdated Show resolved Hide resolved
tools/darwin/Support/Codesign.command Outdated Show resolved Hide resolved
@fuzzard
Copy link
Contributor

fuzzard commented Aug 26, 2020

Whilst you are in here @sy6sy2 Do you want to have a look at the following patch.

  • Just cleans up some unnecessary if check that is always valid anyway (all 3 apple platforms).
  • Removes the eggs extraction for jailbroken fakesign, and only does for osx target. As discussed, on ios/tvos we dont use eggs. Im not even sure if we need to sign it for osx, but ill leave that in for now, as it may be needed if we ever go the store route.
  • As far as i can find, we dont have anything that uses .pvr .0 or .vis extensions anymore.
  • Have done Kambala's pickups as well

https://paste.kodi.tv/bavuwaduco

Also as discussed on slack, id be interested whether the following line could be removed completely. Definitely something you would need to test on a jailbreak though.

find "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_FOLDER_PATH}/" -iname "*.dylib" -or -iname "*.so" | xargs "${LDID}" -S"${DARWIN_EMBEDDED_ENTITLEMENTS}"

@sy6sy2
Copy link
Member Author

sy6sy2 commented Aug 26, 2020

Should we keep

if [ "${PLATFORM_NAME}" == "macosx" ]; then
  MACOS=1
fi

or use "${PLATFORM_NAME}" == "macosx" in every if like we do for tvOS and iOS?

Second question, this line

if [[ "$MACOS" || "${PLATFORM_NAME}" == "iphoneos" || "${PLATFORM_NAME}" == "appletvos" ]]; then
is useless right? Because this file is only used with macOS, iOS and tvOS so this if is always true?

@fuzzard
Copy link
Contributor

fuzzard commented Aug 26, 2020

Its already in, so i wouldnt bother changing it personally.
Second question, yes, its one of the ifs i remove in the patch above.

@sy6sy2
Copy link
Member Author

sy6sy2 commented Aug 26, 2020

Last push tested on macOS, Jailbroken Apple TV and iPhone. Not tested with real code signing for iOS and tvOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants