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
836cc324
Commit
836cc324
authored
May 23, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现WINDBOT
parent
b06d9c19
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
28 deletions
+29
-28
mobile/build.gradle
mobile/build.gradle
+1
-1
mobile/libs/libWindbot.aar
mobile/libs/libWindbot.aar
+0
-0
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
+1
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+0
-23
mobile/src/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
...c/main/java/cn/garymb/ygomobile/ui/home/ResCheckTask.java
+27
-4
No files found.
mobile/build.gradle
View file @
836cc324
...
...
@@ -13,7 +13,7 @@ android {
flavorDimensions
"versionCode"
vectorDrawables
.
useSupportLibrary
=
true
ndk
{
abiFilters
"armeabi-v7a"
,
"armeabi"
abiFilters
"armeabi-v7a"
}
}
compileOptions
{
...
...
mobile/libs/libWindbot.aar
View file @
836cc324
No preview for this file type
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
View file @
836cc324
...
...
@@ -50,6 +50,7 @@ public interface Constants {
String
ASSET_LIMIT_PNG
=
ASSETS_PATH
+
"textures/lim.png"
;
String
DEFAULT_FONT_NAME
=
"ygo.ttf"
;
String
DATABASE_NAME
=
"cards.cdb"
;
String
BOT_CONF
=
"bot.conf"
;
String
WINDBOT_PATH
=
"windbot"
;
String
FONT_DIRECTORY
=
"fonts"
;
String
CORE_STRING_PATH
=
"strings.conf"
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
836cc324
...
...
@@ -31,7 +31,6 @@ import com.nightonke.boommenu.BoomMenuButton;
import
com.qihoo.appstore.common.updatesdk.lib.UpdateHelper
;
import
com.tubb.smrv.SwipeMenuRecyclerView
;
import
org.chromium.mojo.bindings.MessageReceiver
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
import
org.greenrobot.eventbus.ThreadMode
;
...
...
@@ -46,7 +45,6 @@ import cn.garymb.ygomobile.YGOStarter;
import
cn.garymb.ygomobile.bean.ServerInfo
;
import
cn.garymb.ygomobile.bean.events.ServerInfoEvent
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.activities.AboutActivity
;
import
cn.garymb.ygomobile.ui.activities.BaseActivity
;
import
cn.garymb.ygomobile.ui.activities.WebActivity
;
import
cn.garymb.ygomobile.ui.adapters.ServerListAdapter
;
...
...
@@ -60,8 +58,6 @@ import cn.garymb.ygomobile.ui.preference.SettingsActivity;
import
cn.garymb.ygomobile.utils.AlipayPayUtils
;
import
libwindbot.windbot.WindBot
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
DATABASE_NAME
;
abstract
class
HomeActivity
extends
BaseActivity
implements
NavigationView
.
OnNavigationItemSelectedListener
{
protected
SwipeMenuRecyclerView
mServerList
;
private
ServerListAdapter
mServerListAdapter
;
...
...
@@ -93,7 +89,6 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
TrPay
.
getInstance
(
HomeActivity
.
this
).
initPaySdk
(
"e1014da420ea4405898c01273d6731b6"
,
"YGOMobile"
);
//autoupadte checking
checkForceUpdateSilent
();
checkWindbot
();
}
@Override
...
...
@@ -102,17 +97,6 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
EventBus
.
getDefault
().
unregister
(
this
);
}
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
);
}
}
};
@Subscribe
(
threadMode
=
ThreadMode
.
MAIN
)
public
void
onServerInfoEvent
(
ServerInfoEvent
event
)
{
if
(
event
.
delete
)
{
...
...
@@ -386,12 +370,5 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
long
intervalMillis
=
0
*
1000L
;
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 @
836cc324
...
...
@@ -170,6 +170,8 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
IOUtils
.
copyFilesFromAssets
(
mContext
,
getDatapath
(
Constants
.
CORE_EXPANSIONS
),
mSettings
.
getExpansionsPath
().
getAbsolutePath
(),
true
,
needsUpdate
);
}
//checkWindbot();
han
.
sendEmptyMessage
(
0
);
}
catch
(
Exception
e
)
{
...
...
@@ -301,7 +303,9 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
}
//替换换行符
File
stringfile
=
new
File
(
AppsSettings
.
get
().
getResourcePath
(),
Constants
.
CORE_STRING_PATH
);
File
botfile
=
new
File
(
AppsSettings
.
get
().
getResourcePath
(),
Constants
.
BOT_CONF
);
fixString
(
stringfile
.
getAbsolutePath
());
fixString
(
botfile
.
getAbsolutePath
());
return
ERROR_NONE
;
}
catch
(
IOException
e
)
{
if
(
Constants
.
DEBUG
)
...
...
@@ -321,17 +325,36 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
void
onResCheckFinished
(
int
result
,
boolean
isNewVersion
);
}
public
void
checkWindbot
(){
Log
.
i
(
"路径"
,
mContext
.
getFilesDir
().
getPath
());
Log
.
i
(
"路径2"
,
mSettings
.
getDataBasePath
()+
"/"
+
DATABASE_NAME
);
WindBot
.
initAndroid
(
mContext
.
getFilesDir
().
getPath
(),
mSettings
.
getDataBasePath
()+
"/"
+
DATABASE_NAME
);
ResCheckTask
.
MessageReceiver
mReceiver
=
new
ResCheckTask
.
MessageReceiver
();
IntentFilter
filter
=
new
IntentFilter
();
filter
.
addAction
(
"RUN_WINDBOT"
);
mContext
.
registerReceiver
(
mReceiver
,
filter
);
}
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
);
}
}
};
Handler
han
=
new
Handler
(){
@Override
public
void
handleMessage
(
Message
msg
)
{
public
void
handleMessage
(
Message
msg
)
{
// TODO: Implement this method
super
.
handleMessage
(
msg
);
switch
(
msg
.
what
){
case
0
:
Log
.
i
(
"运行了没?"
,
"运行了"
);
//checkWindbot();
checkWindbot
();
break
;
}
}
...
...
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