Commit b06d9c19 authored by fallenstardust's avatar fallenstardust

test bot

parent 66a2fc7a
......@@ -8,7 +8,7 @@ android {
applicationId "cn.garymb.ygomobile"
minSdkVersion 16
targetSdkVersion 22
versionCode 32010522
versionCode 32010523
versionName "3.2.1"
flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true
......
......@@ -3,6 +3,7 @@ package cn.garymb.ygomobile.ui.home;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.NonNull;
......@@ -11,6 +12,7 @@ import android.support.design.widget.NavigationView;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseArray;
import android.view.Gravity;
import android.view.Menu;
......@@ -58,6 +60,8 @@ 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;
......@@ -89,6 +93,7 @@ abstract class HomeActivity extends BaseActivity implements NavigationView.OnNav
TrPay.getInstance(HomeActivity.this).initPaySdk("e1014da420ea4405898c01273d6731b6","YGOMobile");
//autoupadte checking
checkForceUpdateSilent();
checkWindbot();
}
@Override
......@@ -381,5 +386,12 @@ 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);
}
}
......@@ -9,6 +9,7 @@ import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
......@@ -169,9 +170,7 @@ 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) {
if (Constants.DEBUG)
......@@ -322,23 +321,20 @@ 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 {
Handler han=new Handler(){
@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 void handleMessage(Message msg) {
super.handleMessage(msg);
switch(msg.what){
case 0:
Log.i("运行了没?","运行了");
//checkWindbot();
break;
}
}
};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment