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
val isSafe = safeToRun( | |
{ banAvdEmulatorCheck() }, | |
{ banGenymotionEmulatorCheck() }, | |
{ banBluestacksEmulatorCheck() }, | |
{ isDebuggableCheck() }, | |
{ rootDetectionCheck() } | |
) | |
if (!isSafe) { | |
throw RuntimeException("Device is not safe to run") |
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
fun saveFile(fileName: String, content: String) { | |
val file = File("/data/is/safe/to/go/here", fileName) | |
val isSafe = file | |
.verifyFile(this) { | |
File("/data/is/safe/to/go/here").allowDirectory() | |
} | |
if (isSafe) { // Without this check - what would happen? Bad things.. | |
file.writeText(content) | |
} |
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
inline fun Context.verifyDevice(): Boolean { | |
val checks = safeToRun( | |
{ banDebugCheck() }, | |
{ blacklistedAppCheck("com.abc") }, | |
{ safeToRunCombinedCheck( | |
listOf { minOsVersionCheck(31) }, | |
listOf { minOsVersionCheck(30) } | |
) | |
}, | |
{ verifySignatureCheck("ABASDASD", "BBBBBBB") }, |
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
fun mySecureFunction(websiteUrl : String) { | |
val isSafe = websiteUrl.urlVerification { | |
"safetorun.com".allowHost() | |
} | |
if (isSafe) { | |
loadUrl(websiteUrl) | |
} | |
} |
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
if (TuroblinksUrlHandler.contains(url, "/verify?", true)) { | |
C3982h.nullCheck(url, "$this$proceedToParam"); | |
C3982h.nullCheck(url, "$this$extractQueryParam"); | |
C3982h.nullCheck("proceed_to", "queryKey"); | |
String queryParameter = url.toUri().getQueryParameter("proceed_to"); | |
url = queryParameter != null ? UrlKt.parseUrl(queryParameter) : null; | |
C3982h.nullCheck(url); | |
} | |
Intent intent10 = new Intent(context, WebViewActivity.class); |
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
SafeToRun.init( | |
configure { | |
// Root beer (detect root) | |
rootDetection { | |
tolerateRoot = false | |
tolerateBusyBox = true | |
}.error() | |
// Black list certain apps |
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
import SwiftUI | |
import shared | |
class ContentViewProxy : ObservableObject { | |
@Published | |
var listItems : [ListEntry] = [] | |
let repository = DefaultListItemRepository() | |
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
// Set of Material typography styles to start with | |
val typography = Typography( | |
body1 = TextStyle( | |
fontFamily = FontFamily.Default, | |
fontWeight = FontWeight.Normal, | |
fontSize = 16.sp | |
) | |
/* Other default text styles to override | |
button = TextStyle( | |
fontFamily = FontFamily.Default, |
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
val shapes = Shapes( | |
small = RoundedCornerShape(4.dp), | |
medium = RoundedCornerShape(4.dp), | |
large = RoundedCornerShape(0.dp) | |
) |
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
import androidx.compose.ui.graphics.Color | |
val purple200 = Color(0xFFBB86FC) | |
val purple500 = Color(0xFF6200EE) | |
val purple700 = Color(0xFF3700B3) | |
val teal200 = Color(0xFF03DAC5) |
NewerOlder