diff --git a/app/build.gradle b/app/build.gradle index 89615a5..c7cb49a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.zane.smapiinstaller" minSdkVersion 19 targetSdkVersion 28 - versionCode 25 - versionName "1.3.8" + versionCode 27 + versionName "1.3.10" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled true @@ -23,11 +23,11 @@ android { shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } -// debug { -// minifyEnabled true -// shrinkResources true -// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' -// } + debug { + minifyEnabled true + shrinkResources true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } } compileOptions { diff --git a/app/src/main/assets/apk/StardewModdingAPI.dll b/app/src/main/assets/apk/StardewModdingAPI.dll index 9134e07..4c942db 100644 Binary files a/app/src/main/assets/apk/StardewModdingAPI.dll and b/app/src/main/assets/apk/StardewModdingAPI.dll differ diff --git a/app/src/main/assets/downloadable_content_list.json b/app/src/main/assets/downloadable_content_list.json index 8504e61..ab02767 100644 --- a/app/src/main/assets/downloadable_content_list.json +++ b/app/src/main/assets/downloadable_content_list.json @@ -1,5 +1,5 @@ { - "version": 7, + "version": 8, "contents": [ { "type": "COMPAT", @@ -13,9 +13,9 @@ "type": "COMPAT", "name": "SMAPI for Galaxy Store", "assetPath": "compat/samsung_138/", - "description": "SMAPI compat package for game 1.4.4.138 - latest, SMAPI 3.4.0", - "url": "http://zaneyork.cn/download/compat/smapi_samsung_138_2.zip", - "hash": "6302a881de93f45aebee8eadc44b69c3cd73cf957366ba8ef339b0d103e6ae64" + "description": "SMAPI compat package for game 1.4.4.138 - latest, SMAPI 3.4.1.1", + "url": "http://zaneyork.cn/download/compat/smapi_samsung_138_3.zip", + "hash": "d559c4b62fbf598eb8fff99ddcd152d7e34f6e30aa32a64d728ce1dd174b0dff" }, { "type": "LOCALE", diff --git a/app/src/main/assets/downloadable_content_list.json.en b/app/src/main/assets/downloadable_content_list.json.en index 8504e61..ab02767 100644 --- a/app/src/main/assets/downloadable_content_list.json.en +++ b/app/src/main/assets/downloadable_content_list.json.en @@ -1,5 +1,5 @@ { - "version": 7, + "version": 8, "contents": [ { "type": "COMPAT", @@ -13,9 +13,9 @@ "type": "COMPAT", "name": "SMAPI for Galaxy Store", "assetPath": "compat/samsung_138/", - "description": "SMAPI compat package for game 1.4.4.138 - latest, SMAPI 3.4.0", - "url": "http://zaneyork.cn/download/compat/smapi_samsung_138_2.zip", - "hash": "6302a881de93f45aebee8eadc44b69c3cd73cf957366ba8ef339b0d103e6ae64" + "description": "SMAPI compat package for game 1.4.4.138 - latest, SMAPI 3.4.1.1", + "url": "http://zaneyork.cn/download/compat/smapi_samsung_138_3.zip", + "hash": "d559c4b62fbf598eb8fff99ddcd152d7e34f6e30aa32a64d728ce1dd174b0dff" }, { "type": "LOCALE", diff --git a/app/src/main/assets/downloadable_content_list.json.zh b/app/src/main/assets/downloadable_content_list.json.zh index 6ff3c3f..e6959f3 100644 --- a/app/src/main/assets/downloadable_content_list.json.zh +++ b/app/src/main/assets/downloadable_content_list.json.zh @@ -1,5 +1,5 @@ { - "version": 7, + "version": 8, "contents": [ { "type": "COMPAT", @@ -13,9 +13,9 @@ "type": "COMPAT", "name": "SMAPI三星商店兼容包", "assetPath": "compat/samsung_138/", - "description": "SMAPI三星商店兼容包, 适用版本1.4.4.138至今, SMAPI 3.4.0", - "url": "http://zaneyork.cn/download/compat/smapi_samsung_138_2.zip", - "hash": "6302a881de93f45aebee8eadc44b69c3cd73cf957366ba8ef339b0d103e6ae64" + "description": "SMAPI三星商店兼容包, 适用版本1.4.4.138至今, SMAPI 3.4.1.1", + "url": "http://zaneyork.cn/download/compat/smapi_samsung_138_3.zip", + "hash": "d559c4b62fbf598eb8fff99ddcd152d7e34f6e30aa32a64d728ce1dd174b0dff" }, { "type": "LOCALE", diff --git a/app/src/main/assets/mods/custom-localization.zip b/app/src/main/assets/mods/custom-localization.zip index 20adb3d..7595313 100644 Binary files a/app/src/main/assets/mods/custom-localization.zip and b/app/src/main/assets/mods/custom-localization.zip differ diff --git a/app/src/main/assets/smapi_files_manifest.json b/app/src/main/assets/smapi_files_manifest.json index 10fb2db..4bf4253 100644 --- a/app/src/main/assets/smapi_files_manifest.json +++ b/app/src/main/assets/smapi_files_manifest.json @@ -109,6 +109,11 @@ "assetPath": "assemblies/System.Xml.dll", "origin": 1 }, + { + "targetPath": "smapi-internal/Mono.Android.dll", + "assetPath": "assemblies/Mono.Android.dll", + "origin": 1 + }, { "targetPath": "smapi-internal/System.Xml.Linq.dll", "assetPath": "smapi/System.Xml.Linq.dll", 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 561936b..0d099a7 100644 --- a/app/src/main/java/com/zane/smapiinstaller/logic/CommonLogic.java +++ b/app/src/main/java/com/zane/smapiinstaller/logic/CommonLogic.java @@ -11,12 +11,17 @@ import android.net.Uri; import android.os.Environment; import android.util.Log; import android.view.View; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; +import android.view.animation.DecelerateInterpolator; +import android.widget.ImageView; import com.fasterxml.jackson.core.type.TypeReference; import com.google.common.base.Predicate; import com.google.common.collect.Lists; import com.google.common.io.ByteStreams; import com.zane.smapiinstaller.MainApplication; +import com.zane.smapiinstaller.R; import com.zane.smapiinstaller.entity.ApkFilesManifest; import com.zane.smapiinstaller.entity.ManifestEntry; import com.zane.smapiinstaller.utils.FileUtils; @@ -31,6 +36,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java9.util.function.Consumer; import pxb.android.axml.AxmlReader; import pxb.android.axml.AxmlVisitor; import pxb.android.axml.AxmlWriter; @@ -212,4 +218,22 @@ public class CommonLogic { return writer.toByteArray(); } + public static void showAnimation(ImageView view, int anim, Consumer action) { + Animation animation = AnimationUtils.loadAnimation(getActivityFromView(view), anim); + animation.setAnimationListener(new Animation.AnimationListener() { + @Override + public void onAnimationStart(Animation animation) { + } + + @Override + public void onAnimationEnd(Animation animation) { + action.accept(animation); + } + + @Override + public void onAnimationRepeat(Animation animation) { + } + }); + view.startAnimation(animation); + } } diff --git a/app/src/main/java/com/zane/smapiinstaller/ui/about/AboutFragment.java b/app/src/main/java/com/zane/smapiinstaller/ui/about/AboutFragment.java index 428d14b..3c62d50 100644 --- a/app/src/main/java/com/zane/smapiinstaller/ui/about/AboutFragment.java +++ b/app/src/main/java/com/zane/smapiinstaller/ui/about/AboutFragment.java @@ -7,15 +7,14 @@ import android.content.pm.PackageManager; import android.didikee.donate.AlipayDonate; import android.net.Uri; import android.os.Bundle; - -import androidx.fragment.app.Fragment; -import butterknife.ButterKnife; -import butterknife.OnClick; - import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; +import android.view.animation.DecelerateInterpolator; import android.widget.Button; +import android.widget.ImageView; import android.widget.Toast; import com.afollestad.materialdialogs.MaterialDialog; @@ -24,8 +23,16 @@ import com.zane.smapiinstaller.constant.Constants; import com.zane.smapiinstaller.logic.CommonLogic; import com.zane.smapiinstaller.utils.DialogUtils; +import androidx.fragment.app.Fragment; +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; + public class AboutFragment extends Fragment { + @BindView(R.id.img_heart) + ImageView imgHeart; + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -66,40 +73,45 @@ public class AboutFragment extends Fragment { } } - @OnClick(R.id.button_donation) void donation() { + @OnClick(R.id.button_donation) void donation(View view) { Context context = this.getContext(); DialogUtils.setCurrentDialog(new MaterialDialog.Builder(context).title(R.string.button_donation_text).items(R.array.donation_methods).itemsCallback((dialog, itemView, position, text) -> { - switch (position){ - case 0: - boolean hasInstalledAlipayClient = AlipayDonate.hasInstalledAlipayClient(context); - if (hasInstalledAlipayClient) { - AlipayDonate.startAlipayClient(this.getActivity(), "fkx13570v1pp2xenyrx4y3f"); - } - else { - CommonLogic.openUrl(context, "http://dl.zaneyork.cn/alipay.png"); - } - break; - case 1: - CommonLogic.openUrl(context, "http://dl.zaneyork.cn/wechat.png"); - break; - case 2: - CommonLogic.openUrl(context, "http://dl.zaneyork.cn/qqpay.png"); - break; - case 3: - hasInstalledAlipayClient = AlipayDonate.hasInstalledAlipayClient(context); - if (hasInstalledAlipayClient) { - if (CommonLogic.copyToClipboard(context, Constants.RED_PACKET_CODE)) { - PackageManager packageManager = context.getPackageManager(); - Intent intent = packageManager.getLaunchIntentForPackage("com.eg.android.AlipayGphone"); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(intent); - Toast.makeText(context, R.string.toast_redpacket_message, Toast.LENGTH_LONG).show(); + CommonLogic.showAnimation(imgHeart, R.anim.heart_beat, (animation)->{ + switch (position){ + case 0: + boolean hasInstalledAlipayClient = AlipayDonate.hasInstalledAlipayClient(context); + if (hasInstalledAlipayClient) { + AlipayDonate.startAlipayClient(this.getActivity(), "fkx13570v1pp2xenyrx4y3f"); } - } - break; - default: - break; - } + else { + CommonLogic.openUrl(context, "http://dl.zaneyork.cn/alipay.png"); + } + break; + case 1: + CommonLogic.openUrl(context, "http://dl.zaneyork.cn/wechat.png"); + break; + case 2: + CommonLogic.openUrl(context, "http://dl.zaneyork.cn/qqpay.png"); + break; + case 3: + hasInstalledAlipayClient = AlipayDonate.hasInstalledAlipayClient(context); + if (hasInstalledAlipayClient) { + if (CommonLogic.copyToClipboard(context, Constants.RED_PACKET_CODE)) { + PackageManager packageManager = context.getPackageManager(); + Intent intent = packageManager.getLaunchIntentForPackage("com.eg.android.AlipayGphone"); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); + Toast.makeText(context, R.string.toast_redpacket_message, Toast.LENGTH_LONG).show(); + } + } + break; + case 4: + CommonLogic.openUrl(context, "http://zaneyork.cn/download/list.html"); + break; + default: + break; + } + }); }).show()); } } diff --git a/app/src/main/java/com/zane/smapiinstaller/ui/config/ConfigEditFragment.java b/app/src/main/java/com/zane/smapiinstaller/ui/config/ConfigEditFragment.java index dd3e943..84e326d 100644 --- a/app/src/main/java/com/zane/smapiinstaller/ui/config/ConfigEditFragment.java +++ b/app/src/main/java/com/zane/smapiinstaller/ui/config/ConfigEditFragment.java @@ -1,5 +1,8 @@ package com.zane.smapiinstaller.ui.config; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -7,6 +10,8 @@ import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; +import com.afollestad.materialdialogs.DialogAction; +import com.zane.smapiinstaller.BuildConfig; import com.zane.smapiinstaller.R; import com.zane.smapiinstaller.utils.DialogUtils; import com.zane.smapiinstaller.utils.FileUtils; @@ -14,9 +19,11 @@ import com.zane.smapiinstaller.utils.JSONUtil; import java.io.File; import java.io.FileOutputStream; +import java.io.IOException; import java.io.OutputStreamWriter; import androidx.annotation.NonNull; +import androidx.core.content.FileProvider; import androidx.fragment.app.Fragment; import androidx.navigation.Navigation; import butterknife.BindView; @@ -46,9 +53,32 @@ public class ConfigEditFragment extends Fragment { } configPath = this.getArguments().getString("configPath"); if(configPath != null) { - String fileText = FileUtils.getFileText(new File(configPath)); - if(fileText != null) { - editText.setText(fileText); + File file = new File(configPath); + if(file.exists() && file.length() < 16 * 1024 * 1024) { + String fileText = FileUtils.getFileText(file); + if (fileText != null) { + editText.setText(fileText); + } + } + else { + editText.setText(""); + editText.setKeyListener(null); + DialogUtils.showConfirmDialog(root, R.string.error, this.getString(R.string.text_too_large), R.string.open_with, R.string.cancel, ((dialog, which) -> { + if(which == DialogAction.POSITIVE) { + Intent intent = new Intent("android.intent.action.VIEW"); + intent.addCategory("android.intent.category.DEFAULT"); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + Uri contentUri = FileProvider.getUriForFile(this.getContext(), BuildConfig.APPLICATION_ID + ".provider", file); + intent.setDataAndType(contentUri, "text/plain"); + } else { + intent.setDataAndType(Uri.fromFile(file), "text/plain"); + } + this.startActivity(intent); + } + onConfigCancel(); + })); } } return root; 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 79c7ae0..63809eb 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 @@ -27,6 +27,7 @@ import androidx.navigation.NavController; import androidx.navigation.Navigation; import butterknife.ButterKnife; import butterknife.OnClick; +import lombok.SneakyThrows; public class InstallFragment extends Fragment { diff --git a/app/src/main/res/anim/heart_beat.xml b/app/src/main/res/anim/heart_beat.xml new file mode 100644 index 0000000..04389ba --- /dev/null +++ b/app/src/main/res/anim/heart_beat.xml @@ -0,0 +1,31 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index e49d6f3..8d8c60e 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -61,7 +61,7 @@ Registro detallado Firmando paquete deinstalación SMAPI Stardew Valley - Versión SMAPI: 3.4.0 + Versión SMAPI: 3.4.1.1 Nota: Requiere la versión del juego 1.4.5.138 o superior El cuerpo del juego debe instalarse durante la actualización o instalación Desempacando diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 878f238..a1c75b9 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -61,7 +61,7 @@ Journalisation détaillée Signature SMAPI Stardew Valley - Version SMAPI: 3.4.0 + Version SMAPI: 3.4.1.1 Remarques: La version du jeu 1.4.5.138 ou ultérieure est requise. Le jeu de base est requis lors de la mise à jour / installation. Déballage diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index f479faf..9532b3b 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -61,7 +61,7 @@ Catatan Terperinci Menandatangani SMAPI Stardew Valley - Versi SMAPI: 3.4.0 + Versi SMAPI: 3.4.1.1 Catatan: Dibutuhkan Stardew Valley versi 1.4.5.138 atau yang lebih baru. Permainan dasar diperlukan saat memperbarui/menginstal. Membongkar diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 77b62cf..0af448d 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -61,7 +61,7 @@ 자세한 로그 설치 패키지 서명 SMAPI Stardew Valley - SMAPI버전: 3.4.0 + SMAPI버전: 3.4.1.1 참고 : 게임 버전 1.4.5.138 이상이 필요합니다 업데이트 또는 설치 중에 게임 본체를 설치해야합니다 포장 풀기 diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index bcb877d..5e8163e 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -61,7 +61,7 @@ Log detalhado Assinatura SMAPI Stardew Valley - Versão SMAPI: 3.4.0 + Versão SMAPI: 3.4.1.1 Notas: É necessária a versão do jogo 1.4.5.138 ou posterior. O jogo base é necessário ao atualizar / instalar. Desembalar diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index a888b22..d8580b7 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -61,7 +61,7 @@ การบันทึกอย่างละเอียด การลงชื่อ SMAPI Stardew Valley - เวอร์ชั่น SMAPI: 3.4.0 + เวอร์ชั่น SMAPI: 3.4.1.1 หมายเหตุ: จำเป็นต้องใช้เวอร์ชั่นเกม 1.4.5.138 หรือใหม่กว่า จำเป็นต้องมีเกมพื้นฐานเมื่อทำการอัพเดต / ติดตั้ง แกะกล่อง diff --git a/app/src/main/res/values-zh-rHK/arrays.xml b/app/src/main/res/values-zh-rHK/arrays.xml index 5c713a9..4661fb8 100644 --- a/app/src/main/res/values-zh-rHK/arrays.xml +++ b/app/src/main/res/values-zh-rHK/arrays.xml @@ -5,6 +5,7 @@ 微信 QQ 紅包碼 + 捐贈列表 自動 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 5fcb289..c7e34c5 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -60,9 +60,11 @@ 詳細日誌 正在簽名安裝包 SMAPI星露穀物語 - SMAPI版本: 3.4.0 + SMAPI版本: 3.4.1.1 注意:需要不低於1.4.5.138版本的遊戲本體 更新或安裝期間需要安裝遊戲本體 正在解包 排序方式 + 文本文件過大,無法打開 + 打開為 diff --git a/app/src/main/res/values-zh-rTW/arrays.xml b/app/src/main/res/values-zh-rTW/arrays.xml index 5c713a9..4661fb8 100644 --- a/app/src/main/res/values-zh-rTW/arrays.xml +++ b/app/src/main/res/values-zh-rTW/arrays.xml @@ -5,6 +5,7 @@ 微信 QQ 紅包碼 + 捐贈列表 自動 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 5fcb289..c7e34c5 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -60,9 +60,11 @@ 詳細日誌 正在簽名安裝包 SMAPI星露穀物語 - SMAPI版本: 3.4.0 + SMAPI版本: 3.4.1.1 注意:需要不低於1.4.5.138版本的遊戲本體 更新或安裝期間需要安裝遊戲本體 正在解包 排序方式 + 文本文件過大,無法打開 + 打開為 diff --git a/app/src/main/res/values-zh/arrays.xml b/app/src/main/res/values-zh/arrays.xml index cc31638..3afbf1c 100644 --- a/app/src/main/res/values-zh/arrays.xml +++ b/app/src/main/res/values-zh/arrays.xml @@ -5,6 +5,7 @@ 微信 QQ 红包码 + 捐赠列表 自动 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 429991a..3922cd3 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -60,9 +60,11 @@ 详细日志 正在签名安装包 SMAPI星露谷物语 - SMAPI版本: 3.4.0 + SMAPI版本: 3.4.1.1 注意:需要不低于1.4.5.138版本的游戏本体 更新或安装期间需要安装游戏本体 正在解包 排序方式 + 文本文件过大,无法打开 + 打开为 diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 468258d..922e814 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -5,6 +5,7 @@ WeChat QQ Red Packet Code + Donation List Auto diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 47862c4..2823e80 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -60,7 +60,7 @@ Verbose Logging Signing SMAPI Stardew Valley - SMAPI Version: 3.4.0 + SMAPI Version: 3.4.1.1 Notes: Game version 1.4.5.138 or later is required. The base game is required when updating/installing. Unpacking @@ -68,4 +68,6 @@ 红包码已复制\n支付宝首页搜索“9188262” 立即领红包 icon Sort by + Text file is too large for editor + Open With