12

I'm building a blacklisting service for cracked iPhone apps and I am curious if I missed a method for detecting cracked apps.

In the moment following app crack detection methods are available for the service:

  1. checking plist size
  2. checking signer identity
  3. checking if binary is crypted (not sure if this is working correctly since no cracked app got detected this way)
  4. checking modified date of info.plist against modified date of package (not sure if this is working - used code like: http://snippie.net/snip/f7530ff2 to do that)

I also wonder if it is possible to check if the device is jailbroken? This would help, too, because the service will work much like a spam blacklist and jailbreak could be used to increase the score.

I have also included a honeypot, which shows me that the tools used by the crackers eliminate some of the checks I do. For instance the plist check for size or signer identity.

My question is now:

  • Are there more "good" checks I should use?

and

  • Is there a way to detect Jailbreak?

Thanks for any help!

4

2 回答 2

18

永远不要试图阻止越狱设备使用你的应用程序,只是破解的。如果您阻止越狱设备,他们将被迫使用已删除所有检查的修补版本。
此外,我的所有设备都已越狱,因此如果开发人员阻止越狱设备,我将不得不忽略他们的应用程序。超过 10% 的 iDevices 都已越狱,所以这是一个非常糟糕的主意。

编辑:由于我对此投了很多反对票,因此我将发布一些检测越狱的方法。

- (BOOL)fileExistsAtPath:(NSString *)path{
    NSLog(@"Check if file '%@' exists", path);

    struct stat buffer;   
    return stat([path UTF8String], &buffer) == 0;
}

- (BOOL)jailbroken{
    return ([self fileExistsAtPath:@"/Applications/Cydia.app"]);
}
于 2011-01-18T21:42:55.393 回答
7
-(IBAction)rootCheck:(id)sender {

    NSArray *jailbrokenPath = [NSArray arrayWithObjects:
                               @"/Applications/Cydia.app",
                               @"/Applications/RockApp.app",
                               @"/Applications/Icy.app",
                               @"/usr/sbin/sshd",
                               @"/usr/bin/sshd",
                               @"/usr/libexec/sftp-server",
                               @"/Applications/WinterBoard.app",
                               @"/Applications/SBSettings.app",
                               @"/Applications/MxTube.app",
                               @"/Applications/IntelliScreen.app",
                               @"/Library/MobileSubstrate/DynamicLibraries/Veency.plist",
                               @"/Applications/FakeCarrier.app",
                               @"/Library/MobileSubstrate/DynamicLibraries/LiveClock.plist",
                               @"/private/var/lib/apt",
                               @"/Applications/blackra1n.app",
                               @"/private/var/stash",
                               @"/private/var/mobile/Library/SBSettings/Themes",
                               @"/System/Library/LaunchDaemons/com.ikey.bbot.plist",
                               @"/System/Library/LaunchDaemons/com.saurik.Cydia.Startup.plist",
                               @"/private/var/tmp/cydia.log",
                               @"/private/var/lib/cydia", nil];

    NSString *rooted;
    for(NSString *string in jailbrokenPath)
        if ([[NSFileManager defaultManager] fileExistsAtPath:string])
            rooted=@"y";
        else
            rooted=@"n";

    NSLog(@"%@", rooted);
}

示例代码: http ://www.evernote.com/shard/s13/sh/e45f27ee-3dd5-4eb1-9f56-1981cdd3286b/bc156eb773315647c13c2c7ee4191866

于 2011-09-15T03:13:12.173 回答