mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-11-15 17:13:30 +00:00
Add search bar & Magisk Hide option
This commit is contained in:
@@ -200,7 +200,7 @@ public class Async {
|
||||
InputStream in = mContext.getContentResolver().openInputStream(mUri);
|
||||
mFile = new File(mContext.getCacheDir().getAbsolutePath() + "/install.zip");
|
||||
mFile.delete();
|
||||
Utils.removeFile(mFile.getPath());
|
||||
Utils.removeItem(mFile.getPath());
|
||||
createFileFromInputStream(in, mFile);
|
||||
in.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
@@ -273,7 +273,7 @@ public class Async {
|
||||
}
|
||||
}
|
||||
if (mFile != null && mFile.exists() && !mFile.delete()) {
|
||||
Utils.removeFile(mFile.getPath());
|
||||
Utils.removeItem(mFile.getPath());
|
||||
}
|
||||
if (ret != null && Boolean.parseBoolean(ret.get(ret.size() - 1))) {
|
||||
return 1;
|
||||
|
||||
@@ -7,13 +7,11 @@ import android.content.IntentFilter;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Environment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.util.Base64;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.topjohnwu.magisk.MagiskFragment;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.receivers.DownloadReceiver;
|
||||
|
||||
@@ -68,8 +66,8 @@ public class Utils {
|
||||
return Shell.rootAccess() && Boolean.parseBoolean(Shell.su(command).get(0));
|
||||
}
|
||||
|
||||
public static boolean removeFile(String path) {
|
||||
String command = "rm -f " + path + " 2>/dev/null; if [ -f " + path + " ]; then echo false; else echo true; fi";
|
||||
public static boolean removeItem(String path) {
|
||||
String command = "rm -rf " + path + " 2>/dev/null; if [ -e " + path + " ]; then echo false; else echo true; fi";
|
||||
return Shell.rootAccess() && Boolean.parseBoolean(Shell.su(command).get(0));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user