Revert "more fixes"

This reverts commit c92f26d65f.
pull/277/head
androidacy-user 1 year ago
parent 2a243e485d
commit 606ff7d778

@ -65,6 +65,18 @@ public final class AndroidacyRepoData extends RepoData {
public AndroidacyRepoData(File cacheRoot, SharedPreferences cachedPreferences, boolean testMode) {
super(testMode ? RepoManager.ANDROIDACY_TEST_MAGISK_REPO_ENDPOINT : RepoManager.ANDROIDACY_MAGISK_REPO_ENDPOINT, cacheRoot, cachedPreferences);
// make sure the modules.json exists
File modulesJson = new File(cacheRoot, "modules.json");
if (!modulesJson.exists()) {
try {
if (!modulesJson.createNewFile()) {
throw new IOException("Failed to create modules.json");
}
} catch (
IOException e) {
e.printStackTrace();
}
}
this.defaultName = "Androidacy Modules Repo";
this.defaultWebsite = RepoManager.ANDROIDACY_MAGISK_REPO_HOMEPAGE;
this.defaultSupport = "https://t.me/androidacy_discussions";

@ -13,7 +13,6 @@ import com.fox2code.mmm.MainApplication;
import com.fox2code.mmm.R;
import com.fox2code.mmm.XRepo;
import com.fox2code.mmm.manager.ModuleInfo;
import com.fox2code.mmm.utils.db.ModuleCache;
import com.fox2code.mmm.utils.io.Files;
import com.fox2code.mmm.utils.io.PropUtils;
@ -48,8 +47,7 @@ public class RepoData extends XRepo {
this.id = RepoManager.internalIdOfUrl(url);
this.cacheRoot = cacheRoot;
this.cachedPreferences = cachedPreferences;
assert ModuleCache.getInstance() != null;
this.metaDataCache = ModuleCache.getInstance().moduleDao();
this.metaDataCache = new File(cacheRoot, "modules.json");
this.moduleHashMap = new HashMap<>();
this.defaultName = url; // Set url as default name
this.forceHide = AppUpdateManager.shouldForceHide(this.id);
@ -61,11 +59,6 @@ public class RepoData extends XRepo {
throw new RuntimeException("Failed to create cache directory");
}
} else {
// ensure module cache db is created
ModuleCache.getInstance().moduleDao();
// get all modules from the db as a json object
//JSONObject modules = new JSONObject();
// TODO: migrate this to db format. Storing the cache in a json file is a bad idea
if (this.metaDataCache.exists()) {
this.lastUpdate = metaDataCache.lastModified();
if (this.lastUpdate > System.currentTimeMillis()) {

@ -28,9 +28,4 @@ public abstract class ModuleCache extends RoomDatabase {
// db structure is: internal name, pretty name, repo url, enabled
// create the database
public abstract <ModuleDao> ModuleDao moduleDao();
// returns the instance
public static ModuleCache getInstance() {
return null;
}
}

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="colorSecondaryContainer" format="color" />
<attr name="colorSecondary" format="color" />
<attr name="colorPrimarySurface" format="color" />
</resources>

@ -15,8 +15,8 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:Reserv
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-` 1party libraries to use AndroidX
android.enableJetifier=true
# Automatically convert third-party libraries to use AndroidX
# android.enableJetifier=true
# Fox builds props mods
org.gradle.parallel=true

Loading…
Cancel
Save