From cbdaa0559af3b8ae9c8cf8287d30916d5f81ee3c Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期四, 05 十一月 2020 13:56:16 +0800
Subject: [PATCH] 调整showlable

---
 app/src/main/java/com/basic/security/utils/LztekAndroidRoot.java |   96 ++++++++++++++++++++++++------------------------
 1 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/app/src/main/java/com/basic/security/utils/LztekAndroidRoot.java b/app/src/main/java/com/basic/security/utils/LztekAndroidRoot.java
index 80a885c..aadbc95 100644
--- a/app/src/main/java/com/basic/security/utils/LztekAndroidRoot.java
+++ b/app/src/main/java/com/basic/security/utils/LztekAndroidRoot.java
@@ -1,54 +1,54 @@
 package com.basic.security.utils;
 
-public class LztekAndroidRoot{
-/* It is sample code for Lztek Android 7.1 and 8.1 root
+public class LztekAndroidRoot {
+    /* It is sample code for Lztek Android 7.1 and 8.1 root
 
      */
     public static void SafeClose(java.io.Closeable closeable) {
-		if (null != closeable) {
-			try {
-				closeable.close();
-			} catch (java.io.IOException e) { 
-			}
-		}
-	}
-	
-	/* The command sequence is like "su root chmod 666 /dev/i2c-1".
-	 * Each command should be executed in this strange way :-)
-	 */
-	
-	public static String SuExec(String command, java.io.File workingDirectory) {
-		if (null == command || (command=command.trim()).length() == 0) { 
-			return null;
-		}
-		if (null == workingDirectory) { 
-			workingDirectory = new java.io.File("/"); 
-		} 
-		java.io.OutputStream out = null;
-		java.io.InputStream in = null;
-		java.io.InputStream err = null;		
-		try {  
-			Runtime runtime = Runtime.getRuntime(); 
-			Process process = runtime.exec("su root " + command, null, workingDirectory); 	
-			StringBuffer inString = new StringBuffer();
-			StringBuffer errString = new StringBuffer();			
-			out = process.getOutputStream();
-   			
-			in = process.getInputStream();  
-			err = process.getErrorStream(); 			
-			while (in.available() > 0) { 
-				inString.append((char)in.read());
-			} 
-			while (err.available() > 0) {  
-				errString.append((char)err.read());
-			} 
-			return inString.toString();
-		} catch (Exception ioex) { 
-			return null;
-		} finally {
-			SafeClose(out);
-			SafeClose(in);
-			SafeClose(err); 
-		}    
-	}
+        if (null != closeable) {
+            try {
+                closeable.close();
+            } catch (java.io.IOException e) {
+            }
+        }
+    }
+
+    /* The command sequence is like "su root chmod 666 /dev/i2c-1".
+     * Each command should be executed in this strange way :-)
+     */
+
+    public static String SuExec(String command, java.io.File workingDirectory) {
+        if (null == command || (command = command.trim()).length() == 0) {
+            return null;
+        }
+        if (null == workingDirectory) {
+            workingDirectory = new java.io.File("/");
+        }
+        java.io.OutputStream out = null;
+        java.io.InputStream in = null;
+        java.io.InputStream err = null;
+        try {
+            Runtime runtime = Runtime.getRuntime();
+            Process process = runtime.exec("su root " + command, null, workingDirectory);
+            StringBuffer inString = new StringBuffer();
+            StringBuffer errString = new StringBuffer();
+            out = process.getOutputStream();
+
+            in = process.getInputStream();
+            err = process.getErrorStream();
+            while (in.available() > 0) {
+                inString.append((char) in.read());
+            }
+            while (err.available() > 0) {
+                errString.append((char) err.read());
+            }
+            return inString.toString();
+        } catch (Exception ioex) {
+            return null;
+        } finally {
+            SafeClose(out);
+            SafeClose(in);
+            SafeClose(err);
+        }
+    }
 }

--
Gitblit v1.8.0