├── settings.gradle ├── ic_launcher-web.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── app ├── src │ └── main │ │ ├── res │ │ ├── drawable-hdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── styles.xml │ │ │ └── strings.xml │ │ ├── menu │ │ │ └── main.xml │ │ ├── values-fr │ │ │ └── strings.xml │ │ ├── values-nb │ │ │ └── strings.xml │ │ ├── values-pl │ │ │ └── strings.xml │ │ ├── layout-small │ │ │ └── activity_main.xml │ │ ├── layout-xlarge │ │ │ └── activity_main.xml │ │ ├── layout-normal │ │ │ └── activity_main.xml │ │ └── layout-large │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── abcdjdj │ │ └── rootverifier │ │ ├── CheckBusyBox.java │ │ ├── Utils │ │ └── MiscFunctions.java │ │ ├── CheckSuApp.java │ │ ├── CheckRoot.java │ │ └── MainActivity.java ├── lint.xml └── build.gradle ├── .gitignore ├── README ├── gradlew.bat ├── gradlew └── LICENSE.txt /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abcdjdj/RootVerifier-APP/HEAD/ic_launcher-web.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abcdjdj/RootVerifier-APP/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abcdjdj/RootVerifier-APP/HEAD/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abcdjdj/RootVerifier-APP/HEAD/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abcdjdj/RootVerifier-APP/HEAD/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abcdjdj/RootVerifier-APP/HEAD/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #d32f2f 6 | #f44336 7 | 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Oct 21 11:34:03 PDT 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip 7 | -------------------------------------------------------------------------------- /app/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | applicationId "com.abcdjdj.rootverifier" 9 | minSdkVersion 8 10 | targetSdkVersion 23 11 | } 12 | 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile 'com.android.support:appcompat-v7:21.0.+' 23 | } 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/ 38 | 39 | #Keystore files 40 | *.jks 41 | 42 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 15 | 16 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | ROOT VERIFIER 2 | 3 | NOTE :- THIS APP DOES NOT ROOT YOUR DEVICE. IT SIMPLY CHECKS IF IT IS ROOTED. 4 | 5 | This application is a simple app which checks if your Android device has Superuser access ("root") or not. It is a very handy app for those who are new to the world of Android modding. By simply clicking on the check button, users can verify if their Android device is properly rooted or not. Also, users can check if they have busybox installed on their Android device along with the version of busybox. 6 | 7 | To know more about "Rooting" in Android please check this - http://google.about.com/od/socialtoolsfromgoogle/a/root-android-decision.htm 8 | 9 | To know more about busybox, kindly check this - http://en.wikipedia.org/wiki/BusyBox 10 | 11 | XDA Page - http://forum.xda-developers.com/showthread.php?t=2249035 12 | 13 | F-Droid page - https://f-droid.org/repository/browse/?fdid=com.abcdjdj.rootverifier 14 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 12 | 13 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Root Verifier 5 | 6 | ROOT STATUS : NOT YET CHECKED 7 | DEVICE IS ROOTED 8 | NOT ROOTED 9 | ROOT PERMISSION NOT GRANTED OR SUPERUSER APP MISSING 10 | Checking by alternate method 11 | BUSYBOX : NOT YET CHECKED 12 | BUSYBOX INSTALLED : 13 | BUSYBOX NOT INSTALLED OR NOT SYMLINKED 14 | SUPERUSER APP : NOT YET CHECKED 15 | SUPERUSER APP : 16 | 17 | SUPERUSER APP : Unknown 18 | Verifying root.. 19 | Checking, please wait.. 20 | Checking complete 21 | 22 | Welcome! 23 | To verify root access, please click on the Check button. 24 | Rate on Play Store 25 | About 26 | DEVICE : 27 | Exit 28 | Check 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Root Verifier 5 | 6 | STATUT ROOT : NON VÉRIFIÉ 7 | APPAREIL ROOTÉ 8 | APPAREIL NON ROOTÉ 9 | AUTORISATION ROOT NON ACCORDÉE OU APPLICATION SUPERUSER MANQUANTE 10 | Vérification via une méthode alternative 11 | BUSYBOX : NON VÉRIFIÉ 12 | BUSYBOX INSTALLÉ : 13 | BUSYBOX NON INSTALLÉ OU NON LIÉ 14 | APPLICATION SUPERUSER : NON VÉRIFIÉE 15 | APPLICATION SUPERUSER : 16 | 17 | APPLICATION SUPERUSER : Inconnue 18 | Vérification root... 19 | Vérification, veuillez patienter... 20 | Vérification terminée. 21 | 22 | Bienvenue ! 23 | Veuillez appuyer sur le bouton Vérifier pour analyser l\'accès root. 24 | Évaluer 25 | À propos 26 | APPAREIL : 27 | Quitter 28 | Vérifier 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/values-nb/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Root Verifier 5 | 6 | ROOT-STATUS : IKKE SJEKKET ENNÅ 7 | ENHETEN ER ROOTET 8 | IKKE ROOTET 9 | ROOT-TILLATELSE ER IKKE GITT, ELLER SÅ MANGLER SUPERUSER-APPEN 10 | Sjekker med en alternativ metode 11 | BUSYBOX : IKKE SJEKKET ENNÅ 12 | BUSYBOX ER INSTALLERT : 13 | BUSYBOX ER ENTEN IKKE INSTALLERT ELLER IKKE SYSTEMTILKNYTTET 14 | SUPERUSER-APP : IKKE SJEKKET ENNÅ 15 | SUPERUSER-APP : 16 | 17 | SUPERUSER-APP : Unknown 18 | Verifiserer rootingen … 19 | Sjekker, vennligst vent … 20 | Sjekken er fullført 21 | 22 | Velkommen! 23 | For å verifisere root-tilgangen, vennligst klikk på Sjekk-knappen. 24 | Vurder på Play Store 25 | Om 26 | ENHET : 27 | Avslutt 28 | Sjekk 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/values-pl/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Weryfikator Roota 5 | 6 | STATUS ROOT: JESZCZE NIE SPRAWDZONO 7 | URZĄDZENIE JEST ZROOTOWANE 8 | NIE ZROOTOWANO 9 | UPRAWNIENIA ROOTA NIE ZOSTAŁY PRZYZNANE LUB BRAKUJE APLIKACJI SUPERUSER 10 | Sprawdzanie alternatywną metodą 11 | BUSYBOX: JESZCZE NIE SPRAWDZONO 12 | ZAINSTALOWANY BUSYBOX : 13 | BUSYBOX NIE ZAINSTALOWANY LUB NIE POŁĄCZONY 14 | APLIKACJA SUPERUSER : JESZCZE NIE SPRAWDZONO 15 | APLIKACJA SUPERUSER : 16 | 17 | APLIKACJA SUPERUSER: Nieznana 18 | Sprawdzanie roota 19 | Sprawdzanie, proszę czekać.. 20 | Sprawdzanie zakończone 21 | 22 | Witamy! 23 | Żeby zweryfikować uprawnienia root, proszę dotknąć przycisku Sprawdź. 24 | Oceń w Sklepie Play 25 | O 26 | URZĄDZENIE : 27 | Wyjdź 28 | Sprawdź 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/abcdjdj/rootverifier/CheckBusyBox.java: -------------------------------------------------------------------------------- 1 | /** 2 | Root Verifier - Android App 3 | Copyright (C) 2014 Madhav Kanbur 4 | 5 | This file is a part of Root Verifier. 6 | 7 | Root Verifier is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 2 of the License, or 10 | (at your option) any later version. 11 | 12 | Root Verifier is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Root Verifier. If not, see .*/ 19 | 20 | package com.abcdjdj.rootverifier; 21 | 22 | import static com.abcdjdj.rootverifier.Utils.MiscFunctions.activity; 23 | import static com.abcdjdj.rootverifier.Utils.MiscFunctions.setText; 24 | 25 | import java.util.Scanner; 26 | 27 | import android.widget.TextView; 28 | 29 | public class CheckBusyBox implements Runnable { 30 | Thread t; 31 | 32 | CheckBusyBox() { 33 | t = new Thread(this, "CheckBusyBox"); 34 | t.start(); 35 | } 36 | 37 | @Override 38 | public void run() { 39 | busybox(); 40 | } 41 | 42 | private static void busybox() { 43 | TextView z = (TextView) activity.findViewById(R.id.busybox); 44 | char n[] = null; 45 | String line = null; 46 | 47 | try { 48 | 49 | Process p = Runtime.getRuntime().exec("busybox"); 50 | Scanner in = new Scanner(p.getInputStream()); 51 | 52 | busybox: while (in.hasNextLine()) { 53 | line = in.nextLine(); 54 | n = line.toCharArray(); 55 | 56 | for (char c : n) { 57 | 58 | if (Character.isDigit(c)) { 59 | break busybox; 60 | 61 | } 62 | } 63 | 64 | } 65 | 66 | in.close(); 67 | setText(z, new StringBuilder(activity.getString(R.string.yes_busybox)).append(" ").append(line)); 68 | 69 | } catch (Exception e) { 70 | setText(z, activity.getString(R.string.no_busybox)); 71 | } 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /app/src/main/java/com/abcdjdj/rootverifier/Utils/MiscFunctions.java: -------------------------------------------------------------------------------- 1 | /** 2 | Root Verifier - Android App 3 | Copyright (C) 2014 Madhav Kanbur 4 | 5 | This file is a part of Root Verifier. 6 | 7 | Root Verifier is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 2 of the License, or 10 | (at your option) any later version. 11 | 12 | Root Verifier is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Root Verifier. If not, see .*/ 19 | 20 | package com.abcdjdj.rootverifier.Utils; 21 | 22 | import android.content.ActivityNotFoundException; 23 | import android.content.Intent; 24 | import android.net.Uri; 25 | import android.widget.TextView; 26 | import android.widget.Toast; 27 | 28 | import com.abcdjdj.rootverifier.MainActivity; 29 | import com.abcdjdj.rootverifier.R; 30 | 31 | public class MiscFunctions { 32 | public static MainActivity activity; 33 | 34 | public synchronized static void setText(final TextView t, final CharSequence x) { 35 | 36 | Runnable r = new Runnable() { 37 | @Override 38 | public void run() { 39 | t.setText(x); 40 | t.invalidate(); 41 | 42 | } 43 | }; 44 | activity.runOnUiThread(r); 45 | try { 46 | Thread.sleep(800); 47 | } catch (Exception e) { 48 | } 49 | } 50 | 51 | public synchronized static void showToast(final CharSequence x) { 52 | 53 | Runnable r = new Runnable() { 54 | @Override 55 | public void run() { 56 | Toast.makeText(activity, x, Toast.LENGTH_LONG).show(); 57 | } 58 | }; 59 | activity.runOnUiThread(r); 60 | } 61 | 62 | public static void setDeviceName() { 63 | TextView c = (TextView) activity.findViewById(R.id.devicemodel); 64 | 65 | StringBuilder x = new StringBuilder(activity.getString(R.string.dev_name)); 66 | x.append(" ").append(android.os.Build.MANUFACTURER).append(" ") 67 | .append(android.os.Build.MODEL); 68 | 69 | c.setText(x); 70 | 71 | } 72 | 73 | public static void rateOnPS() { 74 | Intent intent = null; 75 | try { 76 | intent = new Intent(Intent.ACTION_VIEW, 77 | Uri.parse("market://details?id=com.abcdjdj.rootverifier")); 78 | activity.startActivity(intent); 79 | } catch (ActivityNotFoundException e) { 80 | intent = new Intent( 81 | Intent.ACTION_VIEW, 82 | Uri.parse("https://play.google.com/store/apps/details?id=com.abcdjdj.rootverifier")); 83 | activity.startActivity(intent); 84 | } catch (Exception ex) { 85 | Toast.makeText(activity, "Unknown error occured", Toast.LENGTH_LONG) 86 | .show(); 87 | 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /app/src/main/java/com/abcdjdj/rootverifier/CheckSuApp.java: -------------------------------------------------------------------------------- 1 | /** 2 | Root Verifier - Android App 3 | Copyright (C) 2014 Madhav Kanbur 4 | 5 | This file is a part of Root Verifier. 6 | 7 | Root Verifier is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 2 of the License, or 10 | (at your option) any later version. 11 | 12 | Root Verifier is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Root Verifier. If not, see .*/ 19 | 20 | package com.abcdjdj.rootverifier; 21 | 22 | import static com.abcdjdj.rootverifier.Utils.MiscFunctions.activity; 23 | import static com.abcdjdj.rootverifier.Utils.MiscFunctions.setText; 24 | 25 | import java.io.BufferedReader; 26 | import java.io.InputStreamReader; 27 | 28 | import android.content.pm.ApplicationInfo; 29 | import android.content.pm.PackageInfo; 30 | import android.content.pm.PackageManager; 31 | import android.widget.TextView; 32 | 33 | public class CheckSuApp implements Runnable { 34 | Thread t; 35 | 36 | CheckSuApp() { 37 | t = new Thread(this, "CheckSuApp"); 38 | t.start(); 39 | } 40 | 41 | @Override 42 | public void run() { 43 | su_app(); 44 | } 45 | 46 | private static void su_app() { 47 | TextView su_app = (TextView) activity.findViewById(R.id.su_app); 48 | 49 | final String[] packages = { "eu.chainfire.supersu", 50 | "eu.chainfire.supersu.pro", "com.koushikdutta.superuser", 51 | "com.noshufou.android.su", "com.dianxinos.superuser", "com.kingouser.com", 52 | "com.mueskor.superuser.su" , "org.masteraxe.superuser", "com.yellowes.su" , 53 | "com.kingroot.kinguser"}; 54 | PackageManager pm = activity.getPackageManager(); 55 | int i, l = packages.length; 56 | String superuser = null; 57 | 58 | for (i = 0; i < l; i++) { 59 | try { 60 | ApplicationInfo info = pm.getApplicationInfo(packages[i], 0); 61 | PackageInfo info2 = pm.getPackageInfo(packages[i], 0); 62 | superuser = pm.getApplicationLabel(info).toString() + " " 63 | + info2.versionName; 64 | break; 65 | } catch (PackageManager.NameNotFoundException e) { 66 | continue; 67 | } 68 | } 69 | 70 | if (superuser != null) { 71 | setText(su_app, activity.getString(R.string.su_app) + " " + superuser); 72 | } else { 73 | su_alternative(su_app); 74 | } 75 | } 76 | 77 | private static void su_alternative(TextView su_app) { 78 | String line; 79 | try { 80 | Process p = Runtime.getRuntime().exec("su -v");// Superuser version 81 | InputStreamReader t = new InputStreamReader(p.getInputStream()); 82 | BufferedReader in = new BufferedReader(t); 83 | line = in.readLine(); 84 | 85 | char[] chars = line.toCharArray(); 86 | boolean flag = false;// Check if su -v returns the package name 87 | // instead of just the version number 88 | for (char c : chars) { 89 | if (Character.isLetter(c)) { 90 | flag = true; 91 | } 92 | } 93 | if (!flag) { 94 | line = activity.getString(R.string.app_unknown); 95 | setText(su_app, line); 96 | } 97 | else { 98 | setText(su_app, activity.getString(R.string.su_app) + " " + line); 99 | } 100 | } catch (Exception e) { 101 | line = activity.getString(R.string.app_unknown); 102 | setText(su_app, line); 103 | } 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /app/src/main/res/layout-small/activity_main.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | 14 | 19 | 20 | 28 | 29 | 40 |