Apple attaches great importance to the security of its products, so it has designed a complex security mechanism for users. This makes programmers who love freedom and advocate openness extremely unhappy, so jailbreaking has become a place where Apple and hackers fight each other repeatedly. In general, jailbreaking allows us to install and share applications at will, but it does reduce the security of the device and provides a convenient door for some malicious applications. Sometimes our application wants to know whether the installed device has been jailbroken. Obviously, Apple officials will not provide a solution, so what should we do? Because cydia will be automatically installed after jailbreaking, we can start from this aspect; we can also use the permission issue to read the list of applications; we can also read environment variables, and machines that are not jailbroken should not be able to read anything. Let's talk about them one by one: 1. Determine common jailbreak files /Applications/Cydia.app /Library/MobileSubstrate/MobileSubstrate.dylib /bin/bash /usr/sbin/sshd /etc/apt This table can be listed as much as possible, and then it can be determined whether it exists. As long as it exists, it can be considered that the machine is jailbroken.
2. Determine the URL scheme of Cydia The URL scheme can be used to call out another application in an application. It is a path to a resource (see "How to Call Out Another Application in iOS" for details). This method is used to determine whether the Cydia application exists.
3. Read the names of all applications in the system This is determined by taking advantage of the fact that non-jailbroken machines do not have this permission.
4. Use the stat method to determine whether cydia exists The idea of this method is to determine the cydia application, but the method uses the stat function and also determines whether there is a dynamic library injected.
5. Read environment variables
Of course, when determining whether a device is jailbroken, you can use multiple methods to ensure accuracy. Here I would also like to say that there are official jailbreaks and non-official jailbreaks, which are not officially guaranteed, so the situation is also complicated and changeable. iOS7 has also improved and upgraded the sandbox mechanism. Some situations may not be suitable for the new version, which still needs to be handled according to the actual situation. In addition, there are some methods such as forking a child thread and looking at the return value, which are not listed here one by one. ***, jailbreaking will increase unsafe factors after all, especially when there are many financial instruments installed, jailbreaking is strongly not recommended. |
<<: Programmer, how serious are you about your work other than writing code?
>>: Write your own Bayesian classifier to classify books
Image source: Tuchong Creative How can I tell the...
Today, taking Volcano as an example, let’s take a...
Why do the giants all want to make short videos? ...
There are many festivals and hot topics in June e...
With rapid breathing and spray of water, the gian...
1. Industry Insights Notice on further strengthen...
: : : : : : : : : : : : : : : : : : : : : : : : : ...
Audit expert: Wang Jinlu Shenzhen Lingkang Techno...
Since Tencent launched WeChat Phonebook, "fr...
Copywriters need to constantly accumulate new wor...
2021 is the first year of the 14th Five-Year Plan...
On the morning of January 9, the 2019 WeChat Open...
When we operate a new APP or product, a common pr...
Activation and recall are also top priorities in ...
Science and Technology Daily reporter Jin Feng A ...