diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644
index 0000000..eb2873e
--- /dev/null
+++ b/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 3b8d292..f44496b 100644
--- a/README.md
+++ b/README.md
@@ -18,3 +18,9 @@
2. 生成SMAPI依赖的文件
3. 修改安装包添加SMAPI的启动代码
4. 签名安装包并发起Mod版游戏的安装
+
+### 下载地址
+
+1. [GitHub](https://github.com/ZaneYork/SMAPI-Android-Installer/releases)
+2. [Coolapk](https://www.coolapk.com/apk/256582)
+3. ~~Google Play~~ 已下架,开发者账户被谷歌无理由关联封禁,从此谷歌一生黑
diff --git a/app/build.gradle b/app/build.gradle
index cebbdd7..3b2f0e0 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -36,6 +36,9 @@ android {
}
compileOptions {
+ // Flag to enable support for the new language APIs
+ coreLibraryDesugaringEnabled true
+ // Sets Java compatibility to Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
@@ -60,14 +63,13 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
- implementation 'com.google.android.material:material:1.1.0'
+ implementation 'com.google.android.material:material:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
- def nav_version = "2.3.0-beta01"
- implementation "androidx.navigation:navigation-fragment:$nav_version"
- implementation "androidx.navigation:navigation-ui:$nav_version"
+ implementation "androidx.navigation:navigation-fragment:2.3.0"
+ implementation "androidx.navigation:navigation-ui:2.3.0"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
// https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on
- implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.65'
+ implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.65.01'
implementation 'com.afollestad.material-dialogs:core:3.3.0'
implementation 'com.afollestad.material-dialogs:input:3.3.0'
implementation 'com.afollestad.material-dialogs:lifecycle:3.3.0'
@@ -83,19 +85,20 @@ dependencies {
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
// https://mvnrepository.com/artifact/commons-io/commons-io
- implementation group: 'commons-io', name: 'commons-io', version: '2.6'
+ implementation group: 'commons-io', name: 'commons-io', version: '2.7'
implementation 'com.lzy.net:okgo:3.0.4'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core
- implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.10.3'
- implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.10.3'
- implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.10.3'
+ implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.11.0'
+ implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.11.0'
+ implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.11.0'
implementation 'com.github.didikee:AndroidDonate:0.1.0'
implementation 'com.hjq:language:3.0'
- implementation 'org.greenrobot:greendao:3.2.2'
- implementation 'net.sourceforge.streamsupport:android-retrostreams:1.7.1'
- testImplementation 'junit:junit:4.12'
+ api 'org.greenrobot:greendao:3.3.0'
+ api 'org.greenrobot:greendao-generator:3.3.0'
+
+ testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.android.support:multidex:1.0.3'
@@ -106,6 +109,7 @@ dependencies {
compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
+ coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10'
api 'com.smart.library.util:bspatch:0.0.2'
}
diff --git a/app/src/main/java/com/android/apksig/DefaultApkSignerEngine.java b/app/src/main/java/com/android/apksig/DefaultApkSignerEngine.java
index fcd0c70..ac3d601 100644
--- a/app/src/main/java/com/android/apksig/DefaultApkSignerEngine.java
+++ b/app/src/main/java/com/android/apksig/DefaultApkSignerEngine.java
@@ -51,9 +51,9 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java9.util.Optional;
+import java.util.Optional;
import java.util.Set;
-import java9.util.stream.StreamSupport;
+import java.util.stream.StreamSupport;
/**
* Default implementation of {@link ApkSignerEngine}.
@@ -438,8 +438,8 @@ public class DefaultApkSignerEngine implements ApkSignerEngine {
isDebuggable(entryName)) {
Optional extractedDigest =
- StreamSupport.stream(V1SchemeVerifier.getDigestsToVerify(
- entry.getValue(), "-Digest", mMinSdkVersion, Integer.MAX_VALUE))
+ V1SchemeVerifier.getDigestsToVerify(
+ entry.getValue(), "-Digest", mMinSdkVersion, Integer.MAX_VALUE).stream()
.filter(d -> d.jcaDigestAlgorithm == alg)
.findFirst();
diff --git a/app/src/main/java/com/android/apksig/internal/apk/ApkSigningBlockUtils.java b/app/src/main/java/com/android/apksig/internal/apk/ApkSigningBlockUtils.java
index 4b9b0c6..32ecbce 100644
--- a/app/src/main/java/com/android/apksig/internal/apk/ApkSigningBlockUtils.java
+++ b/app/src/main/java/com/android/apksig/internal/apk/ApkSigningBlockUtils.java
@@ -30,8 +30,8 @@ import com.android.apksig.util.DataSink;
import com.android.apksig.util.DataSinks;
import com.android.apksig.util.DataSource;
import com.android.apksig.util.DataSources;
-
import com.android.apksig.util.RunnablesExecutor;
+
import java.io.IOException;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
@@ -58,15 +58,10 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ForkJoinPool;
-import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.Function;
-import java9.util.function.Supplier;
-import java9.util.stream.Collectors;
-
-import java9.util.stream.StreamSupport;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+import java.util.stream.StreamSupport;
public class ApkSigningBlockUtils {
@@ -417,7 +412,7 @@ public class ApkSigningBlockUtils {
DataSource centralDir,
DataSource eocd) throws IOException, NoSuchAlgorithmException, DigestException {
Map contentDigests = new HashMap<>();
- Set oneMbChunkBasedAlgorithm = StreamSupport.stream(digestAlgorithms)
+ Set oneMbChunkBasedAlgorithm = digestAlgorithms.stream()
.filter(a -> a == ContentDigestAlgorithm.CHUNKED_SHA256 ||
a == ContentDigestAlgorithm.CHUNKED_SHA512)
.collect(Collectors.toSet());
@@ -1102,7 +1097,7 @@ public class ApkSigningBlockUtils {
if (bestSigAlgorithmOnSdkVersion.isEmpty()) {
throw new NoSupportedSignaturesException("No supported signature");
}
- return StreamSupport.stream(bestSigAlgorithmOnSdkVersion.values())
+ return bestSigAlgorithmOnSdkVersion.values().stream()
.sorted((sig1, sig2) -> Integer.compare(
sig1.algorithm.getId(), sig2.algorithm.getId()))
.collect(Collectors.toList());
diff --git a/app/src/main/java/com/android/apksig/internal/util/ChainedDataSource.java b/app/src/main/java/com/android/apksig/internal/util/ChainedDataSource.java
index b89ced0..dae1519 100644
--- a/app/src/main/java/com/android/apksig/internal/util/ChainedDataSource.java
+++ b/app/src/main/java/com/android/apksig/internal/util/ChainedDataSource.java
@@ -25,7 +25,7 @@ import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
-import java9.util.stream.Stream;
+import java.util.stream.Stream;
/** Pseudo {@link DataSource} that chains the given {@link DataSource} as a continuous one. */
public class ChainedDataSource implements DataSource {
diff --git a/app/src/main/java/com/zane/smapiinstaller/logic/ActivityResultHandler.java b/app/src/main/java/com/zane/smapiinstaller/logic/ActivityResultHandler.java
index a6d9a05..8467ee3 100644
--- a/app/src/main/java/com/zane/smapiinstaller/logic/ActivityResultHandler.java
+++ b/app/src/main/java/com/zane/smapiinstaller/logic/ActivityResultHandler.java
@@ -4,7 +4,7 @@ import android.content.Intent;
import java.util.concurrent.ConcurrentHashMap;
-import java9.util.function.BiConsumer;
+import java.util.function.BiConsumer;
public class ActivityResultHandler {
public static int REQUEST_CODE_APP_INSTALL = 1001;
diff --git a/app/src/main/java/com/zane/smapiinstaller/logic/ApkPatcher.java b/app/src/main/java/com/zane/smapiinstaller/logic/ApkPatcher.java
index 689a1e3..cbc7f5c 100644
--- a/app/src/main/java/com/zane/smapiinstaller/logic/ApkPatcher.java
+++ b/app/src/main/java/com/zane/smapiinstaller/logic/ApkPatcher.java
@@ -52,10 +52,10 @@ import java.util.concurrent.atomic.AtomicReference;
import java.util.zip.Deflater;
import androidx.core.content.FileProvider;
-import java9.util.Objects;
-import java9.util.function.Consumer;
-import java9.util.stream.Collectors;
-import java9.util.stream.StreamSupport;
+import java.util.Objects;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
+
import pxb.android.axml.NodeVisitor;
/**
@@ -191,7 +191,7 @@ public class ApkPatcher {
ApkFilesManifest apkFilesManifest = apkFilesManifests.get(0);
List manifestEntries = apkFilesManifest.getManifestEntries();
errorMessage.set(null);
- List entries = StreamSupport.stream(manifestEntries).map(entry -> {
+ List entries = manifestEntries.stream().map(entry -> {
if (entry.isAdvanced() && !advanced) {
return null;
}
@@ -384,7 +384,7 @@ public class ApkPatcher {
thread.interrupt();
}
if (result.containsErrors()) {
- errorMessage.set(StreamSupport.stream(result.getErrors()).map(ApkVerifier.IssueWithParams::toString).collect(Collectors.joining(",")));
+ errorMessage.set(result.getErrors().stream().map(ApkVerifier.IssueWithParams::toString).collect(Collectors.joining(",")));
return null;
}
emitProgress(95);
diff --git a/app/src/main/java/com/zane/smapiinstaller/logic/CommonLogic.java b/app/src/main/java/com/zane/smapiinstaller/logic/CommonLogic.java
index 9969d06..7006416 100644
--- a/app/src/main/java/com/zane/smapiinstaller/logic/CommonLogic.java
+++ b/app/src/main/java/com/zane/smapiinstaller/logic/CommonLogic.java
@@ -44,8 +44,8 @@ import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
-import java9.util.function.BiConsumer;
-import java9.util.function.Consumer;
+import java.util.function.BiConsumer;
+import java.util.function.Consumer;
import pxb.android.axml.AxmlReader;
import pxb.android.axml.AxmlVisitor;
import pxb.android.axml.AxmlWriter;
diff --git a/app/src/main/java/com/zane/smapiinstaller/logic/ListenableObject.java b/app/src/main/java/com/zane/smapiinstaller/logic/ListenableObject.java
index 6b09305..cb6deac 100644
--- a/app/src/main/java/com/zane/smapiinstaller/logic/ListenableObject.java
+++ b/app/src/main/java/com/zane/smapiinstaller/logic/ListenableObject.java
@@ -2,7 +2,7 @@ package com.zane.smapiinstaller.logic;
import java.util.List;
-import java9.util.function.Predicate;
+import java.util.function.Predicate;
/**
* @author Zane
diff --git a/app/src/main/java/com/zane/smapiinstaller/logic/ModAssetsManager.java b/app/src/main/java/com/zane/smapiinstaller/logic/ModAssetsManager.java
index b02724b..51b7321 100644
--- a/app/src/main/java/com/zane/smapiinstaller/logic/ModAssetsManager.java
+++ b/app/src/main/java/com/zane/smapiinstaller/logic/ModAssetsManager.java
@@ -39,11 +39,10 @@ import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicBoolean;
-import java9.util.Objects;
-import java9.util.function.Consumer;
-import java9.util.function.Predicate;
-import java9.util.stream.Collectors;
-import java9.util.stream.StreamSupport;
+import java.util.Objects;
+import java.util.function.Consumer;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
/**
* Mod资源管理器
@@ -171,7 +170,7 @@ public class ModAssetsManager {
if (installedMods.size() > 1) {
DialogUtils.showAlertDialog(root, R.string.error,
String.format(context.getString(R.string.duplicate_mod_found),
- StreamSupport.stream(installedMods).map(item -> FileUtils.toPrettyPath(item.getAssetPath())).collect(Collectors.joining(","))));
+ installedMods.stream().map(item -> FileUtils.toPrettyPath(item.getAssetPath())).collect(Collectors.joining(","))));
return false;
} else if (installedMods.size() == 0) {
installedMods = installedModMap.get(mod.getUniqueID().replace("ZaneYork.CustomLocalization", "SMAPI.CustomLocalization"));
@@ -228,7 +227,7 @@ public class ModAssetsManager {
for (String key : installedModMap.keySet()) {
ImmutableList installedMods = installedModMap.get(key);
if (installedMods.size() > 1) {
- list.add(StreamSupport.stream(installedMods).map(item -> FileUtils.toPrettyPath(item.getAssetPath())).collect(Collectors.joining(",")));
+ list.add(installedMods.stream().map(item -> FileUtils.toPrettyPath(item.getAssetPath())).collect(Collectors.joining(",")));
}
}
if (!list.isEmpty()) {
@@ -254,7 +253,7 @@ public class ModAssetsManager {
* @param returnCallback 回调函数
*/
private void checkUnsatisfiedDependencies(ImmutableListMultimap installedModMap, Consumer returnCallback) {
- List dependencyErrors = StreamSupport.stream(installedModMap.values())
+ List dependencyErrors = installedModMap.values().stream()
.map(mod -> checkModDependencyError(mod, installedModMap))
.filter(Objects::nonNull)
.collect(Collectors.toList());
@@ -281,7 +280,7 @@ public class ModAssetsManager {
* @param returnCallback 回调函数
*/
private void checkContentpacks(ImmutableListMultimap installedModMap, Consumer returnCallback) {
- List dependencyErrors = StreamSupport.stream(installedModMap.values())
+ List dependencyErrors = installedModMap.values().stream()
.map(mod -> checkContentPackDependencyError(mod, installedModMap))
.filter(Objects::nonNull).collect(Collectors.toList());
if (!dependencyErrors.isEmpty()) {
@@ -304,7 +303,7 @@ public class ModAssetsManager {
if (checkUpdating.get()) {
return;
}
- List list = StreamSupport.stream(findAllInstalledMods(false))
+ List list = findAllInstalledMods(false).stream()
.filter(mod -> mod.getUpdateKeys() != null && !mod.getUpdateKeys().isEmpty())
.map(ModUpdateCheckRequestDto.ModInfo::fromModManifestEntry)
.distinct()
@@ -334,7 +333,7 @@ public class ModAssetsManager {
checkUpdating.set(false);
List checkResponseDtos = response.body();
if (checkResponseDtos != null) {
- List list = StreamSupport.stream(checkResponseDtos).filter(dto -> dto.getSuggestedUpdate() != null).collect(Collectors.toList());
+ List list = checkResponseDtos.stream().filter(dto -> dto.getSuggestedUpdate() != null).collect(Collectors.toList());
callback.accept(list);
}
}
@@ -347,7 +346,7 @@ public class ModAssetsManager {
private String checkModDependencyError(ModManifestEntry mod, ImmutableListMultimap installedModMap) {
if (mod.getDependencies() != null) {
- List unsatisfiedDependencies = StreamSupport.stream(mod.getDependencies())
+ List unsatisfiedDependencies = mod.getDependencies().stream()
.filter(dependency -> isDependencyIsExist(dependency, installedModMap))
.collect(Collectors.toList());
if (unsatisfiedDependencies.size() > 0) {
diff --git a/app/src/main/java/com/zane/smapiinstaller/logic/UpdatableListManager.java b/app/src/main/java/com/zane/smapiinstaller/logic/UpdatableListManager.java
index 2dc1243..afc84b0 100644
--- a/app/src/main/java/com/zane/smapiinstaller/logic/UpdatableListManager.java
+++ b/app/src/main/java/com/zane/smapiinstaller/logic/UpdatableListManager.java
@@ -16,7 +16,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
-import java9.util.function.Predicate;
+import java.util.function.Predicate;
/**
* 在线列表更新管理器
diff --git a/app/src/main/java/com/zane/smapiinstaller/ui/config/ConfigViewModel.java b/app/src/main/java/com/zane/smapiinstaller/ui/config/ConfigViewModel.java
index 23c3bb7..931cf4c 100644
--- a/app/src/main/java/com/zane/smapiinstaller/ui/config/ConfigViewModel.java
+++ b/app/src/main/java/com/zane/smapiinstaller/ui/config/ConfigViewModel.java
@@ -27,10 +27,9 @@ import java.util.List;
import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
-import java9.util.Objects;
-import java9.util.function.Predicate;
-import java9.util.stream.Collectors;
-import java9.util.stream.StreamSupport;
+import java.util.Objects;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
class ConfigViewModel extends ViewModel implements ListenableObject> {
@@ -114,7 +113,7 @@ class ConfigViewModel extends ViewModel implements ListenableObject descriptions = StreamSupport.stream(this.modList).map(ModManifestEntry::getDescription).filter(Objects::nonNull).collect(Collectors.toList());
+ List descriptions = this.modList.stream().map(ModManifestEntry::getDescription).filter(Objects::nonNull).collect(Collectors.toList());
String language = LanguagesManager.getAppLanguage(app).getLanguage();
Query query = daoSession.getTranslationResultDao().queryBuilder().where(
TranslationResultDao.Properties.Origin.in(descriptions),
@@ -123,7 +122,7 @@ class ConfigViewModel extends ViewModel implements ListenableObject translationResults = query.list();
ImmutableMap translateMap = Maps.uniqueIndex(translationResults, TranslationResult::getOrigin);
- List untranslatedText = StreamSupport.stream(modList).map(mod -> {
+ List untranslatedText = modList.stream().map(mod -> {
if (translateMap.containsKey(mod.getDescription())) {
mod.setTranslatedDescription(translateMap.get(mod.getDescription()).getTranslation());
return null;
@@ -167,7 +166,7 @@ class ConfigViewModel extends ViewModel implements ListenableObject {
+ filteredModList = modList.stream().filter(mod -> {
if (StringUtils.containsIgnoreCase(mod.getName(), text)) {
return true;
}
diff --git a/app/src/main/java/com/zane/smapiinstaller/ui/config/ModManifestAdapter.java b/app/src/main/java/com/zane/smapiinstaller/ui/config/ModManifestAdapter.java
index 5e4ae34..3d29436 100644
--- a/app/src/main/java/com/zane/smapiinstaller/ui/config/ModManifestAdapter.java
+++ b/app/src/main/java/com/zane/smapiinstaller/ui/config/ModManifestAdapter.java
@@ -29,7 +29,7 @@ import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
-import java9.util.function.Predicate;
+import java.util.function.Predicate;
/**
* @author Zane
diff --git a/app/src/main/java/com/zane/smapiinstaller/ui/install/InstallFragment.java b/app/src/main/java/com/zane/smapiinstaller/ui/install/InstallFragment.java
index 4c5096d..7371f9d 100644
--- a/app/src/main/java/com/zane/smapiinstaller/ui/install/InstallFragment.java
+++ b/app/src/main/java/com/zane/smapiinstaller/ui/install/InstallFragment.java
@@ -20,7 +20,6 @@ import com.zane.smapiinstaller.constant.DialogAction;
import com.zane.smapiinstaller.logic.ApkPatcher;
import com.zane.smapiinstaller.logic.CommonLogic;
import com.zane.smapiinstaller.logic.ModAssetsManager;
-import com.zane.smapiinstaller.ui.main.MainTabsFragment;
import com.zane.smapiinstaller.ui.main.MainTabsFragmentDirections;
import com.zane.smapiinstaller.utils.ConfigUtils;
import com.zane.smapiinstaller.utils.DialogUtils;
diff --git a/app/src/main/java/com/zane/smapiinstaller/ui/update/ModUpdateAdapter.java b/app/src/main/java/com/zane/smapiinstaller/ui/update/ModUpdateAdapter.java
index 15628fb..41d6d8a 100644
--- a/app/src/main/java/com/zane/smapiinstaller/ui/update/ModUpdateAdapter.java
+++ b/app/src/main/java/com/zane/smapiinstaller/ui/update/ModUpdateAdapter.java
@@ -21,8 +21,7 @@ import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
-import java9.util.Optional;
-import java9.util.stream.StreamSupport;
+import java.util.Optional;
/**
* {@link RecyclerView.Adapter} that can display a {@link ModUpdateCheckResponseDto.UpdateInfo}
@@ -68,7 +67,7 @@ public class ModUpdateAdapter extends RecyclerView.Adapter mod = StreamSupport.stream(installedModMap.get(id)).sorted((a, b) -> VersionUtil.compareVersion(a.getVersion(), b.getVersion())).findFirst();
+ Optional mod = installedModMap.get(id).stream().sorted((a, b) -> VersionUtil.compareVersion(a.getVersion(), b.getVersion())).findFirst();
if (mod.isPresent()) {
ModManifestEntry modManifestEntry = mod.get();
textModName.setText(modManifestEntry.getName());
diff --git a/app/src/main/java/com/zane/smapiinstaller/utils/DialogUtils.java b/app/src/main/java/com/zane/smapiinstaller/utils/DialogUtils.java
index 702a7b8..20e2b4b 100644
--- a/app/src/main/java/com/zane/smapiinstaller/utils/DialogUtils.java
+++ b/app/src/main/java/com/zane/smapiinstaller/utils/DialogUtils.java
@@ -16,7 +16,7 @@ import com.zane.smapiinstaller.logic.CommonLogic;
import java.util.concurrent.atomic.AtomicReference;
-import java9.util.function.BiConsumer;
+import java.util.function.BiConsumer;
/**
* 对话框相关工具类
diff --git a/app/src/main/java/com/zane/smapiinstaller/utils/TranslateUtil.java b/app/src/main/java/com/zane/smapiinstaller/utils/TranslateUtil.java
index 89479dc..61849c1 100644
--- a/app/src/main/java/com/zane/smapiinstaller/utils/TranslateUtil.java
+++ b/app/src/main/java/com/zane/smapiinstaller/utils/TranslateUtil.java
@@ -18,8 +18,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
-import java9.util.stream.Collectors;
-import java9.util.stream.StreamSupport;
+import java.util.stream.Collectors;
/**
* @author Zane
@@ -34,7 +33,7 @@ public class TranslateUtil {
if(textList == null || textList.size() == 0) {
return;
}
- textList = StreamSupport.stream(textList).filter(item -> StringUtils.isNoneBlank(item) && !item.contains("\n")).collect(Collectors.toList());
+ textList = textList.stream().filter(item -> StringUtils.isNoneBlank(item) && !item.contains("\n")).collect(Collectors.toList());
if(textList.isEmpty()) {
return;
}
diff --git a/app/src/main/java/com/zane/smapiinstaller/utils/VersionUtil.java b/app/src/main/java/com/zane/smapiinstaller/utils/VersionUtil.java
index 15c2b54..ab8f8f1 100644
--- a/app/src/main/java/com/zane/smapiinstaller/utils/VersionUtil.java
+++ b/app/src/main/java/com/zane/smapiinstaller/utils/VersionUtil.java
@@ -6,8 +6,6 @@ import org.apache.commons.lang3.StringUtils;
import java.util.List;
-import java9.util.stream.StreamSupport;
-
/**
* 版本比较工具
* @author Zane
@@ -58,7 +56,7 @@ public class VersionUtil {
* @return 是否为空版本段
*/
private static boolean isZero(List versionSections) {
- return !StreamSupport.stream(versionSections).filter(version -> {
+ return !versionSections.stream().anyMatch(version -> {
try {
int i = Integer.parseInt(version);
if (i == 0) {
@@ -67,7 +65,7 @@ public class VersionUtil {
} catch (Exception ignored) {
}
return true;
- }).findAny().isPresent();
+ });
}
/**
diff --git a/app/src/main/java/com/zane/smapiinstaller/utils/ZipUtils.java b/app/src/main/java/com/zane/smapiinstaller/utils/ZipUtils.java
index 54021fc..f994f56 100644
--- a/app/src/main/java/com/zane/smapiinstaller/utils/ZipUtils.java
+++ b/app/src/main/java/com/zane/smapiinstaller/utils/ZipUtils.java
@@ -13,7 +13,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashSet;
import java.util.List;
-import java9.util.function.Consumer;
+import java.util.function.Consumer;
import lombok.AllArgsConstructor;
import lombok.Data;
diff --git a/build.gradle b/build.gradle
index 207100b..7d8d913 100644
--- a/build.gradle
+++ b/build.gradle
@@ -8,10 +8,10 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.6.3'
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
- classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.0-beta01"
- classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
+ classpath 'com.android.tools.build:gradle:4.0.1'
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
+ classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.0"
+ classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 2c30d65..ea00ff8 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Sun Mar 01 22:21:39 CST 2020
+#Wed Aug 05 15:43:33 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip