OSDN Git Service

rev version;
[android-x86/external-koush-Superuser.git] / Superuser / src / com / koushikdutta / superuser / MainActivity.java
index 0b6b87a..bd8aee9 100644 (file)
@@ -67,13 +67,8 @@ public class MainActivity extends BetterListActivity {
     }
     
     File extractSu() throws IOException, InterruptedException {
-        Process p = Runtime.getRuntime().exec("cat /proc/cpuinfo");
-        String contents = StreamUtility.readToEnd(p.getInputStream());
-        p.getInputStream().close();
-        p.waitFor();
-        contents = contents.toLowerCase();
         String arch = "armeabi";
-        if (contents.contains("x86"))
+        if (System.getProperty("os.arch").contains("x86") || System.getProperty("os.arch").contains("i686") || System.getProperty("os.arch").contains("i386"))
             arch = "x86";
         ZipFile zf = new ZipFile(getPackageCodePath());
         ZipEntry su = zf.getEntry("assets/" + arch + "/su");
@@ -170,7 +165,7 @@ public class MainActivity extends BetterListActivity {
                             "rm /system/app/SuperUser.*\n" +
                             "rm /system/app/SuperSU.*\n" +
                             String.format("cat %s > /system/xbin/su\n", su.getAbsolutePath()) +
-                            "chmod 6777 /system/xbin/su\n" +
+                            "chmod 6755 /system/xbin/su\n" +
                             "ln -s /system/xbin/su /system/bin/su\n" +
                             "mount -oro,remount /system\n" +
                             "sync\n";
@@ -232,7 +227,7 @@ public class MainActivity extends BetterListActivity {
     }
     
     // this is intentionally not localized as it will change constantly.
-    private static final String WHATS_NEW = "The Superuser binary will show a browser message if Superuser was uninstalled and su is broken.\n\nNotifications can now be configured per app.";
+    private static final String WHATS_NEW = "Added translations.\n\nFixes for x86.";
     protected void doWhatsNew() {
         if (WHATS_NEW.equals(Settings.getString(this, "whats_new")))
             return;
@@ -255,7 +250,7 @@ public class MainActivity extends BetterListActivity {
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
-        Settings.applyDarkThemeSetting(this, R.style.SuperuserDark);
+        Settings.applyDarkThemeSetting(this, R.style.SuperuserDarkActivity);
         super.onCreate(savedInstanceState);
         
         if (Settings.getBoolean(this, "first_run", true)) {