1.SMAPI compatibility fix (prevent crash down when thread throws exception)

2.BUG fix
3.Display latest running SMAPI version
This commit is contained in:
ZaneYork 2020-04-08 17:02:06 +08:00
parent d870cdbc00
commit ae463acdcc
19 changed files with 75 additions and 23 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 30 versionCode 31
versionName "1.4.1" versionName "1.4.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true multiDexEnabled true

View File

@ -1,5 +1,5 @@
{ {
"version": 9, "version": 10,
"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.1", "description": "SMAPI compat package for game 1.4.4.138 - latest, SMAPI 3.4.1.2",
"url": "http://zaneyork.cn/download/compat/smapi_samsung_138_4.zip", "url": "http://zaneyork.cn/download/compat/smapi_samsung_138_4.zip",
"hash": "e6d018c164d9f7d482f3d28dddf33dd5d7463bc414b61af9d65e3ca0b1eecc93" "hash": "6dfac87bd513ad468c8155a55b8b6934474cf22a0b0199eaec2c5196659d7384"
}, },
{ {
"type": "LOCALE", "type": "LOCALE",

View File

@ -1,5 +1,5 @@
{ {
"version": 9, "version": 10,
"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.1", "description": "SMAPI compat package for game 1.4.4.138 - latest, SMAPI 3.4.1.2",
"url": "http://zaneyork.cn/download/compat/smapi_samsung_138_4.zip", "url": "http://zaneyork.cn/download/compat/smapi_samsung_138_4.zip",
"hash": "e6d018c164d9f7d482f3d28dddf33dd5d7463bc414b61af9d65e3ca0b1eecc93" "hash": "6dfac87bd513ad468c8155a55b8b6934474cf22a0b0199eaec2c5196659d7384"
}, },
{ {
"type": "LOCALE", "type": "LOCALE",

View File

@ -1,5 +1,5 @@
{ {
"version": 9, "version": 10,
"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.1", "description": "SMAPI三星商店兼容包 适用版本1.4.4.138至今, SMAPI 3.4.1.2",
"url": "http://zaneyork.cn/download/compat/smapi_samsung_138_4.zip", "url": "http://zaneyork.cn/download/compat/smapi_samsung_138_4.zip",
"hash": "e6d018c164d9f7d482f3d28dddf33dd5d7463bc414b61af9d65e3ca0b1eecc93" "hash": "6dfac87bd513ad468c8155a55b8b6934474cf22a0b0199eaec2c5196659d7384"
}, },
{ {
"type": "LOCALE", "type": "LOCALE",

View File

@ -1,11 +1,16 @@
{ {
"version": 1, "version": 2,
"items": [ "items": [
{ {
"title": "Mod Install General Procedure", "title": "Mod Install General Procedure",
"author": "ZaneYork", "author": "ZaneYork",
"content": "1.Query <a href=\"https://smapi.io/mods\">Compat</a> website for mod compatibility and latest download url<br>2.Download mod to your phone<br>3.Extract mod zip pack to internal storage of StardewValley/Mods directory<br>4.Press launch button provided by installer to make sure mod environment is satisfied and launch game" "content": "1.Query <a href=\"https://smapi.io/mods\">Compat</a> website for mod compatibility and latest download url<br>2.Download mod to your phone<br>3.Extract mod zip pack to internal storage of StardewValley/Mods directory<br>4.Press launch button provided by installer to make sure mod environment is satisfied and launch game"
}, },
{
"title": "相关视频教程",
"author": "凪白みと的小狐狸",
"content":"<a href=\"https://m.bilibili.com/video/BV1N54y1d75z\">(一)星露谷物语安装smapi和bgm</a><br><a href=\"https://m.bilibili.com/video/BV1iV411f77B\">(二)星露谷物语玩转n网及添加mod </a><br><a href=\"https://m.bilibili.com/video/BV1nZ4y1x7DF\">(三)星露谷物语安装美化详解 如何让人物看着顺眼</a><br><a href=\"https://m.bilibili.com/video/BV1Kk4y1R7xF\">(四)星露谷物语键盘详解</a>"
},
{ {
"title": "Mod Compat Website Instructions", "title": "Mod Compat Website Instructions",
"author": "凪白みと的小狐狸", "author": "凪白みと的小狐狸",

View File

@ -1,11 +1,16 @@
{ {
"version": 1, "version": 2,
"items": [ "items": [
{ {
"title": "Mod安装一般流程", "title": "Mod安装一般流程",
"author": "ZaneYork", "author": "ZaneYork",
"content": "1.前往<a href=\"https://smapi.io/mods\">兼容性查询</a>网站确认目标Mod的兼容性以及最新版本下载地址<br>2.下载Mod到手机<br>3.通过压缩文件管理器解压Mod文件包到手机内置存储的StardewValley/Mods目录下<br>4.点击安装器提供的启动按钮确认新增Mod之后的环境是否正常并启动游戏" "content": "1.前往<a href=\"https://smapi.io/mods\">兼容性查询</a>网站确认目标Mod的兼容性以及最新版本下载地址<br>2.下载Mod到手机<br>3.通过压缩文件管理器解压Mod文件包到手机内置存储的StardewValley/Mods目录下<br>4.点击安装器提供的启动按钮确认新增Mod之后的环境是否正常并启动游戏"
}, },
{
"title": "相关视频教程",
"author": "凪白みと的小狐狸",
"content":"<a href=\"https://m.bilibili.com/video/BV1N54y1d75z\">(一)星露谷物语安装smapi和bgm</a><br><a href=\"https://m.bilibili.com/video/BV1iV411f77B\">(二)星露谷物语玩转n网及添加mod </a><br><a href=\"https://m.bilibili.com/video/BV1nZ4y1x7DF\">(三)星露谷物语安装美化详解 如何让人物看着顺眼</a><br><a href=\"https://m.bilibili.com/video/BV1Kk4y1R7xF\">(四)星露谷物语键盘详解</a>"
},
{ {
"title": "Mod兼容网的一些相关信息", "title": "Mod兼容网的一些相关信息",
"author": "凪白みと的小狐狸", "author": "凪白みと的小狐狸",

View File

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

View File

@ -3,27 +3,36 @@ package com.zane.smapiinstaller.ui.install;
import android.app.Activity; import android.app.Activity;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView;
import com.google.common.io.Files;
import com.lmntrx.android.library.livin.missme.ProgressDialog; import com.lmntrx.android.library.livin.missme.ProgressDialog;
import com.microsoft.appcenter.crashes.Crashes; import com.microsoft.appcenter.crashes.Crashes;
import com.zane.smapiinstaller.R; import com.zane.smapiinstaller.R;
import com.zane.smapiinstaller.constant.Constants;
import com.zane.smapiinstaller.constant.DialogAction; import com.zane.smapiinstaller.constant.DialogAction;
import com.zane.smapiinstaller.logic.ApkPatcher; import com.zane.smapiinstaller.logic.ApkPatcher;
import com.zane.smapiinstaller.logic.CommonLogic; import com.zane.smapiinstaller.logic.CommonLogic;
import com.zane.smapiinstaller.logic.ModAssetsManager; import com.zane.smapiinstaller.logic.ModAssetsManager;
import com.zane.smapiinstaller.utils.DialogUtils; import com.zane.smapiinstaller.utils.DialogUtils;
import org.apache.commons.lang3.RegExUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.navigation.NavController; import androidx.navigation.NavController;
import androidx.navigation.Navigation; import androidx.navigation.Navigation;
import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
@ -38,12 +47,25 @@ public class InstallFragment extends Fragment {
private View root; private View root;
@BindView(R.id.text_latest_running)
TextView textLatestRunning;
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) { ViewGroup container, Bundle savedInstanceState) {
root = inflater.inflate(R.layout.fragment_install, container, false); root = inflater.inflate(R.layout.fragment_install, container, false);
ButterKnife.bind(this, root); ButterKnife.bind(this, root);
context = this.getActivity(); context = this.getActivity();
try {
String firstLine = Files.asCharSource(new File(Environment.getExternalStorageDirectory(), Constants.LOG_PATH), StandardCharsets.UTF_8).readFirstLine();
if(StringUtils.isNoneBlank(firstLine)) {
String versionString = RegExUtils.removePattern(firstLine, "\\[.+\\]\\s+");
versionString = RegExUtils.removePattern(versionString, "\\s+with.+");
textLatestRunning.setText(context.getString(R.string.smapi_version_runing, versionString));
textLatestRunning.setVisibility(View.VISIBLE);
}
} catch (IOException ignored) {
}
return root; return root;
} }

View File

@ -40,6 +40,16 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<TextView
android:id="@+id/text_latest_running"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/guideline_h4"
android:visibility="invisible"
android:text="@string/smapi_version_runing"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<androidx.constraintlayout.widget.Guideline <androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_h1" android:id="@+id/guideline_h1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -60,4 +70,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintGuide_percent="0.3" /> app:layout_constraintGuide_percent="0.3" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_h4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.7" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

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.1</string> <string name="smapi_version">Versión SMAPI: 3.4.1.2</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.1</string> <string name="smapi_version">Version SMAPI: 3.4.1.2</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.1</string> <string name="smapi_version">Versi SMAPI: 3.4.1.2</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.1</string> <string name="smapi_version">SMAPI버전: 3.4.1.2</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.1</string> <string name="smapi_version">Versão SMAPI: 3.4.1.2</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.1</string> <string name="smapi_version">เวอร์ชั่น SMAPI: 3.4.1.2</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.1</string> <string name="smapi_version">SMAPI版本: 3.4.1.2</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>
@ -71,4 +71,5 @@
<string name="app_update_detected">檢測到新版本: %1$s</string> <string name="app_update_detected">檢測到新版本: %1$s</string>
<string name="parser">格式化</string> <string name="parser">格式化</string>
<string name="mod_version_update_checking">正在檢查MOD更新</string> <string name="mod_version_update_checking">正在檢查MOD更新</string>
<string name="smapi_version_runing">最近運行: %s</string>
</resources> </resources>

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.1</string> <string name="smapi_version">SMAPI版本: 3.4.1.2</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>
@ -71,4 +71,5 @@
<string name="app_update_detected">检测到新版本: %1$s</string> <string name="app_update_detected">检测到新版本: %1$s</string>
<string name="parser">格式化</string> <string name="parser">格式化</string>
<string name="mod_version_update_checking">正在检查MOD更新</string> <string name="mod_version_update_checking">正在检查MOD更新</string>
<string name="smapi_version_runing">最近运行: %s</string>
</resources> </resources>

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.1</string> <string name="smapi_version">SMAPI Version: 3.4.1.2</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>
@ -75,4 +75,5 @@
<string name="app_update_detected">New version detected: %1$s</string> <string name="app_update_detected">New version detected: %1$s</string>
<string name="parser">Parser</string> <string name="parser">Parser</string>
<string name="mod_version_update_checking">Checking for mod updates</string> <string name="mod_version_update_checking">Checking for mod updates</string>
<string name="smapi_version_runing">Latest running: %s</string>
</resources> </resources>