theos-jailed icon indicating copy to clipboard operation
theos-jailed copied to clipboard

Add support for Linux/jailbroken iOS/Windows platforms

Open Antonn1 opened this issue 8 years ago • 34 comments

The code uses some 'tools' which may only be available on Mac such as PlistBuddy.

but would it be possible if we can replace the files that aren't available on ios to alternatives? plistbuddy to sed for example.

Antonn1 avatar Jan 10 '17 11:01 Antonn1

Unfortunately, some of the tools used (such as insert_dylib) aren't built for arm architectures, and don't have a replacement. If you can find a way around this, I may be able to add iOS support. Pull requests are welcome.

kabiroberai avatar Jan 11 '17 12:01 kabiroberai

I recently managed to port insert_dylib to iOS, so I might be able to convert the entire project some time in the future. However, another issue would still remain of porting the bash scripts from BSD to GNU. Again, if anyone could help me do that, it would definitely speed up the process and would be greatly appreciated.

kabiroberai avatar May 25 '17 18:05 kabiroberai

@kabiroberai converting bash scripts to/from GNU is pretty easy -- you just need to know the differences between the various utilities (cp, mv, echo, etc.). I can provide assistance if need be.

citrusui avatar Aug 12 '17 21:08 citrusui

@citrusui thanks, I'd definitely appreciate that as I haven't had much experience with GNU flavoured bash.

As a follow up to the comments by you and @kirb in #28 (about plutil alternatives on iOS), do any of them support conversion from the NextStep format?

kabiroberai avatar Aug 13 '17 03:08 kabiroberai

As kirb mentioned, Erica Utilities has its own version of plutil. I don’t have a device to test with, so I really have no idea. kirb probably knows... he knows everything :P

btw, I’ll be going on a trip this week and won’t have access to my laptop. i won’t be able contribute anything until then.

citrusui avatar Aug 13 '17 13:08 citrusui

CF can read NeXTSTEP, XML, and binary plists; and write XML and binary (but not NeXT). plutil is just using CoreFoundation/Foundation so it has the same behavior.

kirb avatar Aug 13 '17 13:08 kirb

any update on this? :)

Antonn1 avatar Nov 01 '17 04:11 Antonn1

Hey @Antonn1, I’m going to be busy until March with school stuff, but after that I’ll definitely have some time to work on Theos Jailed.

I’m also making an app called Supercharge that lets you make tweaks on non-jailbroken devices (which is why I had to port insert_dylib to iOS). Once that’s out, it’ll hopefully pave the way for more improvements to Theos Jailed too.

kabiroberai avatar Nov 08 '17 07:11 kabiroberai

can't wait! :) :)

Antonn1 avatar Dec 17 '17 00:12 Antonn1

any updates on this? :)

its been 1 year since the suggestion and march is very close :)

Antonn1 avatar Feb 19 '18 17:02 Antonn1

March 26th is the date of my last exam, so I’ll try porting Theos Jailed after that. I finally jailbroke my 7 Plus (Electra RC1.3 via coolstar) which means that it’ll be easier for me to confirm that it works.

kabiroberai avatar Feb 20 '18 07:02 kabiroberai

how about now @kabiroberai?

hope all exams are good :)

Antonn1 avatar Mar 30 '18 14:03 Antonn1

Exams went well, I’m going to take out some time to work on this soon

kabiroberai avatar Mar 30 '18 14:03 kabiroberai

I've been thinking about this, and I've realised that Theos Jailed can't fully work on other OSes yet since they don't have codesign. There are alternatives, but they're either outdated or closed-source, which means I can't use them in this project. This means that on other operating systems you'll probably have to sideload the patched app with Impactor yourself, i.e. make install won't work.

kabiroberai avatar Apr 02 '18 12:04 kabiroberai

I've made ./install work correctly on iOS with 3cb40dc, however I still have to modify a few more things before the entire project works on jailbroken iOS. The main hurdle at the moment is finding an alternative to PlistBuddy, so I'd appreciate help regarding that.

