Delete scope list file if no app

This commit is contained in:
NekoInverter 2020-11-22 11:50:11 +08:00
parent a2f40cf27a
commit ec08cc85e6
No known key found for this signature in database
GPG Key ID: 280D6CCCF95715F9
1 changed files with 3 additions and 0 deletions

View File

@ -353,6 +353,9 @@ public class AppHelper {
@SuppressLint("WorldReadableFiles")
static boolean saveScopeList(String modulePackageName, List<String> list) {
File file = new File(BASE_PATH + String.format(SCOPE_LIST_PATH, modulePackageName));
if (list.size() == 0) {
return file.delete();
}
try {
PrintWriter pr = new PrintWriter(new FileWriter(file));
for (String line : list) {