2.4
发版前更新 新增悬浮窗设置选项
This commit is contained in:
parent
458206ae23
commit
8e5775b45b
Binary file not shown.
@ -8,7 +8,7 @@ android {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
versionCode 2
|
||||
versionName "2.3"
|
||||
versionName "2.4"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
ndk {
|
||||
abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
|
||||
|
@ -25,6 +25,7 @@ import com.yutou.jianr_mg.Data.ShipEquipmnt;
|
||||
import com.yutou.jianr_mg.Data.TeamData;
|
||||
import com.yutou.jianr_mg.R;
|
||||
import com.yutou.jianr_mg.Tools.JianRUtils;
|
||||
import com.yutou.jianr_mg.Tools.Log;
|
||||
import com.yutou.jianr_mg.Tools.Utils;
|
||||
|
||||
import java.util.List;
|
||||
@ -99,22 +100,22 @@ public class MagicTeamDataAdapter extends BaseAdapter {
|
||||
if (Float.valueOf(data.getHp()) > (Float.valueOf(data.getHpMax()) / 2)) {
|
||||
ClipDrawable d = new ClipDrawable(new ColorDrawable(Color.DKGRAY), Gravity.START, ClipDrawable.HORIZONTAL);
|
||||
item.hpBar.setProgressDrawable(d);
|
||||
System.out.println(data.getTitle()+"设置颜色:绿色"+data.getHp()+"/"+data.getHpMax());
|
||||
Log.i(data.getTitle()+"设置颜色:绿色"+data.getHp()+"/"+data.getHpMax());
|
||||
} else if (Float.valueOf(data.getHp()) < (Float.valueOf(data.getHpMax()) / 2)&&Float.valueOf(data.getHp()) >= (Float.valueOf(data.getHpMax()) / 2/ 2)) {
|
||||
ClipDrawable d = new ClipDrawable(new ColorDrawable(Color.YELLOW), Gravity.START, ClipDrawable.HORIZONTAL);
|
||||
item.hpBar.setProgressDrawable(d);
|
||||
System.out.println(data.getTitle()+"设置颜色:黄色"+data.getHp()+"/"+data.getHpMax());
|
||||
Log.i(data.getTitle()+"设置颜色:黄色"+data.getHp()+"/"+data.getHpMax());
|
||||
} else if (Float.valueOf(data.getHp()) < (Float.valueOf(data.getHpMax()) / 2/ 2) ) {
|
||||
ClipDrawable d = new ClipDrawable(new ColorDrawable(Color.RED), Gravity.START, ClipDrawable.HORIZONTAL);
|
||||
item.hpBar.setProgressDrawable(d);
|
||||
System.out.println(data.getTitle()+"设置颜色:红色"+data.getHp()+"/"+data.getHpMax());
|
||||
Log.i(data.getTitle()+"设置颜色:红色"+data.getHp()+"/"+data.getHpMax());
|
||||
}else{
|
||||
System.out.println("没有设置颜色");
|
||||
Log.i("没有设置颜色");
|
||||
}
|
||||
if(data.getTitle().equals("凰")){
|
||||
item.hpBar.setMax(100);
|
||||
item.hpBar.setProgress(86);
|
||||
System.out.println("赤城的参数"+getHp(data.getHp(),data.getHpMax())+" "+(Float.valueOf(data.getHp()) > (Float.valueOf(data.getHpMax()) / 2)));
|
||||
Log.i("赤城的参数"+getHp(data.getHp(),data.getHpMax())+" "+(Float.valueOf(data.getHp()) > (Float.valueOf(data.getHpMax()) / 2)));
|
||||
|
||||
}else
|
||||
item.hpBar.setProgress((int) getHp(data.getHp(),data.getHpMax()));
|
||||
@ -280,7 +281,7 @@ public class MagicTeamDataAdapter extends BaseAdapter {
|
||||
msg.append(equipmnt.getDesc());
|
||||
i=msg.toString().split("\n").length;
|
||||
textView.setText(msg.toString());
|
||||
// System.out.println(equipmnt.toString());
|
||||
// Log.i(equipmnt.toString());
|
||||
}else{
|
||||
textView.setText("Not Equipmnt Info");
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import com.yutou.jianr_mg.Data.AppData;
|
||||
import com.yutou.jianr_mg.Data.MAppTools;
|
||||
import com.yutou.jianr_mg.R;
|
||||
import com.yutou.jianr_mg.Tools.JianRUtils;
|
||||
import com.yutou.jianr_mg.Tools.Log;
|
||||
import com.yutou.jianr_mg.Tools.Utils;
|
||||
import com.yutou.jianr_mg.views.BaseActivity;
|
||||
|
||||
@ -78,13 +79,13 @@ public class MainUtilsAdapter extends RecyclerAdapter<MAppTools> {
|
||||
getContext().startService(intent);
|
||||
break;
|
||||
case "localActivity":
|
||||
System.out.println("数据:" + data.toString());
|
||||
Log.i("数据:" + data.toString());
|
||||
intent = new Intent(getContext(), BaseActivity.class);
|
||||
intent.putExtra("activityName", main);
|
||||
intent.putExtra("jar", data.getUrl().split("/")[data.getUrl().split("/").length - 1]);
|
||||
intent.putExtra("name", data.getName());
|
||||
intent.putExtra("url", data.getUrl());
|
||||
System.out.println("插件数据:" + data.getUrl().split("/")[data.getUrl().split("/").length - 1]);
|
||||
Log.i("插件数据:" + data.getUrl().split("/")[data.getUrl().split("/").length - 1]);
|
||||
if (data.getParameter() != null) {
|
||||
intent.putExtra("parameter", data.getParameter());
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class Application extends android.app.Application {
|
||||
super.onCreate();
|
||||
Application.application = this;
|
||||
// BlockCanary.install(this, new AppBlockCanaryContext()).start();
|
||||
System.out.println("开始初始化");
|
||||
Log.i("开始初始化");
|
||||
|
||||
init();
|
||||
initPlugs();
|
||||
@ -61,7 +61,7 @@ public class Application extends android.app.Application {
|
||||
initTx();
|
||||
|
||||
|
||||
System.out.println("初始化结束");
|
||||
Log.i("初始化结束");
|
||||
}
|
||||
|
||||
private void initUmeng() {
|
||||
@ -72,12 +72,12 @@ public class Application extends android.app.Application {
|
||||
pushAgent.register(new IUmengRegisterCallback() {
|
||||
@Override
|
||||
public void onSuccess(String s) {
|
||||
System.out.println("友盟推送注册成功:" + s);
|
||||
Log.i("友盟推送注册成功:" + s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(String s, String s1) {
|
||||
System.out.println("友盟推送注册失败:" + s + "(" + s1 + ")");
|
||||
Log.i("友盟推送注册失败:" + s + "(" + s1 + ")");
|
||||
}
|
||||
});
|
||||
pushAgent.setMessageHandler(new UmengMessageHandler() {
|
||||
@ -102,7 +102,7 @@ public class Application extends android.app.Application {
|
||||
QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
|
||||
@Override
|
||||
public void onCoreInitFinished() {
|
||||
System.out.println("QDSDK初始化失败");
|
||||
Log.i("QDSDK初始化失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,7 +131,7 @@ public class Application extends android.app.Application {
|
||||
if (file.getName().contains(".jar")) {
|
||||
DexClassLoader dexClassLoader = new DexClassLoader(file.getAbsolutePath(), dex.getAbsolutePath(), null, getClassLoader());
|
||||
plugsin.put(file.getName(), dexClassLoader);
|
||||
System.out.println("加载插件:"+file.getName());
|
||||
Log.i("加载插件:"+file.getName());
|
||||
// AppData.plugsin.put(file.getName(), dexClassLoader);
|
||||
}
|
||||
}
|
||||
@ -148,7 +148,7 @@ public class Application extends android.app.Application {
|
||||
}
|
||||
String appid = (String) plugsin.get(file.getName()).loadClass("com.yutou.jianr_mg.plugins.Data").getField("appId").get(null);
|
||||
String md5 = Utils.getFileMD5(file);
|
||||
System.out.println("MD5:" + md5);
|
||||
Log.i("MD5:" + md5);
|
||||
JSONObject plugs = new JSONObject();
|
||||
plugs.put("appid", appid);
|
||||
plugs.put("md5", md5);
|
||||
|
@ -8,6 +8,7 @@ import android.database.sqlite.SQLiteOpenHelper;
|
||||
import com.yutou.jianr_mg.Application;
|
||||
import com.yutou.jianr_mg.Data.MGamePackname;
|
||||
import com.yutou.jianr_mg.Data.TMod;
|
||||
import com.yutou.jianr_mg.Tools.Log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -146,7 +147,7 @@ public class ModDatabase extends SQLiteOpenHelper {
|
||||
}
|
||||
cursor.close();
|
||||
}
|
||||
System.out.println(list.size());
|
||||
Log.i(list.size()+"");
|
||||
return list;
|
||||
}
|
||||
public int getModVersion(TMod mod){
|
||||
|
@ -16,6 +16,7 @@ import com.yutou.jianr_mg.Adapters.GameDataAdapters.WarAdapter;
|
||||
import com.yutou.jianr_mg.Data.AppData;
|
||||
import com.yutou.jianr_mg.Databases.JianRDataDataBase;
|
||||
import com.yutou.jianr_mg.R;
|
||||
import com.yutou.jianr_mg.Tools.Log;
|
||||
|
||||
import org.angmarch.views.NiceSpinner;
|
||||
import org.json.JSONObject;
|
||||
@ -157,7 +158,7 @@ public class WarFragment extends Fragment {
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(">>>>>>"+item.getInt("mapId"));
|
||||
Log.i(">>>>>>"+item.getInt("mapId"));
|
||||
if(Objects.requireNonNull(maps.get("DealNode")).getString("type").equals("DealNode")) {
|
||||
getItem(i, srcList);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import android.widget.ListView;
|
||||
|
||||
import com.umeng.commonsdk.debug.W;
|
||||
import com.yutou.jianr_mg.Fragments.GameDataFragments.WarLogFragments.Adapters.DaytimeListViewAdapter;
|
||||
import com.yutou.jianr_mg.Tools.Log;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
@ -97,11 +98,11 @@ public class DaytimeFragment extends Fragment implements WarLogInterface{
|
||||
List<WarData> list = new ArrayList<>();
|
||||
try {
|
||||
JSONArray nightAttacks = new JSONObject(json.getJSONObject("WarReport").getString("message")).getJSONObject("extraProgress").getJSONArray("nightAttacks");
|
||||
System.out.println("--------->夜战数量:"+nightAttacks.length());
|
||||
Log.i("--------->夜战数量:"+nightAttacks.length());
|
||||
for (int i = 0; i < nightAttacks.length(); i++) {
|
||||
System.out.println(nightAttacks.getJSONObject(i));
|
||||
Log.i(nightAttacks.getJSONObject(i).toString());
|
||||
WarData warData=WarData.getInstance(WarData.NIGHT_WAR,nightAttacks.getJSONObject(i),warReport);
|
||||
System.out.println(warData.toString());
|
||||
Log.i(warData.toString());
|
||||
list.add(warData);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -19,6 +19,7 @@ import com.yutou.jianr_mg.Interfaces.HttpInterface;
|
||||
import com.yutou.jianr_mg.Network.HttpApi;
|
||||
import com.yutou.jianr_mg.Network.HttpUtils;
|
||||
import com.yutou.jianr_mg.R;
|
||||
import com.yutou.jianr_mg.Tools.Log;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
@ -143,7 +144,7 @@ public class UtilsFragments extends Fragment {
|
||||
}
|
||||
}
|
||||
private void setData() {
|
||||
System.out.println(datas.size());
|
||||
Log.i(datas.size()+"");
|
||||
if(datas.size()>0){
|
||||
adapter.addAll(datas);
|
||||
recyclerView.dismissSwipeRefresh();
|
||||
|
@ -79,7 +79,7 @@ public class LoadingActivity extends AppCompatActivity {
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
AppData.debug=true;
|
||||
System.out.println("update");
|
||||
Log.i("update");
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
setContentView(R.layout.activity_loading);
|
||||
@ -435,7 +435,7 @@ public class LoadingActivity extends AppCompatActivity {
|
||||
if (requestCode == AppPermissions.REQUEST_CODE) {
|
||||
for (String permission : AppPermissions.permissions) {
|
||||
if (ActivityCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) {
|
||||
System.out.println(permission);
|
||||
Log.i(permission);
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ public class HttpApi {
|
||||
// public static final String HOME = "http://192.168.31.92:8080/"; //zzz_gz wifi
|
||||
// public static final String HOME = "http://192.168.43.68:8088/"; //zzz_gz wifi
|
||||
//public static final String HOME = "http://192.168.137.1:8088/"; //笔记本本身WIFI
|
||||
//public static final String HOME = "http://192.168.1.151:8080/"; //公司
|
||||
// public static final String HOME = "http://192.168.1.151:8080/"; //公司
|
||||
public static final String HOME_URL=HOME+"android/"; //服务器
|
||||
|
||||
public static final String MOD_ALL = "mod/all.do";
|
||||
|
@ -148,7 +148,7 @@ public class HttpUtils {
|
||||
while (!downloadFileInerface.downloading(getNameFromUrl(url), progress, total)) {
|
||||
Thread.sleep(10);
|
||||
}
|
||||
System.out.println("下载:" + progress);
|
||||
Log.i("下载:" + progress);
|
||||
}
|
||||
fos.flush();
|
||||
// 下载完成
|
||||
|
@ -28,7 +28,7 @@ public class ExcelUtils {
|
||||
bundle.putString("filePath", file.getAbsolutePath());
|
||||
bundle.putString("tempPath", Utils.getAppPath()+ "/" + "TbsReaderTemp");
|
||||
boolean flag= tbs.preOpen("xlsx", false);
|
||||
System.out.println("打开文件:"+flag);
|
||||
Log.i("打开文件:"+flag);
|
||||
tbs.openFile(bundle);
|
||||
}
|
||||
public void close(){
|
||||
|
@ -127,7 +127,7 @@ public class JianRUtils {
|
||||
|
||||
public static List<TeamData> getNightUserTeam(JSONObject json) {
|
||||
List<TeamData> data = getUserTeam(json);
|
||||
System.out.println("用户数量:" + data.size());
|
||||
Log.i("用户数量:" + data.size());
|
||||
try {
|
||||
JSONObject warRepoot = json.getJSONObject("warResult");
|
||||
JSONArray selfShips = warRepoot.getJSONArray("selfShipResults");
|
||||
@ -148,11 +148,11 @@ public class JianRUtils {
|
||||
try {
|
||||
JSONObject warRepoot = json.getJSONObject("warResult");
|
||||
JSONArray selfShips = warRepoot.getJSONArray("enemyShipResults");
|
||||
System.out.println("血量参数:" + selfShips.length());
|
||||
Log.i("血量参数:" + selfShips.length());
|
||||
for (int i = 0; i < selfShips.length(); i++) {
|
||||
JSONObject js = selfShips.getJSONObject(i);
|
||||
System.out.println("敌方血量:" + js.getInt("hp"));
|
||||
System.out.println("敌方数量:" + data.size());
|
||||
Log.i("敌方血量:" + js.getInt("hp"));
|
||||
Log.i("敌方数量:" + data.size());
|
||||
TeamData ut = data.get(i);
|
||||
ut.setHp(js.getInt("hp") + "");
|
||||
data.set(i, ut);
|
||||
@ -211,7 +211,7 @@ public class JianRUtils {
|
||||
JianNiang jianNiang = JSON.parseObject(json.toString(), JianNiang.class);
|
||||
jianNiangs.add(jianNiang);
|
||||
}
|
||||
System.out.println("缓存舰娘数:" + jianNiangs.size());
|
||||
Log.i("缓存舰娘数:" + jianNiangs.size());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -273,7 +273,7 @@ public class JianRUtils {
|
||||
ShipEquipmnt jianNiang = JSON.parseObject(json.toString(), ShipEquipmnt.class);
|
||||
equipmnts.add(jianNiang);
|
||||
}
|
||||
System.out.println("缓存装备数:" + equipmnts.size());
|
||||
Log.i("缓存装备数:" + equipmnts.size());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -23,7 +23,7 @@ public class Log {
|
||||
*/
|
||||
public static void i(String str) {
|
||||
if(LOG)
|
||||
System.out.println(str);
|
||||
System.out.println(str);
|
||||
}
|
||||
/**
|
||||
* 错误输出带标题
|
||||
@ -41,7 +41,7 @@ public class Log {
|
||||
*/
|
||||
public static void i(String title,String str) {
|
||||
if(LOG)
|
||||
System.out.println("["+title+"]"+str);
|
||||
Log.i("["+title+"]"+str);
|
||||
|
||||
}
|
||||
/**
|
||||
|
@ -61,7 +61,7 @@ public class ModUtils {
|
||||
private TMod mod;
|
||||
|
||||
public static ModUtils init(Context context) {
|
||||
System.out.println("调用魔改管理器");
|
||||
Log.i("调用魔改管理器");
|
||||
try {
|
||||
if (modUtils == null) {
|
||||
modUtils = new ModUtils();
|
||||
@ -271,7 +271,7 @@ public class ModUtils {
|
||||
public void getData(String data,Object src) {
|
||||
JSONObject json= (JSONObject) src;
|
||||
try {
|
||||
System.out.println(">>>>"+((String[])json.get("args"))[0]);
|
||||
Log.i(">>>>"+((String[])json.get("args"))[0]);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class RootUtils {
|
||||
println("chmod +x" + Application.application.getFilesDir() + "/files/busybox");
|
||||
isBusyBox=tmp;
|
||||
}
|
||||
System.out.println("尝试获取ROOT权限");
|
||||
Log.i("尝试获取ROOT权限");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -118,7 +118,7 @@ public class RootUtils {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
result = localProcess.waitFor(500, TimeUnit.MILLISECONDS);
|
||||
}else{
|
||||
System.out.println("b");
|
||||
Log.i("b");
|
||||
resultCode=localProcess.waitFor();
|
||||
}
|
||||
localDataOutputStream.close();
|
||||
|
@ -119,7 +119,7 @@ public class SocketTools {
|
||||
dialog.dismiss();
|
||||
new Thread(() -> {
|
||||
try {
|
||||
System.out.println("地址:"+editText.getText().toString()+" 端口:2336");
|
||||
Log.i("地址:"+editText.getText().toString()+" 端口:2336");
|
||||
Socket socket=new Socket(editText.getText().toString().trim(),2336);
|
||||
linkService(socket);
|
||||
|
||||
@ -144,9 +144,9 @@ public class SocketTools {
|
||||
KProgressHUD dhud=Utils.showLoading(context,null,"传输中");
|
||||
dhud.show();
|
||||
new Thread(() -> {
|
||||
System.out.println("开始传输:");
|
||||
Log.i("开始传输:");
|
||||
linkService(socket);
|
||||
System.out.println("传输完毕");
|
||||
Log.i("传输完毕");
|
||||
AppData.handler.post(()->{dhud.dismiss();dialog.dismiss();});
|
||||
dhud.dismiss();
|
||||
}).start();
|
||||
@ -233,7 +233,7 @@ public class SocketTools {
|
||||
baos.flush();
|
||||
String tmp = baos.toString();
|
||||
baos.close();
|
||||
System.out.println(tmp);
|
||||
Log.i(tmp);
|
||||
if (tmp.equals("ok")) {
|
||||
flag = false;
|
||||
AppData.handler.post(()->hud.dismiss());
|
||||
@ -280,7 +280,7 @@ public class SocketTools {
|
||||
// TODO: handle exception
|
||||
}
|
||||
}
|
||||
System.out.println("保存路径:"+file.getAbsolutePath());
|
||||
Log.i("保存路径:"+file.getAbsolutePath());
|
||||
Utils.Base64Decode(sb.toString(), file);
|
||||
AppData.handler.post(()->{hud.dismiss();Utils.toast(context,"重启盒子生效");});
|
||||
} catch (Exception e) {
|
||||
|
@ -20,7 +20,7 @@ public class ZipUtils {
|
||||
if (!descDirPath.exists()) {
|
||||
descDirPath.mkdirs();
|
||||
}
|
||||
System.out.println("文件:" + zipFile.exists());
|
||||
Log.i("文件:" + zipFile.exists());
|
||||
try {
|
||||
ZipFile _zipFile = new ZipFile(zipFile);
|
||||
//_zipFile.setFileNameCharset("GBK"); //设置编码格式(支持中文)
|
||||
|
@ -11,6 +11,7 @@ import com.yutou.jianr_mg.Application;
|
||||
import com.yutou.jianr_mg.Data.AppData;
|
||||
import com.yutou.jianr_mg.Databases.JianRDataDataBase;
|
||||
import com.yutou.jianr_mg.Tools.JianRUtils;
|
||||
import com.yutou.jianr_mg.Tools.Log;
|
||||
import com.yutou.jianr_mg.Tools.Utils;
|
||||
import com.yutou.jianr_mg.views.WarView;
|
||||
|
||||
@ -49,7 +50,7 @@ public class MagicBoxService {
|
||||
public static MagicBoxService init() {
|
||||
JianRUtils.readClientVersionIsbigzhao(Application.application);
|
||||
if (!Utils.getApplicationPackName(Application.application, AppData.magicPackageName)) {
|
||||
System.out.println("没有安装客户端");
|
||||
Log.i("没有安装客户端");
|
||||
return null;
|
||||
}
|
||||
if (magicBoxService == null) {
|
||||
@ -61,14 +62,14 @@ public class MagicBoxService {
|
||||
private ServiceConnection connection;
|
||||
|
||||
private void initMagicBox() {
|
||||
System.out.println("绑定大钊客户端");
|
||||
Log.i("绑定大钊客户端");
|
||||
isClose = false;
|
||||
connection = new ServiceConnection() {
|
||||
JianRDataDataBase dataBase;
|
||||
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
|
||||
System.out.println("链接大钊客户端");
|
||||
Log.i("链接大钊客户端");
|
||||
if (!Utils.testStringIsNull(dataName, dataType)) {
|
||||
dataBase = JianRDataDataBase.init();
|
||||
}
|
||||
@ -78,7 +79,7 @@ public class MagicBoxService {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isClose) {
|
||||
System.out.println("关闭连接");
|
||||
Log.i("关闭连接");
|
||||
cancel();
|
||||
return;
|
||||
}
|
||||
@ -93,7 +94,7 @@ public class MagicBoxService {
|
||||
magicBoxInterface.getData(boxBinder.getVersion() + "");
|
||||
} else {
|
||||
String[] args=(String[]) order.get("args");
|
||||
System.out.println("执行:"+order.getString("action")+" "+args[0]+" > "+args[1]);
|
||||
Log.i("执行:"+order.getString("action")+" "+args[0]+" > "+args[1]);
|
||||
magicBoxInterface.getData(boxBinder.action_remote(order.getString("action"),args ),order);
|
||||
}
|
||||
}catch (Exception e){
|
||||
@ -148,8 +149,8 @@ public class MagicBoxService {
|
||||
boxInterface.getData(json2.toString());
|
||||
}
|
||||
}
|
||||
// System.out.println("str = "+str);
|
||||
// System.out.println("str2 = "+str2);
|
||||
// Log.i("str = "+str);
|
||||
// Log.i("str2 = "+str2);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -160,7 +161,7 @@ public class MagicBoxService {
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName componentName) {
|
||||
System.out.println("大钊客户端连接失败:" + componentName.flattenToString());
|
||||
Log.i("大钊客户端连接失败:" + componentName.flattenToString());
|
||||
isClose = true;
|
||||
}
|
||||
};
|
||||
@ -177,7 +178,7 @@ public class MagicBoxService {
|
||||
intent.setAction(com.bigzhao.jianrmagicbox.IMagicBoxBinder.ACTION_SERVICE);
|
||||
intent.setPackage(AppData.magicPackageName);
|
||||
boolean tmp = Application.application.bindService(intent, connection, BIND_AUTO_CREATE);
|
||||
System.out.println("重新绑定结果:" + tmp);
|
||||
Log.i("重新绑定结果:" + tmp);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -13,9 +13,11 @@ import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Gravity;
|
||||
import android.view.KeyEvent;
|
||||
@ -36,6 +38,7 @@ import android.widget.SeekBar;
|
||||
import com.yutou.jianr_mg.Data.AppData;
|
||||
import com.yutou.jianr_mg.R;
|
||||
import com.yutou.jianr_mg.Tools.ExcelUtils;
|
||||
import com.yutou.jianr_mg.Tools.Log;
|
||||
import com.yutou.jianr_mg.Tools.Utils;
|
||||
import com.yutou.jianr_mg.views.ExcelActivity;
|
||||
import com.yutou.jianr_mg.views.WarView;
|
||||
@ -65,8 +68,8 @@ public class WindowsService extends Service {
|
||||
private ExcelUtils excel;
|
||||
private File excelFile;
|
||||
private Context context;
|
||||
private boolean input_flag = false,saveData=false;
|
||||
private String dataType,dataName;
|
||||
private boolean input_flag = false, saveData = false;
|
||||
private String dataType, dataName;
|
||||
private WarView warView;
|
||||
|
||||
private class MyBinder extends Binder {
|
||||
@ -87,9 +90,9 @@ public class WindowsService extends Service {
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
if (intent != null) {
|
||||
saveData = intent.getBooleanExtra("saveData", false);
|
||||
dataName=intent.getStringExtra("dataName");
|
||||
dataType=intent.getStringExtra("dataType");
|
||||
System.out.println("接收到配置,开关 = "+saveData+" name = "+dataName+" type = "+dataType);
|
||||
dataName = intent.getStringExtra("dataName");
|
||||
dataType = intent.getStringExtra("dataType");
|
||||
Log.i("接收到配置,开关 = " + saveData + " name = " + dataName + " type = " + dataType);
|
||||
|
||||
}
|
||||
return super.onStartCommand(intent, flags, startId);
|
||||
@ -99,10 +102,10 @@ public class WindowsService extends Service {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
System.out.println("触发悬浮窗");
|
||||
Log.i("触发悬浮窗");
|
||||
context = WindowsService.this;
|
||||
handler = new Handler();
|
||||
warView=new WarView(context,null,webW,handler);
|
||||
warView = new WarView(context, null, webW, handler);
|
||||
try {
|
||||
SharedPreferences sp = getSharedPreferences(ExcelActivity.excelName, MODE_PRIVATE);
|
||||
excelFile = new File(sp.getString("default", "null.xlsx"));
|
||||
@ -132,7 +135,8 @@ public class WindowsService extends Service {
|
||||
timer = new Timer();
|
||||
timer.schedule(new TimerTask() {
|
||||
boolean isRuntime = false;
|
||||
boolean listener=true;
|
||||
boolean listener = true;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
MagicBoxService boxService = MagicBoxService.init();
|
||||
@ -140,8 +144,8 @@ public class WindowsService extends Service {
|
||||
Utils.toast(context, "未安装专用客户端,部分功能将无法使用");
|
||||
cancel();
|
||||
return;
|
||||
}else{
|
||||
boxService.setSaveData(saveData,dataName,dataType);
|
||||
} else {
|
||||
boxService.setSaveData(saveData, dataName, dataType);
|
||||
}
|
||||
try {
|
||||
JSONObject json = new JSONObject();
|
||||
@ -154,8 +158,8 @@ public class WindowsService extends Service {
|
||||
isRuntime = true;
|
||||
}
|
||||
});
|
||||
if(listener) {
|
||||
listener=false;
|
||||
if (listener) {
|
||||
listener = false;
|
||||
}
|
||||
handler.post(() -> {
|
||||
if (isRuntime) {
|
||||
@ -210,10 +214,10 @@ public class WindowsService extends Service {
|
||||
Utils.toast(context, "专用客户端未安装(仅限共存版)");
|
||||
} else {
|
||||
Utils.toast(context, "专用客户端未启动");
|
||||
MagicBoxService service= MagicBoxService.init();
|
||||
if(service!=null){
|
||||
service.startService();
|
||||
}
|
||||
MagicBoxService service = MagicBoxService.init();
|
||||
if (service != null) {
|
||||
service.startService();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -242,31 +246,33 @@ public class WindowsService extends Service {
|
||||
}
|
||||
|
||||
}
|
||||
private int webW=0,webH=0;
|
||||
|
||||
private int webW = 0, webH = 0;
|
||||
|
||||
private void reloadUi() {
|
||||
if(webView.getLayoutParams().width>0) {
|
||||
if (webView.getLayoutParams().width > 0) {
|
||||
webW = webView.getLayoutParams().width;
|
||||
webH = webView.getLayoutParams().height;
|
||||
contextLayout.getLayoutParams().width=webW;
|
||||
contextLayout.getLayoutParams().width = webW;
|
||||
}
|
||||
int pushSize = Utils.getPixelsFromDp(AppData.activity, 10);
|
||||
int sideSize = Utils.getPixelsFromDp(AppData.activity, 45);
|
||||
int webSize =contextLayout.getLayoutParams().width;
|
||||
int webSize = contextLayout.getLayoutParams().width;
|
||||
if (side.getVisibility() == View.GONE) {
|
||||
sideSize = 0;
|
||||
}
|
||||
if (contextLayout.getVisibility() == View.GONE) {
|
||||
webSize = 0;
|
||||
}
|
||||
if(webSize<0){
|
||||
if (webSize < 0) {
|
||||
|
||||
}
|
||||
|
||||
System.out.println("push size:" + pushSize);
|
||||
System.out.println("side size:" + sideSize);
|
||||
System.out.println("webs size:" + webSize);
|
||||
params.width =pushSize + sideSize +webSize;
|
||||
System.out.println("悬浮窗大小:" + params.width+" push="+pushSize+" side="+sideSize+" wr="+webSize+" wit="+Utils.getMetrics(AppData.activity).widthPixels);
|
||||
Log.i("push size:" + pushSize);
|
||||
Log.i("side size:" + sideSize);
|
||||
Log.i("webs size:" + webSize);
|
||||
params.width = pushSize + sideSize + webSize;
|
||||
Log.i("悬浮窗大小:" + params.width + " push=" + pushSize + " side=" + sideSize + " wr=" + webSize + " wit=" + Utils.getMetrics(AppData.activity).widthPixels);
|
||||
windowManager.updateViewLayout(mainLayout, params);
|
||||
initWebUi();
|
||||
}
|
||||
@ -279,12 +285,12 @@ public class WindowsService extends Service {
|
||||
// 横屏
|
||||
width = metrics.widthPixels;
|
||||
width = (int) (width - (width * 0.1));
|
||||
System.out.println("横屏");
|
||||
Log.i("横屏");
|
||||
} else {
|
||||
// 竖屏
|
||||
width = metrics.widthPixels;
|
||||
width = (int) (width - (width * 0.2));
|
||||
System.out.println("竖屏");
|
||||
Log.i("竖屏");
|
||||
}
|
||||
webView.getLayoutParams().width = width;
|
||||
}
|
||||
@ -299,7 +305,7 @@ public class WindowsService extends Service {
|
||||
webView.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
System.out.println("加载网页:" + url);
|
||||
Log.i("加载网页:" + url);
|
||||
view.loadUrl(url);
|
||||
return true;
|
||||
}
|
||||
@ -343,17 +349,22 @@ public class WindowsService extends Service {
|
||||
strategy.setTag(204);
|
||||
strategy.setOnClickListener(new ButtonOnClick());
|
||||
|
||||
list.add(bbs);
|
||||
list.add(strategy);
|
||||
list.add(address);
|
||||
list.add(input);
|
||||
SharedPreferences winShared = this.getSharedPreferences("windowsConfig", Context.MODE_PRIVATE);
|
||||
if (winShared.getBoolean("bbs", true))
|
||||
list.add(bbs);
|
||||
if (winShared.getBoolean("strategy", true))
|
||||
list.add(strategy);
|
||||
if (winShared.getBoolean("address", true))
|
||||
list.add(address);
|
||||
if (winShared.getBoolean("input", true))
|
||||
list.add(input);
|
||||
// list.add(bookmark);
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<Button> getMagicButtons() {
|
||||
List<Button> list = new ArrayList<>();
|
||||
if (MagicBoxService.init() != null||true) {
|
||||
if (MagicBoxService.init() != null || true) {
|
||||
Button map = new Button(context);
|
||||
Button user = new Button(context);
|
||||
Button pool = new Button(context);
|
||||
@ -386,10 +397,14 @@ public class WindowsService extends Service {
|
||||
expedition.setOnClickListener(new ButtonOnClick());
|
||||
fix.setOnClickListener(new ButtonOnClick());
|
||||
|
||||
list.add(map);
|
||||
list.add(user);
|
||||
list.add(pool);
|
||||
list.add(build);
|
||||
SharedPreferences winShared = this.getSharedPreferences("windowsConfig", Context.MODE_PRIVATE);
|
||||
if (winShared.getBoolean("map", true))
|
||||
list.add(map);
|
||||
if (winShared.getBoolean("user", true))
|
||||
list.add(user);
|
||||
if (winShared.getBoolean("pool", true))
|
||||
list.add(pool);
|
||||
//list.add(build);
|
||||
//list.add(develop);
|
||||
//list.add(expedition);
|
||||
//list.add(fix);
|
||||
@ -426,12 +441,13 @@ public class WindowsService extends Service {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
reloadUi();
|
||||
}
|
||||
private void setWebUrl(String url){
|
||||
handler.post(()->{
|
||||
|
||||
private void setWebUrl(String url) {
|
||||
handler.post(() -> {
|
||||
if (contextLayout.getVisibility() == View.GONE) {
|
||||
contextLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if(excel!=null) {
|
||||
if (excel != null) {
|
||||
excel.close();
|
||||
excel = null;
|
||||
}
|
||||
@ -441,7 +457,7 @@ public class WindowsService extends Service {
|
||||
}
|
||||
setView(webView);
|
||||
reloadUi();
|
||||
webView.loadUrl(url);
|
||||
webView.loadUrl(url);
|
||||
|
||||
});
|
||||
}
|
||||
@ -467,7 +483,7 @@ public class WindowsService extends Service {
|
||||
bar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
|
||||
System.out.println("参数:" + i);
|
||||
Log.i("参数:" + i);
|
||||
params.alpha = i;
|
||||
windowManager.updateViewLayout(mainLayout, params);
|
||||
}
|
||||
@ -488,9 +504,9 @@ public class WindowsService extends Service {
|
||||
.setPositiveButton("确定", (dialogInterface, i) -> dialogInterface.dismiss()).create();
|
||||
dialog.getWindow().setType(params.type);
|
||||
dialog.show();
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Utils.toast(context,"可能您的设备不支持调节透明度");
|
||||
Utils.toast(context, "可能您的设备不支持调节透明度");
|
||||
}
|
||||
|
||||
break;
|
||||
@ -503,7 +519,7 @@ public class WindowsService extends Service {
|
||||
if (excel != null) {
|
||||
excel.stop();
|
||||
}
|
||||
if(warView!=null){
|
||||
if (warView != null) {
|
||||
warView.close();
|
||||
}
|
||||
stopSelf();
|
||||
@ -570,26 +586,26 @@ public class WindowsService extends Service {
|
||||
return;
|
||||
}
|
||||
|
||||
if(excel==null){
|
||||
excel=new ExcelUtils(AppData.activity);
|
||||
setView(excel.getReader());
|
||||
excel.getReader().getLayoutParams().height=contextLayout.getLayoutParams().height;
|
||||
if (excel == null) {
|
||||
excel = new ExcelUtils(AppData.activity);
|
||||
setView(excel.getReader());
|
||||
excel.getReader().getLayoutParams().height = contextLayout.getLayoutParams().height;
|
||||
excel.start(excelFile);
|
||||
}
|
||||
reloadUi();
|
||||
break;
|
||||
|
||||
case 100:
|
||||
if(service!=null){
|
||||
json=service.getDealNode();
|
||||
if (service != null) {
|
||||
json = service.getDealNode();
|
||||
service.getGetWarResult();
|
||||
if(json==null)
|
||||
if (json == null)
|
||||
return;
|
||||
JSONObject ext=new JSONObject(json.getString("ext"));
|
||||
if(ext.getString("s").equals("pve")){
|
||||
System.out.println("原参数:"+ext.toString());
|
||||
String url="http://js.ntwikis.com/jsp/apps/cancollezh/maps/detailnew.jsp?detailid="+((ext.getInt("n")/100)+"").replace("0","-");
|
||||
System.out.println("url:"+url);
|
||||
JSONObject ext = new JSONObject(json.getString("ext"));
|
||||
if (ext.getString("s").equals("pve")) {
|
||||
Log.i("原参数:" + ext.toString());
|
||||
String url = "http://js.ntwikis.com/jsp/apps/cancollezh/maps/detailnew.jsp?detailid=" + ((ext.getInt("n") / 100) + "").replace("0", "-");
|
||||
Log.i("url:" + url);
|
||||
setWebUrl(url);
|
||||
}
|
||||
reloadUi();
|
||||
@ -598,20 +614,20 @@ public class WindowsService extends Service {
|
||||
case 101:
|
||||
if (service != null) {
|
||||
json = service.getDealNode();
|
||||
if(json==null)
|
||||
if (json == null)
|
||||
return;
|
||||
JSONObject ext=new JSONObject(json.getString("ext"));
|
||||
System.out.println("EXT源:"+ext.toString());
|
||||
String url="http://www.jianrmod.cn/data/nodeDropInfo.html?node="+ext.getInt("n");
|
||||
System.out.println("url:"+url);
|
||||
JSONObject ext = new JSONObject(json.getString("ext"));
|
||||
Log.i("EXT源:" + ext.toString());
|
||||
String url = "http://www.jianrmod.cn/data/nodeDropInfo.html?node=" + ext.getInt("n");
|
||||
Log.i("url:" + url);
|
||||
setWebUrl(url);
|
||||
reloadUi();
|
||||
}
|
||||
break;
|
||||
case 102:
|
||||
if(service!=null) {
|
||||
if (service != null) {
|
||||
setView(warView.initView());
|
||||
warView.update(service,webW);
|
||||
warView.update(service, webW);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -41,8 +41,8 @@ public class BaseActivity extends AppCompatActivity {
|
||||
DexClassLoader dexClassLoader= AppData.plugsin.get(jar);
|
||||
|
||||
try {
|
||||
System.out.println("jar:"+jar);
|
||||
System.out.println("BaseActivity:"+baseActivityName);
|
||||
Log.i("jar:"+jar);
|
||||
Log.i("BaseActivity:"+baseActivityName);
|
||||
activityInterface= (BaseActivityInterface) dexClassLoader.loadClass(baseActivityName).newInstance();
|
||||
activityInterface.onCreate(savedInstanceState,main_layut,this,getIntent());
|
||||
} catch (Exception e) {
|
||||
|
@ -16,6 +16,7 @@ import com.yutou.jianr_mg.Interfaces.HttpInterface;
|
||||
import com.yutou.jianr_mg.Network.HttpApi;
|
||||
import com.yutou.jianr_mg.Network.HttpUtils;
|
||||
import com.yutou.jianr_mg.R;
|
||||
import com.yutou.jianr_mg.Tools.Log;
|
||||
import com.yutou.jianr_mg.Tools.ModUtils;
|
||||
|
||||
import org.json.JSONArray;
|
||||
@ -70,7 +71,7 @@ public class DownloadListActivity extends AppCompatActivity {
|
||||
for (TMod mod : mods) {
|
||||
for (TMod tMod : mods_) {
|
||||
if (tMod.getTitle().equals(mod.getTitle()) && tMod.getModversion() < mod.getModversion()) {
|
||||
System.out.println(tMod.getTitle() + " " + tMod.getModversion() + " " + mod.getTitle() + " " + mod.getModversion());
|
||||
Log.i(tMod.getTitle() + " " + tMod.getModversion() + " " + mod.getTitle() + " " + mod.getModversion());
|
||||
title += "\n" + tMod.getTitle();
|
||||
ids.add(mod);
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import com.yutou.jianr_mg.Interfaces.DownloadFileInerface;
|
||||
import com.yutou.jianr_mg.Network.HttpUtils;
|
||||
import com.yutou.jianr_mg.R;
|
||||
import com.yutou.jianr_mg.Tools.ExcelUtils;
|
||||
import com.yutou.jianr_mg.Tools.Log;
|
||||
import com.yutou.jianr_mg.Tools.Utils;
|
||||
|
||||
import org.json.JSONException;
|
||||
@ -161,10 +162,10 @@ public class ExcelActivity extends AppCompatActivity {
|
||||
try {
|
||||
File file = new File(Utils.getAppPath() + "/data/" + parame.getString("fileName"));
|
||||
// file = new File("/storage/emulated/0/jianRMG/data/jianrData.xlsx");
|
||||
System.out.println(file.getAbsolutePath()+" "+file.exists());
|
||||
Log.i(file.getAbsolutePath()+" "+file.exists());
|
||||
excel.start(file);
|
||||
setTitle(parame.getString("name")+" by-"+parame.getString("by"));
|
||||
System.out.println("------->"+excel.getReader().getHeight());
|
||||
Log.i("------->"+excel.getReader().getHeight());
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
finish();
|
||||
|
@ -109,8 +109,8 @@ public class FavoritesActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
private void setData() {
|
||||
System.out.println("列表数量");
|
||||
System.out.println(modList.size());
|
||||
Log.i("列表数量");
|
||||
Log.i(modList.size()+"");
|
||||
recyclerView.dismissSwipeRefresh();
|
||||
if (isReload) {
|
||||
adapter.clear();
|
||||
|
@ -18,6 +18,7 @@ import com.yutou.jianr_mg.Interfaces.HttpInterface;
|
||||
import com.yutou.jianr_mg.Network.HttpApi;
|
||||
import com.yutou.jianr_mg.Network.HttpUtils;
|
||||
import com.yutou.jianr_mg.Tools.CDNTools;
|
||||
import com.yutou.jianr_mg.Tools.Log;
|
||||
import com.yutou.jianr_mg.Tools.SocketTools;
|
||||
import com.yutou.jianr_mg.Tools.Utils;
|
||||
|
||||
@ -85,7 +86,7 @@ public class GameDataActivity extends AppCompatActivity implements View.OnClickL
|
||||
@Override
|
||||
public void httpGetData(String string, int code) {
|
||||
try {
|
||||
System.out.println(string);
|
||||
Log.i(string);
|
||||
JSONObject json = new JSONObject(string);
|
||||
if (json.getInt("code") == 100) {
|
||||
String token = json.getJSONObject("data").getString("token");
|
||||
@ -205,7 +206,7 @@ public class GameDataActivity extends AppCompatActivity implements View.OnClickL
|
||||
new SocketTools(this, true, new HttpInterface() {
|
||||
@Override
|
||||
public void httpGetData(String string, int code) {
|
||||
System.out.println(string);
|
||||
Log.i(string);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -61,7 +61,7 @@ public class HomeHeader {
|
||||
|
||||
public static HomeHeader getHome(Context context) {
|
||||
if (header == null) {
|
||||
System.out.println("初始化头部");
|
||||
Log.i("初始化头部");
|
||||
header = new HomeHeader(context);
|
||||
}
|
||||
return header;
|
||||
@ -180,7 +180,7 @@ public class HomeHeader {
|
||||
|
||||
@Override
|
||||
public void onADReceive() {
|
||||
System.out.println("测试Receive");
|
||||
Log.i("测试Receive");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -230,7 +230,7 @@ public class HomeHeader {
|
||||
return;
|
||||
}
|
||||
isFlash = false;
|
||||
System.out.println("刷新一言");
|
||||
Log.i("刷新一言");
|
||||
HttpUtils.get(HttpApi.HITOKOTO_API, new HttpInterface() {
|
||||
JSONObject json = new JSONObject();
|
||||
|
||||
|
@ -26,6 +26,7 @@ import com.yutou.jianr_mg.Network.HttpApi;
|
||||
import com.yutou.jianr_mg.Network.HttpUtils;
|
||||
import com.yutou.jianr_mg.R;
|
||||
import com.yutou.jianr_mg.Tools.JianRUtils;
|
||||
import com.yutou.jianr_mg.Tools.Log;
|
||||
import com.yutou.jianr_mg.Tools.Utils;
|
||||
|
||||
import org.json.JSONArray;
|
||||
@ -218,7 +219,7 @@ public class MapTopActivity extends AppCompatActivity {
|
||||
});
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
System.out.println(string);
|
||||
Log.i(string);
|
||||
}
|
||||
handler.post(()->{
|
||||
hud.dismiss();
|
||||
|
@ -14,6 +14,7 @@ import com.yutou.jianr_mg.Adapters.MagicTeamDataAdapter;
|
||||
import com.yutou.jianr_mg.Data.TeamData;
|
||||
import com.yutou.jianr_mg.Databases.JianRDataDataBase;
|
||||
import com.yutou.jianr_mg.Tools.JianRUtils;
|
||||
import com.yutou.jianr_mg.Tools.Log;
|
||||
import com.yutou.jianr_mg.Tools.Utils;
|
||||
import com.yutou.jianr_mg.services.MagicBoxService;
|
||||
|
||||
@ -87,28 +88,28 @@ public class WarView {
|
||||
adapter.setData(JianRUtils.getUserTeam(message));
|
||||
listView.setTag(1);
|
||||
}
|
||||
System.out.println("更新数据:"+adapter.getCount()+" "+listView.getTag());
|
||||
System.out.println(adapter.getItem(0).toString());
|
||||
Log.i("更新数据:"+adapter.getCount()+" "+listView.getTag());
|
||||
Log.i(adapter.getItem(0).toString());
|
||||
handler.post(() -> adapter.notifyDataSetChanged());
|
||||
}
|
||||
//夜战
|
||||
nMsg=new JSONObject(WarView.this.nightData.getString("message"));
|
||||
isNight = !nMsg.isNull("extraProgress");
|
||||
if(!Utils.getMD5(nMsg.toString()).equals(nMd5)){
|
||||
System.out.println("夜战,TAG:"+listView.getTag());
|
||||
Log.i("夜战,TAG:"+listView.getTag());
|
||||
nMd5=Utils.getMD5(nMsg.toString());
|
||||
if(!nMsg.isNull("extraProgress")){
|
||||
if((int)listView.getTag()==1){
|
||||
System.out.println("夜战,敌舰");
|
||||
Log.i("夜战,敌舰");
|
||||
adapter.setData(JianRUtils.getNightEnemyTeam(nMsg));
|
||||
listView.setTag(0);
|
||||
}else {
|
||||
System.out.println("夜战,己方");
|
||||
Log.i("夜战,己方");
|
||||
adapter.setData(JianRUtils.getNightUserTeam(nMsg));
|
||||
listView.setTag(1);
|
||||
}
|
||||
System.out.println("更新夜战:"+adapter.getCount()+" "+listView.getTag());
|
||||
System.out.println(adapter.getItem(0).toString());
|
||||
Log.i("更新夜战:"+adapter.getCount()+" "+listView.getTag());
|
||||
Log.i(adapter.getItem(0).toString());
|
||||
handler.post(() -> adapter.notifyDataSetChanged());
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,13 @@
|
||||
package com.yutou.jianr_mg.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
@ -35,6 +39,7 @@ public class WindowsStartActivity extends AppCompatActivity implements View.OnCl
|
||||
private Button start;
|
||||
private Button help;
|
||||
private Button updata;
|
||||
private Button config;
|
||||
ArrayAdapter typeAdapter;
|
||||
ArrayAdapter nameAdapter;
|
||||
|
||||
@ -54,6 +59,7 @@ public class WindowsStartActivity extends AppCompatActivity implements View.OnCl
|
||||
dataName = findViewById(R.id.dataName);
|
||||
nameAdd = findViewById(R.id.nameAdd);
|
||||
nameRemove = findViewById(R.id.nameRemove);
|
||||
config = findViewById(R.id.config);
|
||||
dataConfig = findViewById(R.id.dataConfig);
|
||||
start = findViewById(R.id.start);
|
||||
help = findViewById(R.id.help);
|
||||
@ -66,6 +72,7 @@ public class WindowsStartActivity extends AppCompatActivity implements View.OnCl
|
||||
start.setOnClickListener(this);
|
||||
help.setOnClickListener(this);
|
||||
updata.setOnClickListener(this);
|
||||
config.setOnClickListener(this);
|
||||
|
||||
|
||||
saveData.setOnCheckedChangeListener((compoundButton, b) -> {
|
||||
@ -78,8 +85,8 @@ public class WindowsStartActivity extends AppCompatActivity implements View.OnCl
|
||||
}
|
||||
});
|
||||
saveData.setTag(true);
|
||||
typeAdapter=new ArrayAdapter<>(this,android.R.layout.simple_spinner_dropdown_item,getType());
|
||||
nameAdapter=new ArrayAdapter<>(this,android.R.layout.simple_spinner_dropdown_item,getName(null));
|
||||
typeAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, getType());
|
||||
nameAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, getName(null));
|
||||
dataName.setAdapter(nameAdapter);
|
||||
dataType.setAdapter(typeAdapter);
|
||||
dataType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@ -95,23 +102,25 @@ public class WindowsStartActivity extends AppCompatActivity implements View.OnCl
|
||||
});
|
||||
reloadSpinner();
|
||||
}
|
||||
private void reloadSpinner(){
|
||||
|
||||
private void reloadSpinner() {
|
||||
nameAdapter.clear();
|
||||
typeAdapter.clear();
|
||||
typeAdapter.addAll(getType());
|
||||
try {
|
||||
nameAdapter.addAll(getName(dataType.getSelectedItem().toString()));
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
nameAdapter.addAll(getName(null));
|
||||
}
|
||||
|
||||
nameAdapter.notifyDataSetChanged();
|
||||
typeAdapter.notifyDataSetChanged();
|
||||
nameAdapter.notifyDataSetChanged();
|
||||
typeAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public List<String> getType() {
|
||||
List<String> list = new ArrayList<>();
|
||||
try {
|
||||
list.addAll(JianRDataDataBase.init().getTypes());
|
||||
list.addAll(JianRDataDataBase.init().getTypes());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -124,7 +133,7 @@ public class WindowsStartActivity extends AppCompatActivity implements View.OnCl
|
||||
public List<String> getName(String type) {
|
||||
List<String> list = new ArrayList<>();
|
||||
try {
|
||||
list.addAll(JianRDataDataBase.init().getNames(type));
|
||||
list.addAll(JianRDataDataBase.init().getNames(type));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -150,13 +159,13 @@ public class WindowsStartActivity extends AppCompatActivity implements View.OnCl
|
||||
removeName();
|
||||
break;
|
||||
case R.id.updata:
|
||||
Intent gameData=new Intent(this,GameDataActivity.class);
|
||||
Intent gameData = new Intent(this, GameDataActivity.class);
|
||||
startActivity(gameData);
|
||||
break;
|
||||
case R.id.start:
|
||||
Intent intent = new Intent(this, WindowsService.class);
|
||||
intent.putExtra("saveData", ((boolean) saveData.getTag()));
|
||||
if((boolean)saveData.getTag()) {
|
||||
if ((boolean) saveData.getTag()) {
|
||||
intent.putExtra("dataType", dataType.getSelectedItem().toString());
|
||||
intent.putExtra("dataName", dataName.getSelectedItem().toString());
|
||||
}
|
||||
@ -164,10 +173,13 @@ public class WindowsStartActivity extends AppCompatActivity implements View.OnCl
|
||||
finish();
|
||||
break;
|
||||
case R.id.help:
|
||||
Intent hpIntent=new Intent(this,WebActivity.class);
|
||||
hpIntent.putExtra("url","http://bbs.jianrmod.cn/forum.php?mod=viewthread&tid=185&page=1&extra=#pid340");
|
||||
Intent hpIntent = new Intent(this, WebActivity.class);
|
||||
hpIntent.putExtra("url", "http://bbs.jianrmod.cn/forum.php?mod=viewthread&tid=185&page=1&extra=#pid340");
|
||||
startActivity(hpIntent);
|
||||
break;
|
||||
case R.id.config:
|
||||
showConfigDialog();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -188,6 +200,7 @@ public class WindowsStartActivity extends AppCompatActivity implements View.OnCl
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
public void removeName() {
|
||||
MaterialDialog dialog = new MaterialDialog(this);
|
||||
dialog.setTitle("删除数据库");
|
||||
@ -196,7 +209,7 @@ public class WindowsStartActivity extends AppCompatActivity implements View.OnCl
|
||||
dialog.setNegativeButton("取消", view -> dialog.dismiss());
|
||||
dialog.setPositiveButton("确定", view -> {
|
||||
try {
|
||||
if(dataType.getSelectedItem().toString().equals("-请从右侧按钮添加-")){
|
||||
if (dataType.getSelectedItem().toString().equals("-请从右侧按钮添加-")) {
|
||||
Utils.toast(this, "请先选择分类");
|
||||
return;
|
||||
}
|
||||
@ -251,12 +264,12 @@ public class WindowsStartActivity extends AppCompatActivity implements View.OnCl
|
||||
editText.setText("默认");
|
||||
return;
|
||||
}
|
||||
if(dataType.getSelectedItem().toString().equals("-请从右侧按钮添加-")){
|
||||
if (dataType.getSelectedItem().toString().equals("-请从右侧按钮添加-")) {
|
||||
Utils.toast(this, "请先选择分类");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
JianRDataDataBase.init().addName(dataType.getSelectedItem().toString(),editText.getText().toString());
|
||||
JianRDataDataBase.init().addName(dataType.getSelectedItem().toString(), editText.getText().toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -265,4 +278,106 @@ public class WindowsStartActivity extends AppCompatActivity implements View.OnCl
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
private void showConfigDialog() {
|
||||
SharedPreferences winShared = this.getSharedPreferences("windowsConfig", Context.MODE_PRIVATE);
|
||||
|
||||
Switch map = new Switch(this);
|
||||
Switch user = new Switch(this);
|
||||
Switch pool = new Switch(this);
|
||||
Switch bbs = new Switch(this);
|
||||
Switch strategy = new Switch(this);
|
||||
Switch input = new Switch(this);
|
||||
Switch address = new Switch(this);
|
||||
Switch win = new Switch(this);
|
||||
Switch alpha = new Switch(this);
|
||||
Switch exit = new Switch(this);
|
||||
|
||||
map.setText("地图信息");
|
||||
user.setText("当前地图掉落");
|
||||
pool.setText("战斗剧透");
|
||||
bbs.setText("论坛");
|
||||
strategy.setText("离线地图攻略");
|
||||
address.setText("浏览器地址");
|
||||
input.setText("悬浮窗输入法监听");
|
||||
win.setText("悬浮窗最大化");
|
||||
alpha.setText("透明度");
|
||||
exit.setText("退出悬浮窗");
|
||||
win.setEnabled(false);
|
||||
alpha.setEnabled(false);
|
||||
exit.setEnabled(false);
|
||||
|
||||
if (winShared.getBoolean("map", true))
|
||||
map.setChecked(true);
|
||||
if (winShared.getBoolean("user", true))
|
||||
user.setChecked(true);
|
||||
if (winShared.getBoolean("pool", true))
|
||||
pool.setChecked(true);
|
||||
if (winShared.getBoolean("bbs", true))
|
||||
bbs.setChecked(true);
|
||||
if (winShared.getBoolean("strategy", true))
|
||||
strategy.setChecked(true);
|
||||
if (winShared.getBoolean("address", true))
|
||||
address.setChecked(true);
|
||||
if (winShared.getBoolean("input", true))
|
||||
input.setChecked(true);
|
||||
win.setChecked(true);
|
||||
alpha.setChecked(true);
|
||||
exit.setChecked(true);
|
||||
|
||||
LinearLayout layout = new LinearLayout(this);
|
||||
layout.setOrientation(LinearLayout.VERTICAL);
|
||||
layout.addView(map);
|
||||
layout.addView(user);
|
||||
layout.addView(pool);
|
||||
layout.addView(bbs);
|
||||
layout.addView(strategy);
|
||||
layout.addView(address);
|
||||
layout.addView(input);
|
||||
layout.addView(win);
|
||||
layout.addView(alpha);
|
||||
layout.addView(exit);
|
||||
|
||||
|
||||
MaterialDialog dialog = new MaterialDialog(this);
|
||||
dialog.setTitle("悬浮窗设置");
|
||||
dialog.setContentView(layout);
|
||||
dialog.setPositiveButton("确定", new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
SharedPreferences.Editor editor = winShared.edit();
|
||||
if (map.isChecked())
|
||||
editor.putBoolean("map", true);
|
||||
else
|
||||
editor.putBoolean("map", false);
|
||||
if (user.isChecked())
|
||||
editor.putBoolean("user", true);
|
||||
else
|
||||
editor.putBoolean("user", false);
|
||||
if (pool.isChecked())
|
||||
editor.putBoolean("pool", true);
|
||||
else
|
||||
editor.putBoolean("pool", false);
|
||||
if (bbs.isChecked())
|
||||
editor.putBoolean("bbs", true);
|
||||
else
|
||||
editor.putBoolean("bbs", false);
|
||||
if (strategy.isChecked())
|
||||
editor.putBoolean("strategy", true);
|
||||
else
|
||||
editor.putBoolean("strategy", false);
|
||||
if (address.isChecked())
|
||||
editor.putBoolean("address", true);
|
||||
else
|
||||
editor.putBoolean("address", false);
|
||||
if (input.isChecked())
|
||||
editor.putBoolean("input", true);
|
||||
else
|
||||
editor.putBoolean("input", false);
|
||||
editor.apply();
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
}
|
||||
|
@ -132,4 +132,14 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/start"
|
||||
app:layout_constraintTop_toBottomOf="@+id/help" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/config"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="悬浮窗设置"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/start"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/dataConfig" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -17,6 +17,7 @@ import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.jianrmod.plugins.harmony.Log;
|
||||
import com.jianrmod.plugins.harmony.Tools.ClientUttls;
|
||||
import com.jianrmod.plugins.harmony.Tools.HttpInterface;
|
||||
import com.jianrmod.plugins.harmony.Tools.HttpTools;
|
||||
@ -162,7 +163,7 @@ public class MainActivity implements BaseActivityInterface {
|
||||
Toast.makeText(context,"网络请求失败,1秒钟后再试试",Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
System.out.println("httpData:"+httpData);
|
||||
Log.i("httpData:"+httpData);
|
||||
hud.show();
|
||||
final File file = new File(Utils.getAppPath(context) + "/harmony/");
|
||||
if(!file.exists()){
|
||||
@ -175,28 +176,28 @@ public class MainActivity implements BaseActivityInterface {
|
||||
return;
|
||||
}
|
||||
File xml = new File(file.getAbsolutePath() + "/Cocos2dxPrefsFile.xml");
|
||||
System.out.println(xml.getAbsoluteFile());
|
||||
Log.i(xml.getAbsoluteFile().getAbsolutePath());
|
||||
if (xml.exists()) {
|
||||
ClientUttls.install(context, xml, "../shared_prefs/", new ModInterface() {
|
||||
@Override
|
||||
public void onAction(boolean flag, int type) {
|
||||
System.out.println("处理xml:" + flag);
|
||||
Log.i("处理xml:" + flag);
|
||||
if (flag) {
|
||||
for (File listFile : file.listFiles()) {
|
||||
System.out.println("处理文件:" + listFile.getAbsolutePath());
|
||||
Log.i("处理文件:" + listFile.getAbsolutePath());
|
||||
if (listFile.getName().endsWith(".zip")) {
|
||||
File path;
|
||||
if (siwtch.isChecked()) {
|
||||
path = new File(Utils.getSDCardPath(context) + "/Android/data/com.huanmeng.zhanjian2/"+httpData);
|
||||
System.out.println("操作对象:覆盖版");
|
||||
Log.i("操作对象:覆盖版");
|
||||
} else {
|
||||
path = new File(Utils.getSDCardPath(context) + "/Android/data/com.bigzhao.jianrmagicbox/"+httpData);
|
||||
System.out.println("操作对象:共存版");
|
||||
Log.i("操作对象:共存版");
|
||||
}
|
||||
if (!path.exists()) {
|
||||
path.mkdirs();
|
||||
}
|
||||
System.out.println("准备处理zip");
|
||||
Log.i("准备处理zip");
|
||||
ZipUtils.unzip(listFile, path.getAbsolutePath(), hud);
|
||||
break;
|
||||
}
|
||||
|
61
harmony/src/main/java/com/jianrmod/plugins/harmony/Log.java
Normal file
61
harmony/src/main/java/com/jianrmod/plugins/harmony/Log.java
Normal file
@ -0,0 +1,61 @@
|
||||
package com.jianrmod.plugins.harmony;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
||||
/**
|
||||
* Created by 58381 on 2018/1/20.
|
||||
*/
|
||||
|
||||
public class Log {
|
||||
private static final boolean LOG=true;
|
||||
/**
|
||||
* 错误输出
|
||||
* @param str 正文
|
||||
*/
|
||||
public static void e(String str) {
|
||||
if(LOG)
|
||||
System.err.println(str);
|
||||
}
|
||||
/**
|
||||
* 普通输出
|
||||
* @param str 正文
|
||||
*/
|
||||
public static void i(String str) {
|
||||
if(LOG)
|
||||
Log.i(str);
|
||||
}
|
||||
/**
|
||||
* 错误输出带标题
|
||||
* @param title 标题
|
||||
* @param str 正文
|
||||
*/
|
||||
public static void e(String title,String str) {
|
||||
if(LOG)
|
||||
System.err.println("["+title+"]"+str);
|
||||
}
|
||||
/**
|
||||
* 普通输出带标题
|
||||
* @param title 标题
|
||||
* @param str 正文
|
||||
*/
|
||||
public static void i(String title,String str) {
|
||||
if(LOG)
|
||||
Log.i("["+title+"]"+str);
|
||||
|
||||
}
|
||||
/**
|
||||
* 异常输出
|
||||
* @param e 异常
|
||||
* @param object 异常所在的类
|
||||
* @return
|
||||
*/
|
||||
public static String e(Exception e,Object object) {
|
||||
StringWriter writer=new StringWriter();
|
||||
PrintWriter printWriter=new PrintWriter(writer);
|
||||
e.printStackTrace(printWriter);
|
||||
if(LOG)
|
||||
System.err.println("["+object.getClass().getName()+"]"+writer.toString());
|
||||
return "["+object.getClass().getName()+"]"+writer.toString();
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.jianrmod.plugins.harmony.Tools;
|
||||
|
||||
import com.jianrmod.plugins.harmony.Log;
|
||||
import com.kaopiz.kprogresshud.KProgressHUD;
|
||||
|
||||
import com.zip4j.core.ZipFile;
|
||||
@ -20,7 +21,7 @@ public class ZipUtils {
|
||||
descDirPath.mkdirs();
|
||||
}
|
||||
|
||||
System.out.println("文件:" + zipFile.exists());
|
||||
Log.i("文件:" + zipFile.exists());
|
||||
try {
|
||||
final ZipFile _zipFile = new ZipFile(zipFile);
|
||||
_zipFile.setFileNameCharset("GBK"); //设置编码格式(支持中文)
|
||||
|
@ -36,7 +36,7 @@ public class PluginHttpTools {
|
||||
}
|
||||
|
||||
public void httpGet(final String url, final PluginHttpInterface networkInterface) {
|
||||
System.out.println("HTTP>>>>"+url);
|
||||
Log.i("HTTP>>>>"+url);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -61,17 +61,17 @@ public class PluginHttpTools {
|
||||
|
||||
}
|
||||
public static void post(final String url, final JSONObject body, final PluginHttpInterface networkInterface) throws Exception{
|
||||
System.out.println(1);
|
||||
Log.i(1);
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println(2);
|
||||
Log.i(2);
|
||||
String tmp, str = "";
|
||||
try {
|
||||
System.out.println(3);
|
||||
Log.i(3);
|
||||
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
|
||||
connection.connect();
|
||||
System.out.println(4);
|
||||
Log.i(4);
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||
while ((tmp = reader.readLine()) != null) {
|
||||
str += tmp;
|
||||
|
@ -34,7 +34,7 @@ public class PlugsAdTools {
|
||||
if(json.getInt("code")==100){
|
||||
JSONObject data=json.getJSONObject("data");
|
||||
final String msg=data.getString("msg");
|
||||
System.out.println("服务器回调:"+msg);
|
||||
Log.i("服务器回调:"+msg);
|
||||
if(data.getInt("code")==100){
|
||||
MainActivity.handler.post(new Runnable() {
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user