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
b06d9c19
Commit
b06d9c19
authored
May 23, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test bot
parent
66a2fc7a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
21 deletions
+29
-21
mobile/build.gradle
mobile/build.gradle
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+12
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
...c/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
+16
-20
No files found.
mobile/build.gradle
View file @
b06d9c19
...
@@ -8,7 +8,7 @@ android {
...
@@ -8,7 +8,7 @@ android {
applicationId
"cn.garymb.ygomobile"
applicationId
"cn.garymb.ygomobile"
minSdkVersion
16
minSdkVersion
16
targetSdkVersion
22
targetSdkVersion
22
versionCode
3201052
2
versionCode
3201052
3
versionName
"3.2.1"
versionName
"3.2.1"
flavorDimensions
"versionCode"
flavorDimensions
"versionCode"
vectorDrawables
.
useSupportLibrary
=
true
vectorDrawables
.
useSupportLibrary
=
true
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
b06d9c19
...
@@ -3,6 +3,7 @@ package cn.garymb.ygomobile.ui.home;
...
@@ -3,6 +3,7 @@ package cn.garymb.ygomobile.ui.home;
import
android.content.BroadcastReceiver
;
import
android.content.BroadcastReceiver
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.IntentFilter
;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.NonNull
;
...
@@ -11,6 +12,7 @@ import android.support.design.widget.NavigationView;
...
@@ -11,6 +12,7 @@ import android.support.design.widget.NavigationView;
import
android.support.v7.widget.DividerItemDecoration
;
import
android.support.v7.widget.DividerItemDecoration
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.SparseArray
;
import
android.util.SparseArray
;
import
android.view.Gravity
;
import
android.view.Gravity
;
import
android.view.Menu
;
import
android.view.Menu
;
...
@@ -58,6 +60,8 @@ import cn.garymb.ygomobile.ui.preference.SettingsActivity;
...
@@ -58,6 +60,8 @@ import cn.garymb.ygomobile.ui.preference.SettingsActivity;
import
cn.garymb.ygomobile.utils.AlipayPayUtils
;
import
cn.garymb.ygomobile.utils.AlipayPayUtils
;
import
libwindbot.windbot.WindBot
;
import
libwindbot.windbot.WindBot
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
DATABASE_NAME
;
abstract
class
HomeActivity
extends
BaseActivity
implements
NavigationView
.
OnNavigationItemSelectedListener
{
abstract
class
HomeActivity
extends
BaseActivity
implements
NavigationView
.
OnNavigationItemSelectedListener
{
protected
SwipeMenuRecyclerView
mServerList
;
protected
SwipeMenuRecyclerView
mServerList
;
private
ServerListAdapter
mServerListAdapter
;
private
ServerListAdapter
mServerListAdapter
;
...
@@ -89,6 +93,7 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
...
@@ -89,6 +93,7 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
TrPay
.
getInstance
(
HomeActivity
.
this
).
initPaySdk
(
"e1014da420ea4405898c01273d6731b6"
,
"YGOMobile"
);
TrPay
.
getInstance
(
HomeActivity
.
this
).
initPaySdk
(
"e1014da420ea4405898c01273d6731b6"
,
"YGOMobile"
);
//autoupadte checking
//autoupadte checking
checkForceUpdateSilent
();
checkForceUpdateSilent
();
checkWindbot
();
}
}
@Override
@Override
...
@@ -381,5 +386,12 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
...
@@ -381,5 +386,12 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
long
intervalMillis
=
0
*
1000L
;
long
intervalMillis
=
0
*
1000L
;
UpdateHelper
.
getInstance
().
autoUpdate
(
getPackageName
(),
false
,
intervalMillis
);
UpdateHelper
.
getInstance
().
autoUpdate
(
getPackageName
(),
false
,
intervalMillis
);
}
}
public
void
checkWindbot
(){
WindBot
.
initAndroid
(
this
.
getFilesDir
().
getPath
(),
AppsSettings
.
get
().
getDataBasePath
()+
"/"
+
DATABASE_NAME
);
HomeActivity
.
MessageReceiver
mReceiver
=
new
HomeActivity
.
MessageReceiver
();
IntentFilter
filter
=
new
IntentFilter
();
filter
.
addAction
(
"RUN_WINDBOT"
);
getContext
().
registerReceiver
(
mReceiver
,
filter
);
}
}
}
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
View file @
b06d9c19
...
@@ -9,6 +9,7 @@ import android.database.sqlite.SQLiteDatabase;
...
@@ -9,6 +9,7 @@ import android.database.sqlite.SQLiteDatabase;
import
android.database.sqlite.SQLiteException
;
import
android.database.sqlite.SQLiteException
;
import
android.os.AsyncTask
;
import
android.os.AsyncTask
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.Log
;
...
@@ -169,9 +170,7 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
...
@@ -169,9 +170,7 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
Constants
.
CORE_EXPANSIONS
),
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
Constants
.
CORE_EXPANSIONS
),
mSettings
.
getExpansionsPath
().
getAbsolutePath
(),
true
,
needsUpdate
);
mSettings
.
getExpansionsPath
().
getAbsolutePath
(),
true
,
needsUpdate
);
}
}
han
.
sendEmptyMessage
(
0
);
//checkWindbot();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
if
(
Constants
.
DEBUG
)
if
(
Constants
.
DEBUG
)
...
@@ -322,23 +321,20 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
...
@@ -322,23 +321,20 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
void
onResCheckFinished
(
int
result
,
boolean
isNewVersion
);
void
onResCheckFinished
(
int
result
,
boolean
isNewVersion
);
}
}
public
void
checkWindbot
(){
Log
.
i
(
"路径"
,
mContext
.
getFilesDir
().
getPath
());
Log
.
i
(
"路径2"
,
mSettings
.
getDataBasePath
()+
"/"
+
DATABASE_NAME
);
Handler
han
=
new
Handler
(){
WindBot
.
initAndroid
(
mContext
.
getFilesDir
().
getPath
(),
mSettings
.
getDataBasePath
()+
"/"
+
DATABASE_NAME
);
ResCheckTask
.
MessageReceiver
mReceiver
=
new
ResCheckTask
.
MessageReceiver
();
@Override
IntentFilter
filter
=
new
IntentFilter
();
public
void
handleMessage
(
Message
msg
)
{
filter
.
addAction
(
"RUN_WINDBOT"
);
super
.
handleMessage
(
msg
);
mContext
.
registerReceiver
(
mReceiver
,
filter
);
switch
(
msg
.
what
){
case
0
:
Log
.
i
(
"运行了没?"
,
"运行了"
);
//checkWindbot();
break
;
}
}
}
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
);
}
}
};
};
}
}
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