Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. package com.logicvoid.rosiesettingsz;
  2.  
  3. import android.content.Context;
  4. import android.util.Log;
  5.  
  6. import com.logicvoid.rosiesettingsz.ShellCommand.CommandResult;
  7.  
  8. public class KangDetection {
  9.     private static final String TAG = "KangDetection";
  10.    
  11.     public static Boolean isKanged()
  12.     {
  13.         Boolean returnValue = false;
  14.         ShellCommand cmd = new ShellCommand();
  15.         CommandResult r = cmd.sh.runWaitFor("getprop ro.build.description");
  16.        
  17.         if (!r.success()) {
  18.               Log.v(TAG, "Error " + r.stderr);
  19.             } else {
  20.               String stdout = r.stdout;
  21.              
  22.               if(stdout.contains("Synergy"))
  23.               {
  24.                   returnValue = false;
  25.               }
  26.               else
  27.               {
  28.                   returnValue = true;
  29.               }
  30.              
  31.                 Log.v(TAG, "Success! " + r.stdout);  
  32.              
  33.             }
  34.        
  35.        
  36.         return returnValue;
  37.        
  38.        
  39.     }
  40.    
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement