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][Jailbreak] Fake sign kodi-topshelf + fix crash on start on Unc0verTV #18335

Merged
merged 2 commits into from Sep 14, 2020

Conversation

sy6sy2
Copy link
Member

@sy6sy2 sy6sy2 commented Aug 27, 2020

Description

This PR is related to this one: #18315 (more precisely is a missing part of this one...)
I noticed that the top-shelf binary also need to be fake signed in order to work on jailbroken Apple TV.

Also, Kodi is completely broken on Unc0verTV jailbroken devices, because we need to fake-sign ALL binaries (including frameworks, dylib, ...)

Motivation and Context

  • This PR allow to have TopShelf working on jailbroken Apple TV devices (when you install Kodi with NitoTV or with dpkg -i).
  • This PR allow Unc0verTV devices to run Kodi

How Has This Been Tested?

On my jailbroken Apple TV 4K.

  • Signed sideload --> Ok
  • Fake-signed dpkg -i --> Ok

Also tested by @BTopbas on an Unc0verTV Apple TV 4K device.

User impact

  • tvOS jailbroken Kodi users will see Kodi Topshelf feature if they put Kodi app in the first line of their Apple TV home screen.
  • Kodi will works on Unc0verTV devices.

Screenshots (if appropriate):

84372190-09deb800-abdb-11ea-8ef3-07117737442a

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

Copy link
Contributor

@fuzzard fuzzard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do an if [ -f .../kodi-topshelf ], or encase it in a tvos platform check? Does ldid error if file doesn't exist?

Other comment would be around hardcoding Kodi in the filename. I can't remember if you can change topshelf app name, but I assume you can

@sy6sy2
Copy link
Member Author

sy6sy2 commented Aug 27, 2020

You are right, I will add the if because there is no topshelf file for iOS.
ldid return 1 code when file doesn't exist.

I will check.

@sy6sy2 sy6sy2 added the WIP PR that is still being worked on label Aug 27, 2020
@sy6sy2 sy6sy2 removed the WIP PR that is still being worked on label Aug 27, 2020
@sy6sy2 sy6sy2 requested a review from fuzzard August 27, 2020 22:08
@fuzzard
Copy link
Contributor

fuzzard commented Aug 27, 2020

Looks good to me

@sy6sy2 sy6sy2 added the WIP PR that is still being worked on label Aug 28, 2020
@sy6sy2 sy6sy2 added the No Jenkins do not run automatic Jenkins builds on this PR label Aug 29, 2020
tools/darwin/Support/Codesign.command Outdated Show resolved Hide resolved
tools/darwin/Support/Codesign.command Outdated Show resolved Hide resolved
@sy6sy2 sy6sy2 force-pushed the ATV-fake-sign-topshelf branch 2 times, most recently from cf5339c to eaab3d1 Compare August 29, 2020 13:07
Copy link
Contributor

@fuzzard fuzzard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with that, looks good

@sy6sy2 sy6sy2 removed No Jenkins do not run automatic Jenkins builds on this PR WIP PR that is still being worked on labels Aug 30, 2020
@sy6sy2
Copy link
Member Author

sy6sy2 commented Aug 30, 2020

Cool 😉 Thank you for your help.
@kambala-decapitator, is it ok for you?

@sy6sy2
Copy link
Member Author

sy6sy2 commented Aug 31, 2020

Jenkins build this please

tools/darwin/Support/Codesign.command Outdated Show resolved Hide resolved
tools/darwin/Support/Codesign.command Show resolved Hide resolved
tools/darwin/Support/Codesign.command Show resolved Hide resolved
tools/darwin/Support/Codesign.command Outdated Show resolved Hide resolved
tools/darwin/Support/Codesign.command Outdated Show resolved Hide resolved
This file is no more generated by Xcode since version 9.3
@sy6sy2 sy6sy2 changed the title [tools/codesign][tvOS] Fake sign kodi-topshelf, needed for jailbroken devices [tools/codesign][tvOS][Jailbreak] Fake sign kodi-topshelf + fix crash on start on Unc0verTV Sep 4, 2020
@sy6sy2 sy6sy2 requested a review from fuzzard September 4, 2020 19:28
@sy6sy2
Copy link
Member Author

sy6sy2 commented Sep 4, 2020

Hi, I finally create a "PostBuild" script for TopShelf in order to fake sign it if needed. I find this approach cleaner because we do not pollute main Codesign file with tvOS topShelf specific stuff.

Also, I added some code in order to fake-sign all Mach-O files. This step fix an issue where Unc0verTV users have Kodi crashing on start.
ATM Top-Shelf still not working on Unc0verTV devices, but I'm currently in contact with JoshTV trying to resolve this issue. Also, a big thanks to @BTopbas for all the tests he did because he is the only one here with a Unc0verTV jailbroken devices.

Sorry for the code changes...

tools/darwin/Support/Codesign.command Outdated Show resolved Hide resolved
tools/darwin/Support/Codesign.command Outdated Show resolved Hide resolved
@sy6sy2 sy6sy2 added the Type: Fix non-breaking change which fixes an issue label Sep 9, 2020
Fake-signing kodi-topshelf binary is needed to have
Kodi Top Shelf feature working on jailbroken devices.
Fake-signing all other Mach-O files is needed to have
Kodi working on Unc0verTV jailbroken devices.
(But it's not needed on checkra1n devices...)
@sy6sy2
Copy link
Member Author

sy6sy2 commented Sep 13, 2020

Thank you both for your help with this PR.
I will merge it tomorrow if no objection 😉

@sy6sy2 sy6sy2 merged commit d4573ce into xbmc:master Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Build Platform: tvOS Type: Fix non-breaking change which fixes an issue v19 Matrix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants