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

Add support for Linux/jailbroken iOS/Windows platforms #9

Open
Antonn1 opened this issue Jan 10, 2017 · 34 comments
Open

Add support for Linux/jailbroken iOS/Windows platforms #9

Antonn1 opened this issue Jan 10, 2017 · 34 comments

Comments

@Antonn1
Copy link

Antonn1 commented Jan 10, 2017

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.

@kabiroberai
Copy link
Owner

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
Copy link
Owner

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.

@citrusui
Copy link

@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.

@kabiroberai
Copy link
Owner

@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?

@citrusui
Copy link

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.

@kirb
Copy link

kirb commented Aug 13, 2017

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.

@Antonn1
Copy link
Author

Antonn1 commented Nov 1, 2017

any update on this? :)

@kabiroberai
Copy link
Owner

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 kabiroberai changed the title Possible to make this work on iOS file system? Add support for Linux/jailbroken iOS/Windows platforms Dec 15, 2017
@Antonn1
Copy link
Author

Antonn1 commented Dec 17, 2017

can't wait! :) :)

@Antonn1
Copy link
Author

Antonn1 commented Feb 19, 2018

any updates on this? :)

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

@kabiroberai
Copy link
Owner

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.

@Antonn1
Copy link
Author

Antonn1 commented Mar 30, 2018

how about now @kabiroberai?

hope all exams are good :)

@kabiroberai
Copy link
Owner

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

@kabiroberai
Copy link
Owner

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
Copy link
Owner

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.

@Antonn1
Copy link
Author

Antonn1 commented Apr 2, 2018

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

@kabiroberai
Copy link
Owner

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

@kirb
Copy link

kirb commented Apr 4, 2018

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

@kabiroberai
Copy link
Owner

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

@kabiroberai
Copy link
Owner

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

@Antonn1
Copy link
Author

Antonn1 commented Apr 25, 2018

not possible? :(

@kabiroberai
Copy link
Owner

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

@TheArmKing
Copy link

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

@syto203
Copy link

syto203 commented May 26, 2019

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?

@Al4ise
Copy link

Al4ise commented Apr 22, 2022

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.

@syto203
Copy link

syto203 commented Apr 22, 2022

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

And the PR here #73

@Al4ise
Copy link

Al4ise commented Apr 23, 2022

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

@syto203
Copy link

syto203 commented Apr 23, 2022

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@58a4f68

@kirb
Copy link

kirb commented Apr 23, 2022

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.

@kabiroberai
Copy link
Owner

kabiroberai commented Apr 23, 2022

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.

@kirb
Copy link

kirb commented May 4, 2022

@kabiroberai It can do mutation if I remember right, but it is intriguing to consider using Swift for it. Both ways should work.

@Nosskirneh
Copy link

I looked briefly and it seemed like ply did not support mutation, so I put together this piece:
https://github.com/Nosskirneh/plister

I'm not sure the best way to integrate it into theos-jailed, so for my own use-case I'll just place it in the PATH and use a fork of theos-jailed at the moment. Feel free to integrate it the way you see fit.

@L1ghtmann
Copy link

L1ghtmann commented Dec 15, 2023

I haven't given it a go yet, but recently stumbled across simplistic by JLevin which supposedly has both plutil and PlistBuddy functionality bundled into one and is cross-platform.

@Nosskirneh
Copy link

My brother and I fixed Linux compatibility in our fork: https://github.com/totteCh/theos-jailed

We also pushed a docker image with theos and theos-jailed for CI/CD: https://github.com/Nosskirneh/theos-docker/tree/for-ci
https://hub.docker.com/r/nosskirneh/theos-docker

Maybe it’s useful for someone 🤷‍♂️

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

No branches or pull requests

9 participants