You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Remove module helper
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.topjohnwu.magisk.utils;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.DownloadManager;
|
||||
import android.content.Context;
|
||||
import android.content.IntentFilter;
|
||||
@@ -15,6 +16,7 @@ import android.widget.Toast;
|
||||
|
||||
import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.asyncs.LoadRepos;
|
||||
import com.topjohnwu.magisk.receivers.DownloadReceiver;
|
||||
|
||||
import java.io.File;
|
||||
@@ -152,4 +154,16 @@ public class Utils {
|
||||
}
|
||||
}.requestTest();
|
||||
}
|
||||
|
||||
public static void clearRepoCache(Activity activity) {
|
||||
MagiskManager magiskManager = getMagiskManager(activity);
|
||||
SharedPreferences repoMap = activity.getSharedPreferences(LoadRepos.FILE_KEY, Context.MODE_PRIVATE);
|
||||
repoMap.edit()
|
||||
.remove(LoadRepos.ETAG_KEY)
|
||||
.remove(LoadRepos.VERSION_KEY)
|
||||
.apply();
|
||||
magiskManager.repoLoadDone.isTriggered = false;
|
||||
new LoadRepos(activity).exec();
|
||||
Toast.makeText(activity, R.string.repo_cache_cleared, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user