1.SMAPI compatibility fix

2.Update SMAPI to 3.4.1.5
3.Dependencies: spongycastle -> bouncycastle
4.Update MonoMod to latest version, compatible with some of device of Android L
This commit is contained in:
ZaneYork 2020-04-15 13:36:23 +08:00
parent ae463acdcc
commit b505f2ed04
24 changed files with 48 additions and 38 deletions

View File

@ -12,8 +12,8 @@ android {
applicationId "com.zane.smapiinstaller" applicationId "com.zane.smapiinstaller"
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 28 targetSdkVersion 28
versionCode 31 versionCode 35
versionName "1.4.2" versionName "1.4.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true multiDexEnabled true
@ -63,10 +63,8 @@ dependencies {
implementation "androidx.navigation:navigation-fragment:$nav_version" implementation "androidx.navigation:navigation-fragment:$nav_version"
implementation "androidx.navigation:navigation-ui:$nav_version" implementation "androidx.navigation:navigation-ui:$nav_version"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'com.madgag.spongycastle:core:1.54.0.0' // https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on
implementation 'com.madgag.spongycastle:prov:1.54.0.0' implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.65'
implementation 'com.madgag.spongycastle:pkix:1.54.0.0'
implementation 'com.madgag.spongycastle:pg:1.54.0.0'
implementation 'com.afollestad.material-dialogs:core:3.3.0' implementation 'com.afollestad.material-dialogs:core:3.3.0'
implementation 'com.afollestad.material-dialogs:input:3.3.0' implementation 'com.afollestad.material-dialogs:input:3.3.0'
implementation 'com.afollestad.material-dialogs:lifecycle:3.3.0' implementation 'com.afollestad.material-dialogs:lifecycle:3.3.0'

View File

@ -139,9 +139,9 @@
-keep class pxb.android.** { *; } -keep class pxb.android.** { *; }
-keep class net.fornwall.apksigner.** { *; } -keep class net.fornwall.apksigner.** { *; }
-keep class com.android.apksig.** { *; } -keep class com.android.apksig.** { *; }
-keep class org.spongycastle.** #Warning:org.bouncycastle.jce.provider.X509LDAPCertStoreSpi: can't find referenced class javax.naming.NamingEnumeration
-dontwarn org.spongycastle.jce.provider.X509LDAPCertStoreSpi -dontwarn javax.naming.**
-dontwarn org.spongycastle.x509.util.LDAPStoreHelper -keep class org.bouncycastle.** {*;}
-keep class org.slf4j.** -keep class org.slf4j.**
-keep class com.hjq.language.** {*;} -keep class com.hjq.language.** {*;}

View File

@ -1,5 +1,5 @@
{ {
"version": 10, "version": 12,
"contents": [ "contents": [
{ {
"type": "COMPAT", "type": "COMPAT",
@ -13,9 +13,9 @@
"type": "COMPAT", "type": "COMPAT",
"name": "SMAPI for Galaxy Store", "name": "SMAPI for Galaxy Store",
"assetPath": "compat/samsung_138/", "assetPath": "compat/samsung_138/",
"description": "SMAPI compat package for game 1.4.4.138 - latest, SMAPI 3.4.1.2", "description": "SMAPI compat package for game 1.4.4.138 - latest, SMAPI 3.4.1.5",
"url": "http://zaneyork.cn/download/compat/smapi_samsung_138_4.zip", "url": "http://zaneyork.cn/download/compat/smapi_samsung_138_7.zip",
"hash": "6dfac87bd513ad468c8155a55b8b6934474cf22a0b0199eaec2c5196659d7384" "hash": "141ac038ff831ece5e6627dc29a45deddc131a008b3cfdecc678d1da2c0ee7a0"
}, },
{ {
"type": "LOCALE", "type": "LOCALE",

View File

@ -1,5 +1,5 @@
{ {
"version": 10, "version": 12,
"contents": [ "contents": [
{ {
"type": "COMPAT", "type": "COMPAT",
@ -13,9 +13,9 @@
"type": "COMPAT", "type": "COMPAT",
"name": "SMAPI for Galaxy Store", "name": "SMAPI for Galaxy Store",
"assetPath": "compat/samsung_138/", "assetPath": "compat/samsung_138/",
"description": "SMAPI compat package for game 1.4.4.138 - latest, SMAPI 3.4.1.2", "description": "SMAPI compat package for game 1.4.4.138 - latest, SMAPI 3.4.1.5",
"url": "http://zaneyork.cn/download/compat/smapi_samsung_138_4.zip", "url": "http://zaneyork.cn/download/compat/smapi_samsung_138_7.zip",
"hash": "6dfac87bd513ad468c8155a55b8b6934474cf22a0b0199eaec2c5196659d7384" "hash": "141ac038ff831ece5e6627dc29a45deddc131a008b3cfdecc678d1da2c0ee7a0"
}, },
{ {
"type": "LOCALE", "type": "LOCALE",

View File

@ -1,5 +1,5 @@
{ {
"version": 10, "version": 12,
"contents": [ "contents": [
{ {
"type": "COMPAT", "type": "COMPAT",
@ -13,9 +13,9 @@
"type": "COMPAT", "type": "COMPAT",
"name": "SMAPI三星商店兼容包", "name": "SMAPI三星商店兼容包",
"assetPath": "compat/samsung_138/", "assetPath": "compat/samsung_138/",
"description": "SMAPI三星商店兼容包 适用版本1.4.4.138至今, SMAPI 3.4.1.2", "description": "SMAPI三星商店兼容包 适用版本1.4.4.138至今, SMAPI 3.4.1.5",
"url": "http://zaneyork.cn/download/compat/smapi_samsung_138_4.zip", "url": "http://zaneyork.cn/download/compat/smapi_samsung_138_7.zip",
"hash": "6dfac87bd513ad468c8155a55b8b6934474cf22a0b0199eaec2c5196659d7384" "hash": "141ac038ff831ece5e6627dc29a45deddc131a008b3cfdecc678d1da2c0ee7a0"
}, },
{ {
"type": "LOCALE", "type": "LOCALE",

View File

@ -129,6 +129,11 @@
"assetPath": "assemblies/xTile.dll", "assetPath": "assemblies/xTile.dll",
"origin": 1 "origin": 1
}, },
{
"targetPath": "smapi-internal/BmFont.dll",
"assetPath": "assemblies/BmFont.dll",
"origin": 1
},
{ {
"targetPath": "smapi-internal/i18n/de.json", "targetPath": "smapi-internal/i18n/de.json",
"assetPath": "smapi/i18n/de.json", "assetPath": "smapi/i18n/de.json",

View File

@ -63,7 +63,7 @@ public class Constants {
/** /**
* SMAPI版本 * SMAPI版本
*/ */
public static final String SMAPI_VERSION = "3.4.1.2"; public static final String SMAPI_VERSION = "3.4.1.5";
/** /**
* 平台 * 平台

View File

@ -11,6 +11,7 @@ import android.os.Environment;
import android.util.Log; import android.util.Log;
import com.android.apksig.ApkSigner; import com.android.apksig.ApkSigner;
import com.android.apksig.ApkVerifier;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.base.Predicate; import com.google.common.base.Predicate;
import com.google.common.base.Stopwatch; import com.google.common.base.Stopwatch;
@ -274,9 +275,10 @@ public class ApkPatcher {
PrivateKey privateKey = (PrivateKey) ks.getKey(alias, "android".toCharArray()); PrivateKey privateKey = (PrivateKey) ks.getKey(alias, "android".toCharArray());
ApkSigner.SignerConfig signerConfig = new ApkSigner.SignerConfig.Builder("debug", privateKey, Collections.singletonList(publicKey)).build(); ApkSigner.SignerConfig signerConfig = new ApkSigner.SignerConfig.Builder("debug", privateKey, Collections.singletonList(publicKey)).build();
emitProgress(49); emitProgress(49);
File outputFile = new File(signApkPath);
ApkSigner signer = new ApkSigner.Builder(Collections.singletonList(signerConfig)) ApkSigner signer = new ApkSigner.Builder(Collections.singletonList(signerConfig))
.setInputApk(new File(apkPath)) .setInputApk(new File(apkPath))
.setOutputApk(new File(signApkPath)) .setOutputApk(outputFile)
.setV1SigningEnabled(true) .setV1SigningEnabled(true)
.setV2SigningEnabled(true).build(); .setV2SigningEnabled(true).build();
long zipOpElapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS); long zipOpElapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS);
@ -289,7 +291,7 @@ public class ApkPatcher {
long elapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS); long elapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS);
double progress = elapsed * 0.98 / zipOpElapsed; double progress = elapsed * 0.98 / zipOpElapsed;
if (progress < 1.0) { if (progress < 1.0) {
emitProgress((int) (49 + 40 * progress)); emitProgress((int) (49 + 45 * progress));
} }
} catch (InterruptedException ignored) { } catch (InterruptedException ignored) {
return; return;
@ -298,11 +300,16 @@ public class ApkPatcher {
}); });
thread.start(); thread.start();
signer.sign(); signer.sign();
FileUtils.forceDelete(new File(apkPath));
ApkVerifier.Result result = new ApkVerifier.Builder(outputFile).build().verify();
if (thread.isAlive() && !thread.isInterrupted()) { if (thread.isAlive() && !thread.isInterrupted()) {
thread.interrupt(); thread.interrupt();
} }
FileUtils.forceDelete(new File(apkPath)); if(result.containsErrors()) {
emitProgress(90); errorMessage.set(StreamSupport.stream(result.getErrors()).map(ApkVerifier.IssueWithParams::toString).collect(Collectors.joining(",")));
return null;
}
emitProgress(95);
return signApkPath; return signApkPath;
} }
} catch (Exception e) { } catch (Exception e) {

View File

@ -3,7 +3,7 @@ package net.fornwall.apksigner;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import org.spongycastle.util.encoders.Base64Encoder; import org.bouncycastle.util.encoders.Base64Encoder;
/** Base64 encoding handling in a portable way across Android and JSE. */ /** Base64 encoding handling in a portable way across Android and JSE. */
public class Base64 { public class Base64 {

View File

@ -10,14 +10,14 @@ import java.security.KeyStore;
import java.security.Provider; import java.security.Provider;
import java.security.Security; import java.security.Security;
import org.spongycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.jce.provider.BouncyCastleProvider;
public class KeyStoreFileManager { public class KeyStoreFileManager {
public static final Provider SECURITY_PROVIDER = new BouncyCastleProvider(); public static final Provider SECURITY_PROVIDER = new BouncyCastleProvider();
static { static {
// Add the spongycastle version of the BC provider so that the implementation classes returned from the keystore // Add the bouncycastle version of the BC provider so that the implementation classes returned from the keystore
// are all from the spongycastle libs. // are all from the spongycastle libs.
Security.addProvider(SECURITY_PROVIDER); Security.addProvider(SECURITY_PROVIDER);
} }

View File

@ -61,7 +61,7 @@
<string name="settings_verbose_logging">Registro detallado</string> <string name="settings_verbose_logging">Registro detallado</string>
<string name="signing_package">Firmando paquete deinstalación</string> <string name="signing_package">Firmando paquete deinstalación</string>
<string name="smapi_game_name">SMAPI Stardew Valley</string> <string name="smapi_game_name">SMAPI Stardew Valley</string>
<string name="smapi_version">Versión SMAPI: 3.4.1.2</string> <string name="smapi_version">Versión SMAPI: 3.4.1.5</string>
<string name="text_install_tip1">Nota: Requiere la versión del juego 1.4.5.138 o superior</string> <string name="text_install_tip1">Nota: Requiere la versión del juego 1.4.5.138 o superior</string>
<string name="text_install_tip2">El cuerpo del juego debe instalarse durante la actualización o instalación</string> <string name="text_install_tip2">El cuerpo del juego debe instalarse durante la actualización o instalación</string>
<string name="unpacking_smapi_files">Desempacando</string> <string name="unpacking_smapi_files">Desempacando</string>

View File

@ -61,7 +61,7 @@
<string name="settings_verbose_logging">Journalisation détaillée</string> <string name="settings_verbose_logging">Journalisation détaillée</string>
<string name="signing_package">Signature</string> <string name="signing_package">Signature</string>
<string name="smapi_game_name">SMAPI Stardew Valley</string> <string name="smapi_game_name">SMAPI Stardew Valley</string>
<string name="smapi_version">Version SMAPI: 3.4.1.2</string> <string name="smapi_version">Version SMAPI: 3.4.1.5</string>
<string name="text_install_tip1">Remarques: La version du jeu 1.4.5.138 ou ultérieure est requise.</string> <string name="text_install_tip1">Remarques: La version du jeu 1.4.5.138 ou ultérieure est requise.</string>
<string name="text_install_tip2">Le jeu de base est requis lors de la mise à jour / installation.</string> <string name="text_install_tip2">Le jeu de base est requis lors de la mise à jour / installation.</string>
<string name="unpacking_smapi_files">Déballage</string> <string name="unpacking_smapi_files">Déballage</string>

View File

@ -61,7 +61,7 @@
<string name="settings_verbose_logging">Catatan Terperinci</string> <string name="settings_verbose_logging">Catatan Terperinci</string>
<string name="signing_package">Menandatangani</string> <string name="signing_package">Menandatangani</string>
<string name="smapi_game_name">SMAPI Stardew Valley</string> <string name="smapi_game_name">SMAPI Stardew Valley</string>
<string name="smapi_version">Versi SMAPI: 3.4.1.2</string> <string name="smapi_version">Versi SMAPI: 3.4.1.5</string>
<string name="text_install_tip1">Catatan: Dibutuhkan Stardew Valley versi 1.4.5.138 atau yang lebih baru.</string> <string name="text_install_tip1">Catatan: Dibutuhkan Stardew Valley versi 1.4.5.138 atau yang lebih baru.</string>
<string name="text_install_tip2">Permainan dasar diperlukan saat memperbarui/menginstal.</string> <string name="text_install_tip2">Permainan dasar diperlukan saat memperbarui/menginstal.</string>
<string name="unpacking_smapi_files">Membongkar</string> <string name="unpacking_smapi_files">Membongkar</string>

View File

@ -61,7 +61,7 @@
<string name="settings_verbose_logging">자세한 로그</string> <string name="settings_verbose_logging">자세한 로그</string>
<string name="signing_package">설치 패키지 서명</string> <string name="signing_package">설치 패키지 서명</string>
<string name="smapi_game_name">SMAPI Stardew Valley</string> <string name="smapi_game_name">SMAPI Stardew Valley</string>
<string name="smapi_version">SMAPI버전: 3.4.1.2</string> <string name="smapi_version">SMAPI버전: 3.4.1.5</string>
<string name="text_install_tip1">참고 : 게임 버전 1.4.5.138 이상이 필요합니다</string> <string name="text_install_tip1">참고 : 게임 버전 1.4.5.138 이상이 필요합니다</string>
<string name="text_install_tip2">업데이트 또는 설치 중에 게임 본체를 설치해야합니다</string> <string name="text_install_tip2">업데이트 또는 설치 중에 게임 본체를 설치해야합니다</string>
<string name="unpacking_smapi_files">포장 풀기</string> <string name="unpacking_smapi_files">포장 풀기</string>

View File

@ -61,7 +61,7 @@
<string name="settings_verbose_logging">Log detalhado</string> <string name="settings_verbose_logging">Log detalhado</string>
<string name="signing_package">Assinatura</string> <string name="signing_package">Assinatura</string>
<string name="smapi_game_name">SMAPI Stardew Valley</string> <string name="smapi_game_name">SMAPI Stardew Valley</string>
<string name="smapi_version">Versão SMAPI: 3.4.1.2</string> <string name="smapi_version">Versão SMAPI: 3.4.1.5</string>
<string name="text_install_tip1">Notas: É necessária a versão do jogo 1.4.5.138 ou posterior.</string> <string name="text_install_tip1">Notas: É necessária a versão do jogo 1.4.5.138 ou posterior.</string>
<string name="text_install_tip2">O jogo base é necessário ao atualizar / instalar.</string> <string name="text_install_tip2">O jogo base é necessário ao atualizar / instalar.</string>
<string name="unpacking_smapi_files">Desembalar</string> <string name="unpacking_smapi_files">Desembalar</string>

View File

@ -61,7 +61,7 @@
<string name="settings_verbose_logging">การบันทึกอย่างละเอียด</string> <string name="settings_verbose_logging">การบันทึกอย่างละเอียด</string>
<string name="signing_package">การลงชื่อ</string> <string name="signing_package">การลงชื่อ</string>
<string name="smapi_game_name">SMAPI Stardew Valley</string> <string name="smapi_game_name">SMAPI Stardew Valley</string>
<string name="smapi_version">เวอร์ชั่น SMAPI: 3.4.1.2</string> <string name="smapi_version">เวอร์ชั่น SMAPI: 3.4.1.5</string>
<string name="text_install_tip1">หมายเหตุ: จำเป็นต้องใช้เวอร์ชั่นเกม 1.4.5.138 หรือใหม่กว่า</string> <string name="text_install_tip1">หมายเหตุ: จำเป็นต้องใช้เวอร์ชั่นเกม 1.4.5.138 หรือใหม่กว่า</string>
<string name="text_install_tip2">จำเป็นต้องมีเกมพื้นฐานเมื่อทำการอัพเดต / ติดตั้ง</string> <string name="text_install_tip2">จำเป็นต้องมีเกมพื้นฐานเมื่อทำการอัพเดต / ติดตั้ง</string>
<string name="unpacking_smapi_files">แกะกล่อง</string> <string name="unpacking_smapi_files">แกะกล่อง</string>

View File

@ -60,7 +60,7 @@
<string name="settings_verbose_logging">詳細日誌</string> <string name="settings_verbose_logging">詳細日誌</string>
<string name="signing_package">正在簽名安裝包</string> <string name="signing_package">正在簽名安裝包</string>
<string name="smapi_game_name">SMAPI星露穀物語</string> <string name="smapi_game_name">SMAPI星露穀物語</string>
<string name="smapi_version">SMAPI版本: 3.4.1.2</string> <string name="smapi_version">SMAPI版本: 3.4.1.5</string>
<string name="text_install_tip1">注意需要不低於1.4.5.138版本的遊戲本體</string> <string name="text_install_tip1">注意需要不低於1.4.5.138版本的遊戲本體</string>
<string name="text_install_tip2">更新或安裝期間需要安裝遊戲本體</string> <string name="text_install_tip2">更新或安裝期間需要安裝遊戲本體</string>
<string name="unpacking_smapi_files">正在解包</string> <string name="unpacking_smapi_files">正在解包</string>

View File

@ -60,7 +60,7 @@
<string name="settings_verbose_logging">详细日志</string> <string name="settings_verbose_logging">详细日志</string>
<string name="signing_package">正在签名安装包</string> <string name="signing_package">正在签名安装包</string>
<string name="smapi_game_name">SMAPI星露谷物语</string> <string name="smapi_game_name">SMAPI星露谷物语</string>
<string name="smapi_version">SMAPI版本: 3.4.1.2</string> <string name="smapi_version">SMAPI版本: 3.4.1.5</string>
<string name="text_install_tip1">注意需要不低于1.4.5.138版本的游戏本体</string> <string name="text_install_tip1">注意需要不低于1.4.5.138版本的游戏本体</string>
<string name="text_install_tip2">更新或安装期间需要安装游戏本体</string> <string name="text_install_tip2">更新或安装期间需要安装游戏本体</string>
<string name="unpacking_smapi_files">正在解包</string> <string name="unpacking_smapi_files">正在解包</string>

View File

@ -60,7 +60,7 @@
<string name="settings_verbose_logging">Verbose Logging</string> <string name="settings_verbose_logging">Verbose Logging</string>
<string name="signing_package">Signing</string> <string name="signing_package">Signing</string>
<string name="smapi_game_name">SMAPI Stardew Valley</string> <string name="smapi_game_name">SMAPI Stardew Valley</string>
<string name="smapi_version">SMAPI Version: 3.4.1.2</string> <string name="smapi_version">SMAPI Version: 3.4.1.5</string>
<string name="text_install_tip1">Notes: Game version 1.4.5.138 or later is required.</string> <string name="text_install_tip1">Notes: Game version 1.4.5.138 or later is required.</string>
<string name="text_install_tip2">The base game is required when updating/installing.</string> <string name="text_install_tip2">The base game is required when updating/installing.</string>
<string name="unpacking_smapi_files">Unpacking</string> <string name="unpacking_smapi_files">Unpacking</string>