Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,25 @@ materialThemeBuilder {
themes {
for ((name, color) in
listOf(
"Red" to "F44336",
"Pink" to "E91E63",
"Purple" to "9C27B0",
"DeepPurple" to "673AB7",
"Indigo" to "3F51B5",
"Blue" to "2196F3",
"LightBlue" to "03A9F4",
"Cyan" to "00BCD4",
"Teal" to "009688",
"Green" to "4FAF50",
"LightGreen" to "8BC3A4",
"Lime" to "CDDC39",
"Yellow" to "FFEB3B",
"Amber" to "FFC107",
"Orange" to "FF9800",
"DeepOrange" to "FF5722",
"Brown" to "795548",
"BlueGrey" to "607D8F",
"Sakura" to "FF9CA8",
"Red" to "FF0000",
"Pink" to "FFC0CB",
"Purple" to "800080",
"DeepPurple" to "36013F",
"Indigo" to "4B0082",
"Blue" to "0000FF",
"LightBlue" to "ADD8E6",
"Cyan" to "00FFFF",
"Teal" to "008080",
"Green" to "008000",
"LightGreen" to "90EE90",
"Lime" to "00FF00",
"Yellow" to "FFFF00",
"Amber" to "FFBF00",
"Orange" to "FFA500",
"DeepOrange" to "FF8C00",
"Brown" to "964B00",
"BlueGrey" to "6A89A7",
"Sakura" to "FCC9B9",
)) {
create("Material$name") {
lightThemeFormat = "ThemeOverlay.Light.%s"
Expand All @@ -113,7 +113,7 @@ materialThemeBuilder {
// Add Material Design 3 color tokens (such as palettePrimary100) in generated theme
// rikka.material:material >= 2.0.0 provides such attributes
// Enable this if your are using rikka.material:material
generatePalette = true
generatePalette = false
}

dependencies {
Expand Down
60 changes: 20 additions & 40 deletions app/src/main/java/org/lsposed/manager/repo/RepoLoader.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
/*
* This file is part of LSPosed.
*
* LSPosed is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LSPosed is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
*
* Copyright (C) 2020 EdXposed Contributors
* Copyright (C) 2021 LSPosed Contributors
*/
* This file is part of Vector.
*
* Vector is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation.
*
* Vector is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty
* OF MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more information, see the
* GNU General Public License.
*
* You should have received a copy of the GNU General Public License
* along with Vector. Otherwise, see <https://www.gnu.org/licenses/>.
*
* Copyright (C) 2026 by EdXposed contributors
* Copyright (C) 2026 by Vector contributors
*/

package org.lsposed.manager.repo;

Expand Down Expand Up @@ -76,11 +75,7 @@ public boolean upgradable(long versionCode, String versionName) {
private final Path repoFile = Paths.get(App.getInstance().getFilesDir().getAbsolutePath(), "repo.json");
private final Set<RepoListener> listeners = ConcurrentHashMap.newKeySet();
private boolean repoLoaded = false;
private static final String originRepoUrl = "https://modules.lsposed.org/";
private static final String backupRepoUrl = "https://modules-blogcdn.lsposed.org/";

private static final String secondBackupRepoUrl = "https://modules-cloudflare.lsposed.org/";
private static String repoUrl = originRepoUrl;
private static final String repoUrl = "https://backup.modules.lsposed.org/";
private final Resources resources = App.getInstance().getResources();
private final String[] channels = resources.getStringArray(R.array.update_channel_values);

Expand Down Expand Up @@ -122,13 +117,6 @@ synchronized public void loadRemoteData() {
for (RepoListener listener : listeners) {
listener.onThrowable(e);
}
if (repoUrl.equals(originRepoUrl)) {
repoUrl = backupRepoUrl;
loadRemoteData();
} else if (repoUrl.equals(backupRepoUrl)) {
repoUrl = secondBackupRepoUrl;
loadRemoteData();
}
}
}

Expand Down Expand Up @@ -252,16 +240,8 @@ public void loadRemoteReleases(String packageName) {
@Override
public void onFailure(@NonNull Call call, @NonNull IOException e) {
Log.e(App.TAG, call.request().url() + e.getMessage());
if (repoUrl.equals(originRepoUrl)) {
repoUrl = backupRepoUrl;
loadRemoteReleases(packageName);
} else if (repoUrl.equals(backupRepoUrl)) {
repoUrl = secondBackupRepoUrl;
loadRemoteReleases(packageName);
} else {
for (RepoListener listener : listeners) {
listener.onThrowable(e);
}
for (RepoListener listener : listeners) {
listener.onThrowable(e);
}
}

Expand Down
Loading