Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
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-Cn-Ko-En
Commits
de704352
Commit
de704352
authored
Jan 21, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3.6.2LOG-O
parent
300d6d94
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
118 deletions
+98
-118
mobile/assets/changelog.html
mobile/assets/changelog.html
+5
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
...c/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
+93
-116
mobile/src/main/res/drawable-xhdpi/ic_launcher3.png
mobile/src/main/res/drawable-xhdpi/ic_launcher3.png
+0
-0
No files found.
mobile/assets/changelog.html
View file @
de704352
...
...
@@ -15,14 +15,17 @@
特别感谢: 菜菜,尸体,废话多,大毛,龙道香姐,晓L,幻兽L 的支持与努力.
</pre>
<ul>
<li
style=
"color:#ffff00"
>
3.6.
1
</li>
<li
style=
"color:#ffff00"
>
3.6.
2
</li>
</ul>
<pre>
更新:
1.更新ygo内核;
2.新卡1012;
变更:
1.适配不同系统字体大小
1.适配不同系统字体大小;
2.重置全部卡图;
修复:
1.部分场景闪退;
</pre>
<h3
style=
"color:#ff0000"
>
注意
</h3>
<pre>
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
View file @
de704352
...
...
@@ -15,7 +15,6 @@ import android.util.Log;
import
java.io.File
;
import
java.io.IOException
;
import
java.lang.ref.WeakReference
;
import
java.util.List
;
import
cn.garymb.ygomobile.AppsSettings
;
...
...
@@ -35,61 +34,113 @@ import static cn.garymb.ygomobile.Constants.CORE_BOT_CONF_PATH;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
DATABASE_NAME
;
public
class
ResCheckTask
extends
AsyncTask
<
Void
,
Integer
,
Integer
>
{
private
static
final
String
TAG
=
"ResCheckTask"
;
public
static
final
int
ERROR_NONE
=
0
;
public
static
final
int
ERROR_CORE_CONFIG
=
-
1
;
public
static
final
int
ERROR_COPY
=
-
2
;
public
static
final
int
ERROR_CORE_CONFIG_LOST
=
-
3
;
private
static
final
String
TAG
=
"ResCheckTask"
;
protected
int
mError
=
ERROR_NONE
;
MessageReceiver
mReceiver
=
new
MessageReceiver
();
private
AppsSettings
mSettings
;
private
Context
mContext
;
Handler
han
=
new
Handler
()
{
@Override
public
void
handleMessage
(
Message
msg
)
{
super
.
handleMessage
(
msg
);
switch
(
msg
.
what
)
{
case
0
:
checkWindbot
();
break
;
}
}
};
private
ResCheckListener
mListener
;
private
DialogPlus
dialog
=
null
;
private
Handler
handler
;
private
boolean
isNewVersion
;
private
WeakReference
<
Context
>
weakReference
;
private
MessageReceiver
mReceiver
;
public
ResCheckTask
(
Context
context
)
{
this
.
weakReference
=
new
WeakReference
<>(
context
);
@SuppressWarnings
(
"deprecation"
)
public
ResCheckTask
(
Context
context
,
ResCheckListener
listener
)
{
mContext
=
context
;
mListener
=
listener
;
handler
=
new
Handler
(
context
.
getMainLooper
());
mSettings
=
AppsSettings
.
get
();
}
public
void
regesterReceiver
(
)
{
mReceiver
=
new
MessageReceiver
();
IntentFilter
intentFilter
=
new
IntentFilter
()
;
i
ntentFilter
.
addAction
(
"RUN_WINDBOT"
);
if
(
weakReference
!=
null
&&
weakReference
.
get
()
!=
null
){
Context
context
=
weakReference
.
get
();
context
.
registerReceiver
(
mReceiver
,
intentFilter
);
public
static
String
getDatapath
(
String
path
)
{
if
(
TextUtils
.
isEmpty
(
ASSETS_PATH
))
{
return
path
;
}
i
f
(
path
.
startsWith
(
ASSETS_PATH
))
{
return
path
;
}
if
(
path
.
startsWith
(
"/"
))
{
path
=
path
.
substring
(
1
);
}
return
ASSETS_PATH
+
path
;
}
public
class
MessageReceiver
extends
BroadcastReceiver
{
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
String
action
=
intent
.
getAction
();
if
(
action
.
equals
(
"RUN_WINDBOT"
))
{
String
args
=
intent
.
getStringExtra
(
"args"
);
WindBot
.
runAndroid
(
args
);
public
static
boolean
checkDataBase
(
String
path
)
{
if
(!
new
File
(
path
).
exists
())
{
return
false
;
}
SQLiteDatabase
db
=
null
;
try
{
db
=
SQLiteDatabase
.
openDatabase
(
path
,
null
,
SQLiteDatabase
.
OPEN_READWRITE
);
Cursor
cursor
=
db
.
rawQuery
(
"select * from datas,texts where datas.id=texts.id limit 1;"
,
null
);
if
(
cursor
==
null
)
{
return
false
;
}
cursor
.
close
();
}
catch
(
Exception
e
)
{
return
false
;
}
finally
{
IOUtils
.
close
(
db
);
}
return
true
;
}
public
void
unregisterMReceiver
()
{
if
(
weakReference
!=
null
&&
weakReference
.
get
()
!=
null
)
{
Context
context
=
weakReference
.
get
();
context
.
unregisterReceiver
(
mReceiver
);
public
static
void
doSomeTrickOnDatabase
(
String
myPath
)
throws
SQLiteException
{
SQLiteDatabase
db
=
null
;
db
=
SQLiteDatabase
.
openDatabase
(
myPath
,
null
,
SQLiteDatabase
.
OPEN_READWRITE
);
try
{
db
.
rawQuery
(
"select * from datas where datas._id = 0;"
,
null
);
db
.
close
();
return
;
}
catch
(
Exception
e
)
{
}
try
{
db
.
beginTransaction
();
db
.
execSQL
(
"ALTER TABLE datas RENAME TO datas_backup;"
);
db
.
execSQL
(
"CREATE TABLE datas (_id integer PRIMARY KEY, ot integer, alias integer, setcode integer, type integer,"
+
" atk integer, def integer, level integer, race integer, attribute integer, category integer);"
);
db
.
execSQL
(
"INSERT INTO datas (_id, ot, alias, setcode, type, atk, def, level, race, attribute, category) "
+
"SELECT id, ot, alias, setcode, type, atk, def, level, race, attribute, category FROM datas_backup;"
);
db
.
execSQL
(
"DROP TABLE datas_backup;"
);
db
.
execSQL
(
"ALTER TABLE texts RENAME TO texts_backup;"
);
db
.
execSQL
(
"CREATE TABLE texts (_id integer PRIMARY KEY, name varchar(128), \"desc\" varchar(1024),"
+
" str1 varchar(256), str2 varchar(256), str3 varchar(256), str4 varchar(256), str5 varchar(256),"
+
" str6 varchar(256), str7 varchar(256), str8 varchar(256), str9 varchar(256), str10 varchar(256),"
+
" str11 varchar(256), str12 varchar(256), str13 varchar(256), str14 varchar(256), str15 varchar(256), str16 varchar(256));"
);
db
.
execSQL
(
"INSERT INTO texts (_id, name, \"desc\", str1, str2, str3, str4, str5, str6, str7, str8, str9, str10, str11, str12, str13, str14, str15, str16)"
+
" SELECT id, name, \"desc\", str1, str2, str3, str4, str5, str6, str7, str8, str9, str10, str11, str12, str13, str14, str15, str16 FROM texts_backup;"
);
db
.
execSQL
(
"DROP TABLE texts_backup;"
);
db
.
setTransactionSuccessful
();
}
finally
{
db
.
endTransaction
();
}
if
(
db
!=
null
)
{
db
.
close
();
}
}
@SuppressWarnings
(
"deprecation"
)
public
ResCheckTask
(
Context
context
,
ResCheckListener
listener
)
{
mContext
=
context
;
mListener
=
listener
;
handler
=
new
Handler
(
context
.
getMainLooper
());
mSettings
=
AppsSettings
.
get
();
public
void
unregisterMReceiver
()
{
mContext
.
unregisterReceiver
(
mReceiver
);
}
@Override
...
...
@@ -127,19 +178,6 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
});
}
public
static
String
getDatapath
(
String
path
)
{
if
(
TextUtils
.
isEmpty
(
ASSETS_PATH
))
{
return
path
;
}
if
(
path
.
startsWith
(
ASSETS_PATH
))
{
return
path
;
}
if
(
path
.
startsWith
(
"/"
))
{
path
=
path
.
substring
(
1
);
}
return
ASSETS_PATH
+
path
;
}
@Override
protected
Integer
doInBackground
(
Void
...
params
)
{
if
(
Constants
.
DEBUG
)
...
...
@@ -252,64 +290,6 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
DATABASE_NAME
),
mSettings
.
getDataBasePath
(),
needsUpdate
);
}
public
static
boolean
checkDataBase
(
String
path
)
{
if
(!
new
File
(
path
).
exists
())
{
return
false
;
}
SQLiteDatabase
db
=
null
;
try
{
db
=
SQLiteDatabase
.
openDatabase
(
path
,
null
,
SQLiteDatabase
.
OPEN_READWRITE
);
Cursor
cursor
=
db
.
rawQuery
(
"select * from datas,texts where datas.id=texts.id limit 1;"
,
null
);
if
(
cursor
==
null
)
{
return
false
;
}
cursor
.
close
();
}
catch
(
Exception
e
)
{
return
false
;
}
finally
{
IOUtils
.
close
(
db
);
}
return
true
;
}
public
static
void
doSomeTrickOnDatabase
(
String
myPath
)
throws
SQLiteException
{
SQLiteDatabase
db
=
null
;
db
=
SQLiteDatabase
.
openDatabase
(
myPath
,
null
,
SQLiteDatabase
.
OPEN_READWRITE
);
try
{
db
.
rawQuery
(
"select * from datas where datas._id = 0;"
,
null
);
db
.
close
();
return
;
}
catch
(
Exception
e
)
{
}
try
{
db
.
beginTransaction
();
db
.
execSQL
(
"ALTER TABLE datas RENAME TO datas_backup;"
);
db
.
execSQL
(
"CREATE TABLE datas (_id integer PRIMARY KEY, ot integer, alias integer, setcode integer, type integer,"
+
" atk integer, def integer, level integer, race integer, attribute integer, category integer);"
);
db
.
execSQL
(
"INSERT INTO datas (_id, ot, alias, setcode, type, atk, def, level, race, attribute, category) "
+
"SELECT id, ot, alias, setcode, type, atk, def, level, race, attribute, category FROM datas_backup;"
);
db
.
execSQL
(
"DROP TABLE datas_backup;"
);
db
.
execSQL
(
"ALTER TABLE texts RENAME TO texts_backup;"
);
db
.
execSQL
(
"CREATE TABLE texts (_id integer PRIMARY KEY, name varchar(128), \"desc\" varchar(1024),"
+
" str1 varchar(256), str2 varchar(256), str3 varchar(256), str4 varchar(256), str5 varchar(256),"
+
" str6 varchar(256), str7 varchar(256), str8 varchar(256), str9 varchar(256), str10 varchar(256),"
+
" str11 varchar(256), str12 varchar(256), str13 varchar(256), str14 varchar(256), str15 varchar(256), str16 varchar(256));"
);
db
.
execSQL
(
"INSERT INTO texts (_id, name, \"desc\", str1, str2, str3, str4, str5, str6, str7, str8, str9, str10, str11, str12, str13, str14, str15, str16)"
+
" SELECT id, name, \"desc\", str1, str2, str3, str4, str5, str6, str7, str8, str9, str10, str11, str12, str13, str14, str15, str16 FROM texts_backup;"
);
db
.
execSQL
(
"DROP TABLE texts_backup;"
);
db
.
setTransactionSuccessful
();
}
finally
{
db
.
endTransaction
();
}
if
(
db
!=
null
)
{
db
.
close
();
}
}
private
void
checkDirs
()
{
String
[]
dirs
=
{
//脚本文件夹
...
...
@@ -393,10 +373,6 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
FileUtils
.
writeLines
(
stringfile
,
lines
,
encoding
,
"\n"
);
}
public
interface
ResCheckListener
{
void
onResCheckFinished
(
int
result
,
boolean
isNewVersion
);
}
public
void
checkWindbot
()
{
Log
.
i
(
"路径"
,
mContext
.
getFilesDir
().
getPath
());
Log
.
i
(
"路径2"
,
mSettings
.
getDataBasePath
()
+
"/"
+
DATABASE_NAME
);
...
...
@@ -412,17 +388,18 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
mContext
.
registerReceiver
(
mReceiver
,
filter
);
}
Handler
han
=
new
Handler
()
{
public
interface
ResCheckListener
{
void
onResCheckFinished
(
int
result
,
boolean
isNewVersion
);
}
public
class
MessageReceiver
extends
BroadcastReceiver
{
@Override
public
void
handleMessage
(
Message
msg
)
{
super
.
handleMessage
(
msg
);
switch
(
msg
.
what
)
{
case
0
:
checkWindbot
(
);
break
;
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
String
action
=
intent
.
getAction
(
);
if
(
action
.
equals
(
"RUN_WINDBOT"
)
)
{
String
args
=
intent
.
getStringExtra
(
"args"
);
WindBot
.
runAndroid
(
args
);
}
}
}
};
}
mobile/src/main/res/drawable-xhdpi/ic_launcher3.png
View replaced file @
300d6d94
View file @
de704352
140 KB
|
W:
|
H:
122 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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