This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Steps to mark ODR resources | |
// Select file(image, audio, etc) - File inspector - On Demand Resource Tags - Give it a name | |
class ODR_ViewController: UIViewController { | |
var tubbyRequest : NSBundleResourceRequest? | |
@IBOutlet weak var resourceDownloadProgress: UIProgressView! //to show download progress | |
// fileName is the name of the file's ODR tag | |
// if you want to download more than 1 file, change String to [String] | |
func fetchODRResourceWithName(fileName: String) {//to be called when the file needs to be accessed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fileprivate func isDeviceJailbroken() -> Bool { | |
let cydiaPath = "/Applications/Cydia.app" //Cydia is an alternative to Apple's App Store for "jailbroken" devices | |
if FileManager.default.fileExists(atPath: cydiaPath) { | |
return true | |
} | |
let protectedPath = "/private/jailbreak.test" | |
do { | |
try "0".write(toFile: protectedPath, atomically: true, encoding: String.Encoding.utf8) | |
return true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSData *)md5DataFromString:(NSString *)input | |
{ | |
const char *cStr = [input UTF8String]; | |
unsigned char digest[16]; | |
CC_MD5( cStr, (CC_LONG)strlen(cStr), digest ); // This is the md5 call | |
NSData *data = [NSData dataWithBytes:digest length:CC_MD5_DIGEST_LENGTH]; | |
return data; | |
} | |
- (NSString*) doCipher:(NSString*)plainText secretKey:(NSString *)secret operation:(CCOperation)encryptOrDecrypt |