Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
766dbffb
Commit
766dbffb
authored
Sep 26, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复安装新版本会覆盖原有收藏夹记录的问题
parent
64c23f81
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
8 deletions
+20
-8
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/BaseActivity.java
.../java/cn/garymb/ygomobile/ui/activities/BaseActivity.java
+5
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
...c/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
+10
-3
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+3
-2
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+2
-1
No files found.
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/BaseActivity.java
View file @
766dbffb
...
@@ -251,7 +251,8 @@ public class BaseActivity extends AppCompatActivity {
...
@@ -251,7 +251,8 @@ public class BaseActivity extends AppCompatActivity {
}
}
/**
/**
*权限申请
* 权限申请
*
* @return 是否满足权限申请条件
* @return 是否满足权限申请条件
*/
*/
protected
boolean
startPermissionsActivity
()
{
protected
boolean
startPermissionsActivity
()
{
...
@@ -260,11 +261,12 @@ public class BaseActivity extends AppCompatActivity {
...
@@ -260,11 +261,12 @@ public class BaseActivity extends AppCompatActivity {
/**
/**
* 权限申请
* 权限申请
*
* @param permissions 要申请的权限列表
* @param permissions 要申请的权限列表
* @return 是否满足权限申请条件
* @return 是否满足权限申请条件
*/
*/
protected
boolean
startPermissionsActivity
(
String
[]
permissions
)
{
protected
boolean
startPermissionsActivity
(
String
[]
permissions
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
M
)
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
M
)
return
false
;
return
false
;
if
(
permissions
==
null
||
permissions
.
length
==
0
)
if
(
permissions
==
null
||
permissions
.
length
==
0
)
return
false
;
return
false
;
...
@@ -298,6 +300,7 @@ public class BaseActivity extends AppCompatActivity {
...
@@ -298,6 +300,7 @@ public class BaseActivity extends AppCompatActivity {
/**
/**
* 权限申请回调
* 权限申请回调
*
* @param isOk 权限申请是否成功
* @param isOk 权限申请是否成功
*/
*/
protected
void
onPermission
(
boolean
isOk
)
{
protected
void
onPermission
(
boolean
isOk
)
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
View file @
766dbffb
...
@@ -15,6 +15,7 @@ import android.util.Log;
...
@@ -15,6 +15,7 @@ import android.util.Log;
import
java.io.File
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
cn.garymb.ygomobile.AppsSettings
;
import
cn.garymb.ygomobile.AppsSettings
;
...
@@ -348,14 +349,20 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
...
@@ -348,14 +349,20 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
private
int
copyCoreConfig
(
String
toPath
,
boolean
needsUpdate
)
{
private
int
copyCoreConfig
(
String
toPath
,
boolean
needsUpdate
)
{
try
{
try
{
String
path
=
getDatapath
(
"conf"
);
/*
String path = getDatapath("conf");
int count = IOUtils.copyFilesFromAssets(mContext, path, toPath, needsUpdate);
int count = IOUtils.copyFilesFromAssets(mContext, path, toPath, needsUpdate);
if (count < 3) {
if (count < 3) {
return ERROR_CORE_CONFIG_LOST;
return ERROR_CORE_CONFIG_LOST;
}
}
*/
//替换换行符
File
systemfile
=
new
File
(
AppsSettings
.
get
().
getResourcePath
(),
Constants
.
CORE_SYSTEM_PATH
);
File
stringfile
=
new
File
(
AppsSettings
.
get
().
getResourcePath
(),
Constants
.
CORE_STRING_PATH
);
File
stringfile
=
new
File
(
AppsSettings
.
get
().
getResourcePath
(),
Constants
.
CORE_STRING_PATH
);
File
botfile
=
new
File
(
AppsSettings
.
get
().
getResourcePath
(),
Constants
.
BOT_CONF
);
File
botfile
=
new
File
(
AppsSettings
.
get
().
getResourcePath
(),
Constants
.
BOT_CONF
);
if
(!
systemfile
.
exists
())
{
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
"conf"
)
+
"/"
+
Constants
.
CORE_SYSTEM_PATH
,
toPath
,
false
);
}
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
"conf"
)
+
"/"
+
Constants
.
CORE_STRING_PATH
,
toPath
,
needsUpdate
);
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
"conf"
)
+
"/"
+
CORE_BOT_CONF_PATH
,
toPath
,
needsUpdate
);
//替换换行符
fixString
(
stringfile
.
getAbsolutePath
());
fixString
(
stringfile
.
getAbsolutePath
());
fixString
(
botfile
.
getAbsolutePath
());
fixString
(
botfile
.
getAbsolutePath
());
return
ERROR_NONE
;
return
ERROR_NONE
;
...
...
mobile/src/main/res/values-zh/strings.xml
View file @
766dbffb
...
@@ -287,6 +287,7 @@
...
@@ -287,6 +287,7 @@
\n还原:将已在上述备份路径的所有卡组还原到此
</string>
\n还原:将已在上述备份路径的所有卡组还原到此
</string>
<string
name=
"restore_deck"
>
发现本机有卡组备份记录,是否还原?
</string>
<string
name=
"restore_deck"
>
发现本机有卡组备份记录,是否还原?
</string>
<string
name=
"explain_permission"
>
<string
name=
"explain_permission"
>
将申请以下必要权限:
使用本软件此类功能将申请以下必要权限:
\n存储权限:备份/还原卡组,自定义背景/头像/卡背必需
</string>
\n安装未知应用权限:安装更新包,备份、还原卡组必需
\n存储权限:备份、还原卡组,自定义背景、头像、卡背必需
</string>
</resources>
</resources>
mobile/src/main/res/values/strings.xml
View file @
766dbffb
...
@@ -290,6 +290,7 @@
...
@@ -290,6 +290,7 @@
\nRestore\: restore backed up decks
</string>
\nRestore\: restore backed up decks
</string>
<string
name=
"restore_deck"
>
found backed up decks in your Device\, restore\?
</string>
<string
name=
"restore_deck"
>
found backed up decks in your Device\, restore\?
</string>
<string
name=
"explain_permission"
>
<string
name=
"explain_permission"
>
necessary permissions will be applied\:
Very necessary permissions will be applied\:
\nInstall unknow apps\: Install upgrade and Change Settings
\nStorage Access\:backup\/restore deck\,set custom background\/avatars\/cardback
</string>
\nStorage Access\:backup\/restore deck\,set custom background\/avatars\/cardback
</string>
</resources>
</resources>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment