Preface
Recently, I need to recompile an iOS jailbreak plugin named PassBy, and found that it reported errors frequently on my new device, so I recorded the exploration and solution process below.
Since I’m not a professional, and I don’t even know much about iOS development, this is a record of my exploration with the attitude of learning. If there are any mistakes, welcome to criticize and correct in the comment section.
By the way, I would like to advertise my other related article haha:
iOS Jailbreak Plugin PassBy Customization, documenting my attempts to solve PassBy’s non-recognition of Bluetooth wearable devices other than the Apple Watch.
Trying to compile
Firstly
System: macOS Monterey 12.6.5
Chip type: Intel chip, not M series
Xcode version: 14.2
I first tried to compile directly by typing make package
, which prompted openURL has been deprecated.
At this point I guessed that the Xcode version was too high to cause the mismatch, and I was going to go to the source code on GitHub first to see if the author had made any updates. Unfortunately, there was nothing I could do but try to modify the code.
According to the error message I first found the relevant c file, searched for the openURL keyword and commented out the relevant code.
Continue to look for, you can find that this is not affect the main function of the code, should be to perform a donation and source code to open the URL of the operation, because I am not familiar with Objective-C language, the simplest way is to directly comment out, but fortunately does not affect the main function of the plug-in. The two URLs I pasted below:
- Donate (Donate): https://paypal.me/giorgioiavicoli
- Source Code: https://github.com/giorgioiavicoli/PassBy
Secondly
Trying to continue compiling, unsurprisingly, a new problem arises.
This time, the problem is even more difficult, as theos is directly prompted by the Xcode compiler that it cannot find the Message framework.
This problem would not be something I could fix with a simple modification. My guess is that the newer versions of Xcode have discarded the framework, which leaves me with two options: either refactor the code (which would be too difficult for me to do), or switch to an older version of Xcode (which is a bit of an unknown quantity until I get my hands on it, and I can’t guarantee that I’ll be able to fix it).
I can only try to change the Xcode version.
Change the Xcode version
First check the current version, you can see that it is version 14.2.
On the Xcode support page you can clearly see the minimum system requirements for each Xcode version as well as the included SDKs and other information.
Next go to Apple’s official download page about all versions of Xcode and just download an older version. I downloaded version 12.5.1.
The next step is to extract the .xip file, change the name of the extracted Xcode.app to a name like Xcode_12.5.app, and finally move it to the /Application directory.
As you can see in the image above, my old version of Xcode doesn’t open directly, but it doesn’t matter for the purposes of this chapter, we don’t need to open the old version of Xcode directly to operate it. Please read on to find out why.
It takes a while to unpack, so be patient.
Alternatively, you can download and update Xcode in the usual way. With a multi-threaded download tool, you can basically run at full broadband speed and avoid App Store download failures. The disadvantage is that decompression is more time-consuming.
Switch Development
Note that the subtitle of this section is not “Switching Xcode Versions”, because for us, all we need is the scripting tools that come with older versions of Xcode in the development directory, such as gcc and so on.
Next just use this command to switch the xcode-select directory:
|
|
Just change it to your old version of the file name, and enter the password without showing it.
At this point, enter the command again to verify:
|
|
The output of all the above commands can be seen in the words of the name of the old version of Xcode file you chose, something like Xcode_12.5.
Thirdly
Trying to compile again, the problem is finally solved.
|
|
In fact, I tried to restore the above commented out code to normal, but I didn’t realize that it still reported the same error!
I suspected that it might be a problem with the version of Command Line Tools installed. I didn’t try it because I didn’t know what would happen if I installed a lower version of Tools.
Switch Back
|
|
Simply verify it:
Script
Here’s another script shared by others, but I didn’t try it myself, so I’m posting the link here as a thank you.
Link to the article: https://www.cnblogs.com/zndxall/p/12463744.html
Thanks
Xcode installs multiple versions and switches versions automatically