Highlighted

AIR Jailbreak detection

Community Beginner ,
Nov 04, 2019

Copy link to clipboard

Copied

What is currently the best way to dectect a jailbroken device (Android and iOS) with AIR?

TOPICS
Development

Views

152

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

AIR Jailbreak detection

Community Beginner ,
Nov 04, 2019

Copy link to clipboard

Copied

What is currently the best way to dectect a jailbroken device (Android and iOS) with AIR?

TOPICS
Development

Views

153

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 04, 2019 0
Community Beginner ,
Nov 07, 2019

Copy link to clipboard

Copied

//Android

public function isRooted():String
{
var places:Array = [ "/sbin/su", "/system/bin/su", "/system/xbin/su",
"/data/local/xbin/su", "/data/local/bin/su", "/system/sd/xbin/su", "/system/bin/failsafe/su", "/data/local/su"];

var str:String = checkFilePermission(places);
return str;
}

//iOS

public function isJailbroken():String
{
var places:Array = [ "/Applications/Cydia.app","/Library/MobileSubstrate/MobileSubstrate.dylib","/bin/bash",
"/usr/sbin/sshd","/etc/apt"];
var str:String = checkFilePermission(places);
return str;
}

public function checkFilePermission(places:Array):String
{
var str:String = "FALSE";
var flg:Boolean = false;
var rootFile:File = new File();
if (File.permissionStatus != PermissionStatus.GRANTED)
{
rootFile.addEventListener(PermissionEvent.PERMISSION_STATUS, function(e:PermissionEvent):void {
str = "FALSE";
if (e.status == PermissionStatus.GRANTED)
{
flg = checkFiles(places);
if(flg)
{
str = "TRUE";
}
}else if (e.status == PermissionStatus.DENIED)
{
str = "DENIED";
}

// Dispatch event with str
});

try {
rootFile.requestPermission();
} catch(e:Error)
{
}
}else
{
flg = checkFiles(places);
if(flg)
{
str = "TRUE";
}
}

return str;
}

private function checkFiles(arr:Array):Boolean
{
for each (var s:String in arr )
{
var f:File = new File( s ) ;
if ( f.exists )
{
return true ;
}
}
return false;
}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 07, 2019 0