1.Update SMAPI to 3.4.1

2.SMAPI Compatibility improvement, bug fix
3.Adjust layout
This commit is contained in:
ZaneYork 2020-03-28 15:05:02 +08:00
parent 7967f4c473
commit ca28902c0a
26 changed files with 183 additions and 68 deletions

View File

@ -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 {

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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<Animation> 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);
}
}

View File

@ -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());
}
}

View File

@ -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;

View File

@ -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 {

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillBefore="true"
android:shareInterpolator="@android:anim/accelerate_decelerate_interpolator">
<alpha
android:duration="120"
android:fromAlpha="1"
android:toAlpha="0.6" />
<scale
android:duration="120"
android:fromXScale="1"
android:fromYScale="1"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.15"
android:toYScale="1.15" />
<alpha
android:duration="120"
android:startOffset="250"
android:fromAlpha="0.6"
android:toAlpha="1" />
<scale
android:duration="120"
android:startOffset="250"
android:fromXScale="1.15"
android:fromYScale="1.15"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1"
android:toYScale="1" />
</set>

View File

@ -61,7 +61,7 @@
<string name="settings_verbose_logging">Registro detallado</string>
<string name="signing_package">Firmando paquete deinstalación</string>
<string name="smapi_game_name">SMAPI Stardew Valley</string>
<string name="smapi_version">Versión SMAPI: 3.4.0</string>
<string name="smapi_version">Versión SMAPI: 3.4.1.1</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="unpacking_smapi_files">Desempacando</string>

View File

@ -61,7 +61,7 @@
<string name="settings_verbose_logging">Journalisation détaillée</string>
<string name="signing_package">Signature</string>
<string name="smapi_game_name">SMAPI Stardew Valley</string>
<string name="smapi_version">Version SMAPI: 3.4.0</string>
<string name="smapi_version">Version SMAPI: 3.4.1.1</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="unpacking_smapi_files">Déballage</string>

View File

@ -61,7 +61,7 @@
<string name="settings_verbose_logging">Catatan Terperinci</string>
<string name="signing_package">Menandatangani</string>
<string name="smapi_game_name">SMAPI Stardew Valley</string>
<string name="smapi_version">Versi SMAPI: 3.4.0</string>
<string name="smapi_version">Versi SMAPI: 3.4.1.1</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="unpacking_smapi_files">Membongkar</string>

View File

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

View File

@ -61,7 +61,7 @@
<string name="settings_verbose_logging">Log detalhado</string>
<string name="signing_package">Assinatura</string>
<string name="smapi_game_name">SMAPI Stardew Valley</string>
<string name="smapi_version">Versão SMAPI: 3.4.0</string>
<string name="smapi_version">Versão SMAPI: 3.4.1.1</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="unpacking_smapi_files">Desembalar</string>

View File

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

View File

@ -5,6 +5,7 @@
<item>微信</item>
<item>QQ</item>
<item>紅包碼</item>
<item>捐贈列表</item>
</string-array>
<string-array name="languages">
<item>自動</item>

View File

@ -60,9 +60,11 @@
<string name="settings_verbose_logging">詳細日誌</string>
<string name="signing_package">正在簽名安裝包</string>
<string name="smapi_game_name">SMAPI星露穀物語</string>
<string name="smapi_version">SMAPI版本: 3.4.0</string>
<string name="smapi_version">SMAPI版本: 3.4.1.1</string>
<string name="text_install_tip1">注意需要不低於1.4.5.138版本的遊戲本體</string>
<string name="text_install_tip2">更新或安裝期間需要安裝遊戲本體</string>
<string name="unpacking_smapi_files">正在解包</string>
<string name="sort_by">排序方式</string>
<string name="text_too_large">文本文件過大,無法打開</string>
<string name="open_with">打開為</string>
</resources>

View File

@ -5,6 +5,7 @@
<item>微信</item>
<item>QQ</item>
<item>紅包碼</item>
<item>捐贈列表</item>
</string-array>
<string-array name="languages">
<item>自動</item>

View File

@ -60,9 +60,11 @@
<string name="settings_verbose_logging">詳細日誌</string>
<string name="signing_package">正在簽名安裝包</string>
<string name="smapi_game_name">SMAPI星露穀物語</string>
<string name="smapi_version">SMAPI版本: 3.4.0</string>
<string name="smapi_version">SMAPI版本: 3.4.1.1</string>
<string name="text_install_tip1">注意需要不低於1.4.5.138版本的遊戲本體</string>
<string name="text_install_tip2">更新或安裝期間需要安裝遊戲本體</string>
<string name="unpacking_smapi_files">正在解包</string>
<string name="sort_by">排序方式</string>
<string name="text_too_large">文本文件過大,無法打開</string>
<string name="open_with">打開為</string>
</resources>

View File

@ -5,6 +5,7 @@
<item>微信</item>
<item>QQ</item>
<item>红包码</item>
<item>捐赠列表</item>
</string-array>
<string-array name="languages">
<item>自动</item>

View File

@ -60,9 +60,11 @@
<string name="settings_verbose_logging">详细日志</string>
<string name="signing_package">正在签名安装包</string>
<string name="smapi_game_name">SMAPI星露谷物语</string>
<string name="smapi_version">SMAPI版本: 3.4.0</string>
<string name="smapi_version">SMAPI版本: 3.4.1.1</string>
<string name="text_install_tip1">注意需要不低于1.4.5.138版本的游戏本体</string>
<string name="text_install_tip2">更新或安装期间需要安装游戏本体</string>
<string name="unpacking_smapi_files">正在解包</string>
<string name="sort_by">排序方式</string>
<string name="text_too_large">文本文件过大,无法打开</string>
<string name="open_with">打开为</string>
</resources>

View File

@ -5,6 +5,7 @@
<item>WeChat</item>
<item>QQ</item>
<item>Red Packet Code</item>
<item>Donation List</item>
</string-array>
<string-array name="languages">
<item>Auto</item>

View File

@ -60,7 +60,7 @@
<string name="settings_verbose_logging">Verbose Logging</string>
<string name="signing_package">Signing</string>
<string name="smapi_game_name">SMAPI Stardew Valley</string>
<string name="smapi_version">SMAPI Version: 3.4.0</string>
<string name="smapi_version">SMAPI Version: 3.4.1.1</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="unpacking_smapi_files">Unpacking</string>
@ -68,4 +68,6 @@
<string name="toast_redpacket_message" translatable="false">红包码已复制\n支付宝首页搜索“9188262” 立即领红包</string>
<string name="icon_desc" translatable="false">icon</string>
<string name="sort_by">Sort by</string>
<string name="text_too_large">Text file is too large for editor</string>
<string name="open_with">Open With</string>
</resources>