Posted on

Android root device

stackoverflow

[code language=”java”]
public class RootUtil {
public static boolean isDeviceRooted() {
return checkRootMethod1() || checkRootMethod2() || checkRootMethod3();
}

private static boolean checkRootMethod1() {
String buildTags = android.os.Build.TAGS;
return buildTags != null && buildTags.contains("test-keys");
}

private static boolean checkRootMethod2() {
String[] paths = { "/system/app/Superuser.apk", "/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", "/su/bin/su"};
for (String path : paths) {
if (new File(path).exists()) return true;
}
return false;
}

private static boolean checkRootMethod3() {
Process process = null;
try {
process = Runtime.getRuntime().exec(new String[] { "/system/xbin/which", "su" });
BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
if (in.readLine() != null) return true;
return false;
} catch (Throwable t) {
return false;
} finally {
if (process != null) process.destroy();
}
}
}
[/code]

Posted on

S.O.L.I.D.

https://dzone.com/articles/solid-is-oop-for-dummies

Posted on

Fibonacci numbers

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946

cc9a336d6642813692cfc4b106268c15

also f4690f25797e8a37345cb0669a6ec988

Matrix method:

b0d427e01d22ebe23e5d6da73429625e

It is interesting to note that the Fibonacci number grows so fast that F-47 exceeds the 32-bit signed integer range.

Binet’s formula

e92bcac0f1049c23c4c0180f04b7567bwhere

5b338aa4be320754bbb52976818e89a8golden ratio = 1.618

Procent ratio is 62% and 38%

as