IOS detects device and application cracking

Source: Internet
Author: User

This article references http://www.2cto.com/Article/201303/197244.html

Detect Device cracking

Device jailbreak actually means that you have obtained the highest permissions for all files, but almost all jailbreak users have installed cydia to install plug-ins and software, therefore, you can determine whether the device is jailbroken Based on the apt path and cydia. determines whether the app path exists.

/*** Determine whether the device is jailbroken and the method is based on apt and cydia. * return, yes for jailbroken, no for not */-(bool) isjailbroken {/* cydia. APP */nsstring * cydiapath = @ "/applications/cydia. APP "; if ([[nsfilemanager defaultmanager] fileexistsatpath: cydiapath]) {return yes ;} /* apt */nsstring * aptpath = @ "/private/var/lib/APT/"; if ([[nsfilemanager defaultmanager] fileexistsatpath: aptpath]) {return yes ;} return no ;}
Detect application cracking by comparing the genuine IPA file with the cracked IPA file, two main differences are found after the cracking: 1. the SC _info directory is removed and contains two files: (1) appname. sinf is the metadata file (2) appname. supp is the key to decrypt the executable file. itunesmetadata. the plist file is removed, which is used to record the basic information of the app, such as the purchaser's appleid, APP purchase time, device architecture supported by the app, app version, and app identifier.
/*** Determine whether your app is cracked * return, yes for, no for not */-(bool) ispirated {nsstring * bundlepath = [[nsbundle mainbundle] bundlepath];/* SC _info */If (! [[Nsfilemanager defaultmanager] fileexistsatpath: [nsstring stringwithformat: @ "% @/SC _info", bundlepath]) {return yes;}/* itunesmetadata. plist */If ([[nsfilemanager defaultmanager] fileexistsatpath: [nsstring stringwithformat: @ "% @/itunesmetadata. plist ", bundlepath]) {return yes;} return no ;}


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.