OSDN Git Service

check file exists
authorKoushik Dutta <koushd@gmail.com>
Sun, 3 Mar 2013 12:22:53 +0000 (04:22 -0800)
committerKoushik Dutta <koushd@gmail.com>
Sun, 3 Mar 2013 12:22:53 +0000 (04:22 -0800)
Change-Id: Ibe0197537bd8e74f7098cd01bae3ffc1dbf134e9

Superuser/src/com/koushikdutta/superuser/MainActivity.java

index 4b96023..3454049 100644 (file)
@@ -88,6 +88,8 @@ public class MainActivity extends BetterListActivity {
                     zout.close();
 
                     final File libsu = new File(getApplicationInfo().dataDir, "lib/libsu.so");
+                    if (!libsu.exists())
+                        throw new Exception(libsu.getAbsolutePath() + " not found");
 
                     String command =
                             String.format("cat %s > /cache/superuser.zip\n", zip.getAbsolutePath()) +