@@ -647,15 +647,15 @@ public static boolean backupSu(Context context, boolean removeOriginal) {
647
647
648
648
os .writeBytes (suTools + " mount -o remount,rw /system\n " );
649
649
String inLine = is .readLine ();
650
- if (!inLine .equals ("0" )) return false ;
650
+ if (inLine == null || !inLine .equals ("0" )) return false ;
651
651
652
652
os .writeBytes (suTools + " cp " + installedSu + " /system/bacon\n " );
653
653
inLine = is .readLine ();
654
- if (!inLine .equals ("0" )) return false ;
654
+ if (inLine == null || !inLine .equals ("0" )) return false ;
655
655
656
656
os .writeBytes (suTools + " chmod 06755 /system/bacon\n " );
657
657
inLine = is .readLine ();
658
- if (!inLine .equals ("0" )) return false ;
658
+ if (inLine == null || !inLine .equals ("0" )) return false ;
659
659
660
660
if (removeOriginal ) {
661
661
os .writeBytes (suTools + " rm " + installedSu + "\n " );
@@ -687,15 +687,15 @@ public static boolean restoreSu(Context context, boolean removeBackup, String ke
687
687
688
688
os .writeBytes (suTools + " mount -o remount,rw /system\n " );
689
689
String inLine = is .readLine ();
690
- if (!inLine .equals ("0" )) return false ;
690
+ if (inLine == null || !inLine .equals ("0" )) return false ;
691
691
692
692
os .writeBytes (suTools + " cp /system/bacon /system/xbin/su\n " );
693
693
inLine = is .readLine ();
694
- if (!inLine .equals ("0" )) return false ;
694
+ if (inLine == null || !inLine .equals ("0" )) return false ;
695
695
696
696
os .writeBytes (suTools + " chmod 06755 /system/xbin/su\n " );
697
697
inLine = is .readLine ();
698
- if (!inLine .equals ("0" )) return false ;
698
+ if (inLine == null || !inLine .equals ("0" )) return false ;
699
699
700
700
if (removeBackup ) {
701
701
os .writeBytes (suTools + " rm /system/bacon\n " );
0 commit comments