kabiroberai avatar Apr 02 '18 13:04 kabiroberai

i think sed will work? sed is available on most OS unlike plutil :)

Antonn1 avatar Apr 02 '18 16:04 Antonn1

sed isn't built to parse complex plist files though. Perhaps I could use a regular XML parser instead.

kabiroberai avatar Apr 04 '18 07:04 kabiroberai

Ideally should use libplist for all plist reads/writes even if XML.

kirb avatar Apr 04 '18 07:04 kirb

Hmm, has anyone cross-compiled it for iOS yet? Seems promising

kabiroberai avatar Apr 04 '18 08:04 kabiroberai

Looks like the cli doesn't provide all the functionality I need :/

kabiroberai avatar Apr 04 '18 08:04 kabiroberai

not possible? :(

Antonn1 avatar Apr 25 '18 21:04 Antonn1

It's possible, but somebody will need to create a viable alternative to PlistBuddy first

kabiroberai avatar Apr 27 '18 14:04 kabiroberai

xmllint is in-built and can read plist files, syntax is same as the MacOS terminal, if ya need assistance :)

TheArmKing avatar Sep 13 '18 16:09 TheArmKing

hope everything is well. i know you are mostly focused on "Supercharge" now, still i gotta ask if you got to updating/find alternatives to the required tools in order for theos-jailed to work on iOS?

syto203 avatar May 26 '19 21:05 syto203

About 4 years late to the issue, but I had to deal with the same problem a while ago so I thought I might as well share what I found:

For Linux, https://github.com/withgraphite/plutil has a version of PlistBuddy written with cross-platform use in mind

For iOS, these 3 functions that are just wrappers for Sam Bingner’s plutil for iOS seem to work fine.

RemovePlistKey () { plutil -remove -key "$1" "$2" &>/dev/null }

$1 is the plist key $2 is the plist file

ReplacePlistValue () { plutil -value "$1" -key "$2" "$3" &>/dev/null }

$1 is the new value for the key $2 is the plist key $3 is the plist file

ExtractPlistValue () { plutil -key "$1" "$2" &>/dev/null }

$1 is the plist key $2 is the plist file

The solution I have used in Azule (https://github.com/Al4ise/Azule), for example is to use a different set of these 3 functions for ios and macOS/Linux. On macOS and Linux, they would be wrappers of PlistBuddy, and on iOS - of plutil. I might try to make a pull request on the topic in the near future, but I wanted to see if anyone would find any problems in the concept first.

Al4ise avatar Apr 22 '22 15:04 Al4ise

I already built my own solution for it until kabiroberai build a native solution. Syto203/theos-jailed@ a71d0bfa12dfb0f20325f179a43069554078d8e2

And the PR here #73

syto203 avatar Apr 22 '22 16:04 syto203

Oh well, yeah maybe it's a bit better than using that unofficial plutil. Good job! Looks great

Al4ise avatar Apr 23 '22 06:04 Al4ise

For Linux you might need to adjust the “sed” command since it might not work nicely with all distros. For example in arch u can use this one syto203/theos-jailed@58a4f68ee0c2f40494a5df5e048b9606491afde7

syto203 avatar Apr 23 '22 06:04 syto203

In Theos core we came across a similar issue of not having a cross-platform plutil available, theos/theos#134, and we’re probably going to solve it by using DHowett’s ply (likely on all platforms). Perhaps Theos could put ply in $THEOS/bin so it’s available on $PATH for theos-jailed to use.

kirb avatar Apr 23 '22 07:04 kirb

does ply allow mutation or is it read-only? Theos Jailed uses PlistBuddy to set keys so we definitely need something with write support. Another option worth mentioning is Swift, which has support for modifying plists even on Linux via PropertyList[Serialization/Encoder/Decoder] in Foundation. Since we’re already building a system to bootstrap Swift-based support tools for Orion, we could do the same here. And in the process, modernising Theos Jailed’s Swift support would be a nice bonus — especially if it can be made to work with Orion, which should definitely be possible.

kabiroberai avatar Apr 23 '22 07:04 kabiroberai