更新TBS服务sdk
更新广点通sdk
更新友盟sdk
更新glide框架
修复mod页面低栏在全面屏异常显示问题
修复Android10闪退问题
允许在没有权限的情况下使用盒子
将jianRMG文件夹移至私有目录中
This commit is contained in:
Yutousama 2019-11-18 16:01:01 +08:00
parent d20e3b04ae
commit 73274d6b8d
89 changed files with 558 additions and 334 deletions

View File

@ -0,0 +1,116 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</component>

View File

@ -25,7 +25,7 @@
</value> </value>
</option> </option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View File

@ -19,7 +19,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.android.support:recyclerview-v7:25.0.0' implementation 'androidx.recyclerview:recyclerview:1.0.0'
} }
ext { ext {

View File

@ -2,16 +2,17 @@ package cn.lemon.view;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.support.annotation.ColorInt; import androidx.annotation.ColorInt;
import android.support.annotation.ColorRes; import androidx.annotation.ColorRes;
import android.support.v4.widget.SwipeRefreshLayout; import androidx.recyclerview.widget.GridLayoutManager;
import android.support.v7.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView;
import android.support.v7.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.TextView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import cn.lemon.view.adapter.Action; import cn.lemon.view.adapter.Action;

View File

@ -1,7 +1,7 @@
package cn.lemon.view; package cn.lemon.view;
import android.graphics.Rect; import android.graphics.Rect;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.View; import android.view.View;
/** /**
* Created by linlongxin on 2015/12/19. * Created by linlongxin on 2015/12/19.

View File

@ -1,7 +1,7 @@
package cn.lemon.view.adapter; package cn.lemon.view.adapter;
import android.support.annotation.IdRes; import androidx.annotation.IdRes;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View File

@ -2,8 +2,8 @@ package cn.lemon.view.adapter;
import android.content.Context; import android.content.Context;
import android.os.Message; import android.os.Message;
import android.support.annotation.LayoutRes; import androidx.annotation.LayoutRes;
import android.support.v7.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/lemon_refresh_layout" android:id="@+id/lemon_refresh_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<!-- 避免 id 命名冲突 --> <!-- 避免 id 命名冲突 -->
<android.support.v7.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/lemon_recycler_view" android:id="@+id/lemon_recycler_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
</android.support.v4.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@ -1,28 +1,28 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion 28 compileSdkVersion 29
defaultConfig { defaultConfig {
//applicationId "com.yutou.jianrmg_v2" //applicationId "com.yutou.jianrmg_v2"
applicationId "com.yutou.jianr_mg" applicationId "com.yutou.jianr_mg"
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 28 targetSdkVersion 29
versionCode 2 versionCode 2
versionName "2.2" versionName "2.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk { ndk {
abiFilters "armeabi", "armeabi-v7a", "x86", "mips" abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
} }
} }
signingConfigs { signingConfigs {
release { release {
storeFile file('D:\\AndroidKeys\\yutou.jks') storeFile file('/media/yutou/_dde_data/AndroidKeys/yutou.jks')
storePassword '34864394' storePassword '34864394'
keyAlias 'yutou' keyAlias 'yutou'
keyPassword '34864394' keyPassword '34864394'
} }
debug { debug {
storeFile file('D:\\AndroidKeys\\yutou.jks') storeFile file('/media/yutou/_dde_data/AndroidKeys/yutou.jks')
storePassword '34864394' storePassword '34864394'
keyAlias 'yutou' keyAlias 'yutou'
keyPassword '34864394' keyPassword '34864394'
@ -55,16 +55,12 @@ configurations.all {
} }
} }
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
//noinspection GradleCompatible //noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
//implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//okhttp //okhttp
implementation 'com.squareup.okhttp3:okhttp:3.11.0' implementation 'com.squareup.okhttp3:okhttp:3.11.0'
@ -125,16 +121,16 @@ dependencies {
implementation 'com.github.arcadefire:nice-spinner:1.3.4' implementation 'com.github.arcadefire:nice-spinner:1.3.4'
//glide //glide
implementation 'com.github.bumptech.glide:glide:4.9.0' implementation 'com.github.bumptech.glide:glide:4.10.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
// //
implementation 'com.umeng.umsdk:analytics:8.0.0' implementation 'com.umeng.umsdk:analytics:8.1.3'
implementation 'com.umeng.umsdk:common:2.0.0' implementation 'com.umeng.umsdk:common:2.0.0'
// //
implementation 'com.umeng.umsdk:utdid:1.1.5.3' implementation 'com.umeng.umsdk:utdid:1.1.5.3'
implementation 'com.umeng.umsdk:push:5.0.2' implementation 'com.umeng.umsdk:push:6.0.1'
/* api project(path: ':BaseModel') /* api project(path: ':BaseModel')
api project(path: ':GameDataModel') api project(path: ':GameDataModel')
@ -142,11 +138,15 @@ dependencies {
api project(path: ':MgListModel') api project(path: ':MgListModel')
api project(path: ':ResModl') api project(path: ':ResModl')
api project(path: ':UserModel')*/ api project(path: ':UserModel')*/
implementation files('libs/tbs_sdk_thirdapp_v3.6.0.1371_43624_sharewithdownload_withoutGame_obfs_20181106_121046.jar')
// //
implementation 'com.qiniu:qiniu-android-sdk:7.3.15' implementation 'com.qiniu:qiniu-android-sdk:7.3.15'
//zip4j //zip4j
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '1.3.3' implementation 'net.lingala.zip4j:zip4j:1.3.3'
// //
// implementation 'com.github.markzhai:blockcanary-android:1.5.0' // implementation 'com.github.markzhai:blockcanary-android:1.5.0'
implementation files('libs/tbs_sdk_thirdapp_v4.3.0.1148_43697_sharewithdownloadwithfile_withoutGame_obfs_20190805_175505.jar')
} }

Binary file not shown.

View File

@ -2,7 +2,7 @@ package Interfaces;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View File

@ -2,7 +2,7 @@ package com.yutou.jianr_mg.Adapters;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.support.v7.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -16,7 +16,6 @@ import com.yutou.jianr_mg.Data.TMod;
import com.yutou.jianr_mg.Data.TModtype; import com.yutou.jianr_mg.Data.TModtype;
import com.yutou.jianr_mg.Data.ZsShipType; import com.yutou.jianr_mg.Data.ZsShipType;
import com.yutou.jianr_mg.Interfaces.HttpInterface; import com.yutou.jianr_mg.Interfaces.HttpInterface;
import com.yutou.jianr_mg.Interfaces.ModInterface;
import com.yutou.jianr_mg.Network.HttpApi; import com.yutou.jianr_mg.Network.HttpApi;
import com.yutou.jianr_mg.Network.HttpUtils; import com.yutou.jianr_mg.Network.HttpUtils;
import com.yutou.jianr_mg.R; import com.yutou.jianr_mg.R;
@ -141,7 +140,12 @@ public class ModRecyclerAdapter extends RecyclerAdapter<TMod> {
@Override @Override
public void setData(TMod data) { public void setData(TMod data) {
super.setData(data); super.setData(data);
try {
imageLoader.displayImage(AppData.appConfig.getDownloadhome() + data.getIcon(), icon); imageLoader.displayImage(AppData.appConfig.getDownloadhome() + data.getIcon(), icon);
}catch (Exception e){
e.printStackTrace();
}
title.setText(data.getTitle()); title.setText(data.getTitle());
} }

View File

@ -1,8 +1,8 @@
package com.yutou.jianr_mg.Adapters; package com.yutou.jianr_mg.Adapters;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter; import androidx.fragment.app.FragmentPagerAdapter;
import java.util.List; import java.util.List;

View File

@ -110,7 +110,8 @@ public class Application extends android.app.Application {
Log.e("QDSDK", "加载内核是否成功:" + b); Log.e("QDSDK", "加载内核是否成功:" + b);
} }
}); });
} catch (Exception ignored) { } catch (Exception e) {
e.printStackTrace();
} }
} }

View File

@ -4,7 +4,7 @@ import android.Manifest;
import android.content.Context; import android.content.Context;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Build; import android.os.Build;
import android.support.v4.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import com.yutou.jianr_mg.Application; import com.yutou.jianr_mg.Application;
@ -25,7 +25,7 @@ public class SystemData {
public SystemData() { public SystemData() {
if (Utils.getApplicationPackName(Application.application, AppData.magicPackageName) if (Utils.getApplicationPackName(Application.application, AppData.magicPackageName)
|| new File(Utils.getSDCardPath() + "Android/data/com.huanmeng.zhanjian2/files/MagicBox/").exists()) { || new File( "/sdcard/Android/data/com.huanmeng.zhanjian2/files/MagicBox/").exists()) {
isInstallClient = true; isInstallClient = true;
} else { } else {
isInstallClient = false; isInstallClient = false;

View File

@ -1,6 +1,6 @@
package com.yutou.jianr_mg.Data; package com.yutou.jianr_mg.Data;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
public class TMod implements Comparable<TMod>{ public class TMod implements Comparable<TMod>{

View File

@ -2,19 +2,14 @@ package com.yutou.jianr_mg.Fragments;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.view.ViewPager; import androidx.viewpager.widget.ViewPager;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.github.mikephil.charting.charts.PieChart;
import com.github.mikephil.charting.data.PieData;
import com.github.mikephil.charting.data.PieDataSet;
import com.github.mikephil.charting.data.PieEntry;
import com.yutou.jianr_mg.Adapters.ViewPagerAdapter; import com.yutou.jianr_mg.Adapters.ViewPagerAdapter;
import com.yutou.jianr_mg.Fragments.GameDataFragments.DropFragment; import com.yutou.jianr_mg.Fragments.GameDataFragments.DropFragment;
import com.yutou.jianr_mg.Fragments.GameDataFragments.WarFragment; import com.yutou.jianr_mg.Fragments.GameDataFragments.WarFragment;
@ -23,7 +18,6 @@ import com.yutou.jianr_mg.R;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import Interfaces.BaseFragmeneInerface;
import me.majiajie.pagerbottomtabstrip.NavigationController; import me.majiajie.pagerbottomtabstrip.NavigationController;
import me.majiajie.pagerbottomtabstrip.PageNavigationView; import me.majiajie.pagerbottomtabstrip.PageNavigationView;
import me.majiajie.pagerbottomtabstrip.listener.OnTabItemSelectedListener; import me.majiajie.pagerbottomtabstrip.listener.OnTabItemSelectedListener;

View File

@ -2,10 +2,10 @@ package com.yutou.jianr_mg.Fragments.GameDataFragments;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.util.ArrayMap; import android.util.ArrayMap;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -28,12 +28,9 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Timer;
import cn.lemon.view.RefreshRecyclerView; import cn.lemon.view.RefreshRecyclerView;
import cn.lemon.view.adapter.Action;
public class DropFragment extends Fragment { public class DropFragment extends Fragment {
private static DropFragment fragment; private static DropFragment fragment;

View File

@ -1,23 +1,21 @@
package com.yutou.jianr_mg.Fragments.GameDataFragments; package com.yutou.jianr_mg.Fragments.GameDataFragments;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import com.yutou.jianr_mg.Adapters.GameDataAdapters.DropAdapter;
import com.yutou.jianr_mg.Adapters.GameDataAdapters.WarAdapter; import com.yutou.jianr_mg.Adapters.GameDataAdapters.WarAdapter;
import com.yutou.jianr_mg.Data.AppData; import com.yutou.jianr_mg.Data.AppData;
import com.yutou.jianr_mg.Databases.JianRDataDataBase; import com.yutou.jianr_mg.Databases.JianRDataDataBase;
import com.yutou.jianr_mg.R; import com.yutou.jianr_mg.R;
import com.yutou.jianr_mg.Tools.Utils;
import org.angmarch.views.NiceSpinner; import org.angmarch.views.NiceSpinner;
import org.json.JSONObject; import org.json.JSONObject;

View File

@ -1,9 +1,9 @@
package com.yutou.jianr_mg.Fragments.GameDataFragments.WarLogFragments; package com.yutou.jianr_mg.Fragments.GameDataFragments.WarLogFragments;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View File

@ -1,6 +1,6 @@
package com.yutou.jianr_mg.Fragments.GameDataFragments.WarLogFragments; package com.yutou.jianr_mg.Fragments.GameDataFragments.WarLogFragments;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
public class NightFragment extends Fragment { public class NightFragment extends Fragment {
} }

View File

@ -2,10 +2,10 @@ package com.yutou.jianr_mg.Fragments;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v7.widget.LinearLayoutCompat; import androidx.appcompat.widget.LinearLayoutCompat;
import android.support.v7.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;

View File

@ -2,10 +2,10 @@ package com.yutou.jianr_mg.Fragments;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v7.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutCompat; import androidx.appcompat.widget.LinearLayoutCompat;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;

View File

@ -3,8 +3,8 @@ package com.yutou.jianr_mg.Fragments;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.os.Handler; import android.os.Handler;
import android.support.v7.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutCompat; import androidx.appcompat.widget.LinearLayoutCompat;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;

View File

@ -1,8 +1,8 @@
package com.yutou.jianr_mg.Fragments; package com.yutou.jianr_mg.Fragments;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View File

@ -1,8 +1,8 @@
package com.yutou.jianr_mg.Fragments; package com.yutou.jianr_mg.Fragments;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View File

@ -1,8 +1,8 @@
package com.yutou.jianr_mg.Fragments; package com.yutou.jianr_mg.Fragments;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;

View File

@ -1,12 +1,10 @@
package com.yutou.jianr_mg.Fragments; package com.yutou.jianr_mg.Fragments;
import android.app.Activity;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -14,7 +12,6 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoader;
@ -22,9 +19,7 @@ import com.yutou.jianr_mg.Adapters.MyItemGridViewAdapter;
import com.yutou.jianr_mg.Data.AppData; import com.yutou.jianr_mg.Data.AppData;
import com.yutou.jianr_mg.Data.UUserdata; import com.yutou.jianr_mg.Data.UUserdata;
import com.yutou.jianr_mg.Data.User; import com.yutou.jianr_mg.Data.User;
import com.yutou.jianr_mg.Network.HttpApi;
import com.yutou.jianr_mg.R; import com.yutou.jianr_mg.R;
import com.yutou.jianr_mg.Tools.Log;
import com.yutou.jianr_mg.Tools.Utils; import com.yutou.jianr_mg.Tools.Utils;
import com.yutou.jianr_mg.views.UserDataActivity; import com.yutou.jianr_mg.views.UserDataActivity;
@ -32,7 +27,6 @@ import com.yutou.jianr_mg.views.UserDataActivity;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import Interfaces.BaseFragmeneInerface;
import jp.wasabeef.glide.transformations.BlurTransformation; import jp.wasabeef.glide.transformations.BlurTransformation;
import static com.bumptech.glide.request.RequestOptions.bitmapTransform; import static com.bumptech.glide.request.RequestOptions.bitmapTransform;

View File

@ -1,23 +1,18 @@
package com.yutou.jianr_mg.Fragments; package com.yutou.jianr_mg.Fragments;
import android.app.Activity; import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle; import android.os.Bundle;
import android.os.IBinder;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v7.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import com.yutou.jianr_mg.R;
import com.yutou.jianr_mg.services.DownloadService; import com.yutou.jianr_mg.services.DownloadService;
/** /**

View File

@ -3,10 +3,10 @@ package com.yutou.jianr_mg.Fragments;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v7.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -88,6 +88,7 @@ public class UtilsFragments extends Fragment {
JSONObject json=new JSONObject(string); JSONObject json=new JSONObject(string);
datas= JSON.parseArray(json.getJSONArray("data").toString(),MAppTools.class); datas= JSON.parseArray(json.getJSONArray("data").toString(),MAppTools.class);
setLocalData(); setLocalData();
debug();
handler.post(()->setData()); handler.post(()->setData());
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
@ -101,6 +102,10 @@ public class UtilsFragments extends Fragment {
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
} }
}
private void debug(){
} }
private Map<String, DexClassLoader> map; private Map<String, DexClassLoader> map;
private void setLocalData(){ private void setLocalData(){

View File

@ -9,11 +9,11 @@ import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.constraint.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
import android.support.v4.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowManager; import android.view.WindowManager;
@ -29,7 +29,6 @@ import com.qq.e.ads.splash.SplashAD;
import com.qq.e.ads.splash.SplashADListener; import com.qq.e.ads.splash.SplashADListener;
import com.qq.e.comm.util.AdError; import com.qq.e.comm.util.AdError;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
import com.umeng.message.UmengMessageHandler;
import com.yutou.jianr_mg.Data.AppData; import com.yutou.jianr_mg.Data.AppData;
import com.yutou.jianr_mg.Data.MAdConfig; import com.yutou.jianr_mg.Data.MAdConfig;
import com.yutou.jianr_mg.Data.MGamePackname; import com.yutou.jianr_mg.Data.MGamePackname;
@ -338,7 +337,6 @@ public class LoadingActivity extends AppCompatActivity {
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} }
if (AppData.appConfig != null && !AppData.appConfig.getApkVersion().equals(code)) { if (AppData.appConfig != null && !AppData.appConfig.getApkVersion().equals(code)) {
MaterialDialog dialog = new MaterialDialog(this); MaterialDialog dialog = new MaterialDialog(this);
dialog.setTitle("检测到更新"); dialog.setTitle("检测到更新");
@ -443,11 +441,13 @@ public class LoadingActivity extends AppCompatActivity {
dialog.setTitle(">__<"); dialog.setTitle(">__<");
dialog.setMessage("缺少起床的必要权限哦!"); dialog.setMessage("缺少起床的必要权限哦!");
dialog.setNegativeButton("不给", view -> { dialog.setNegativeButton("不给", view -> {
Utils.toast(LoadingActivity.this, "哼,小气"); Utils.toast(LoadingActivity.this, "哼,小气(可能会发生意外闪退问题)");
handler.postDelayed(() -> { /* handler.postDelayed(() -> {
ActivitysManager.AppExit(LoadingActivity.this); ActivitysManager.AppExit(LoadingActivity.this);
dialog.dismiss(); dialog.dismiss();
}, 300); }, 300);*/
dialog.dismiss();
ready(1);
}); });
dialog.setPositiveButton("拿去吧", view -> { dialog.setPositiveButton("拿去吧", view -> {
ActivityCompat.requestPermissions(LoadingActivity.this, AppPermissions.permissions, AppPermissions.REQUEST_CODE); ActivityCompat.requestPermissions(LoadingActivity.this, AppPermissions.permissions, AppPermissions.REQUEST_CODE);
@ -455,6 +455,7 @@ public class LoadingActivity extends AppCompatActivity {
}); });
dialog.show(); dialog.show();
} else { } else {
Utils.isPermissions=true;
ready(1); ready(1);
} }
} }
@ -466,7 +467,7 @@ public class LoadingActivity extends AppCompatActivity {
return; return;
} }
AdTools.upload(AdTools.Open,AdTools.req); AdTools.upload(AdTools.Open,AdTools.req);
new SplashAD(this, adLayout, ad.getAppid(), ad.getPosid(), new SplashADListener() { SplashAD splashAD= new SplashAD(this, ad.getAppid(), ad.getPosid(), new SplashADListener() {
@Override @Override
public void onADDismissed() { public void onADDismissed() {
start(); start();
@ -497,6 +498,7 @@ public class LoadingActivity extends AppCompatActivity {
AdTools.upload(AdTools.Open,AdTools.show); AdTools.upload(AdTools.Open,AdTools.show);
} }
}); });
splashAD.fetchAndShowIn(adLayout);
} }

View File

@ -2,9 +2,9 @@ package com.yutou.jianr_mg;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.view.ViewPager; import androidx.viewpager.widget.ViewPager;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.widget.Toast; import android.widget.Toast;

View File

@ -5,11 +5,11 @@ package com.yutou.jianr_mg.Network;
*/ */
public class HttpApi { public class HttpApi {
// public static final String HOME="http://jianr.jianrmod.cn/"; public static final String HOME="http://jianr.jianrmod.cn/";
//public static final String HOME = "http://192.168.31.240:8088/"; //zzz_gz wifi //public static final String HOME = "http://192.168.31.240:8088/"; //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.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.137.1:8088/"; //笔记本本身WIFI
public static final String HOME = "http://192.168.1.84:8088/"; //公司 //public static final String HOME = "http://192.168.1.84:8088/"; //公司
public static final String HOME_URL=HOME+"android/"; //服务器 public static final String HOME_URL=HOME+"android/"; //服务器
public static final String MOD_ALL = "mod/all.do"; public static final String MOD_ALL = "mod/all.do";

View File

@ -1,6 +1,7 @@
package com.yutou.jianr_mg.Network; package com.yutou.jianr_mg.Network;
import com.yutou.jianr_mg.Application;
import com.yutou.jianr_mg.Data.AppData; import com.yutou.jianr_mg.Data.AppData;
import com.yutou.jianr_mg.Interfaces.DownloadFileInerface; import com.yutou.jianr_mg.Interfaces.DownloadFileInerface;
import com.yutou.jianr_mg.Interfaces.HttpInterface; import com.yutou.jianr_mg.Interfaces.HttpInterface;
@ -155,6 +156,7 @@ public class HttpUtils {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
AppData.handler.post(() -> downloadFileInerface.over(false)); AppData.handler.post(() -> downloadFileInerface.over(false));
Utils.toast(Application.application,"下载文件发生错误!");
} }
} }
}); });

View File

@ -13,6 +13,7 @@ import android.widget.Toast;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.kaopiz.kprogresshud.KProgressHUD; import com.kaopiz.kprogresshud.KProgressHUD;
import com.yutou.jianr_mg.Application;
import com.yutou.jianr_mg.Data.AppData; import com.yutou.jianr_mg.Data.AppData;
import com.yutou.jianr_mg.Data.MGamePackname; import com.yutou.jianr_mg.Data.MGamePackname;
import com.yutou.jianr_mg.Data.TMod; import com.yutou.jianr_mg.Data.TMod;
@ -261,7 +262,13 @@ public class ModUtils {
}else{ }else{
order.put("args",new String[]{srcs.get(i).getAbsolutePath(),"files:" + paths.get(i).replace("/files/","")+srcs.get(i).getName()}); order.put("args",new String[]{srcs.get(i).getAbsolutePath(),"files:" + paths.get(i).replace("/files/","")+srcs.get(i).getName()});
} }
MagicBoxService.init().setOrder(order, data -> { //先备份 MagicBoxService service= MagicBoxService.init();
if(service==null){
Utils.toast(Application.application,"没有安装专用客户端");
modInterface.onAction(false,0);
return;
}
service.setOrder(order, data -> { //先备份
try { try {
if(!isBackup){//如果不需要备份则按照安装逻辑进行 if(!isBackup){//如果不需要备份则按照安装逻辑进行
i++; i++;

View File

@ -1,6 +1,6 @@
package com.yutou.jianr_mg.Tools; package com.yutou.jianr_mg.Tools;
import android.support.v4.content.FileProvider; import androidx.core.content.FileProvider;
public class MyFileProvider extends FileProvider { public class MyFileProvider extends FileProvider {
} }

View File

@ -7,8 +7,9 @@ import android.content.Intent;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.os.Environment; import android.os.Environment;
import android.support.v4.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.util.Base64; import android.util.Base64;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
@ -18,10 +19,10 @@ import android.widget.Toast;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.kaopiz.kprogresshud.KProgressHUD; import com.kaopiz.kprogresshud.KProgressHUD;
import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache; import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache;
import com.nostra13.universalimageloader.cache.memory.impl.WeakMemoryCache;
import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
import com.yutou.jianr_mg.Application; import com.yutou.jianr_mg.Application;
import com.yutou.jianr_mg.Data.AppData; import com.yutou.jianr_mg.Data.AppData;
import com.yutou.jianr_mg.Data.MGamePackname; import com.yutou.jianr_mg.Data.MGamePackname;
@ -56,6 +57,7 @@ import java.util.List;
public class Utils { public class Utils {
private static final String TAG = "Utils"; private static final String TAG = "Utils";
public static boolean isPermissions=false;
public static int getPixelsFromDp(Activity activity, int size) { public static int getPixelsFromDp(Activity activity, int size) {
DisplayMetrics metrics = new DisplayMetrics(); DisplayMetrics metrics = new DisplayMetrics();
@ -82,12 +84,12 @@ public class Utils {
} }
public static String getSDCardPath() { public static String getSDCardPath() {
String path = Environment.getExternalStorageDirectory().getPath() + "/"; String path = Application.application.getFilesDir() + "/";
return path; return path;
} }
public static String getAppPath() { public static String getAppPath() {
String path = Environment.getExternalStorageDirectory().getPath() + "/jianRMG"; String path = Application.application.getFilesDir() + "/jianRMG";
return path; return path;
} }
@ -107,7 +109,6 @@ public class Utils {
if (!cachePath.exists()) { if (!cachePath.exists()) {
cachePath.exists(); cachePath.exists();
} }
//builder.memoryCache(new WeakMemoryCache());
builder.diskCache(new UnlimitedDiskCache(cachePath)); builder.diskCache(new UnlimitedDiskCache(cachePath));
builder.defaultDisplayImageOptions(initDisplayOptions()); builder.defaultDisplayImageOptions(initDisplayOptions());
@ -216,7 +217,7 @@ public class Utils {
} }
} }
public static boolean writerFile(String srcFile, String data) { static boolean writerFile(String srcFile, String data) {
File file = new File(srcFile); File file = new File(srcFile);
File path = new File(file.getAbsolutePath().split(file.getName())[0]); File path = new File(file.getAbsolutePath().split(file.getName())[0]);
if (!path.exists()) { if (!path.exists()) {
@ -234,7 +235,7 @@ public class Utils {
return false; return false;
} }
public static String readFile(String srcFile) { static String readFile(String srcFile) {
File file = new File(srcFile); File file = new File(srcFile);
if (!file.exists()) { if (!file.exists()) {
return null; return null;
@ -394,6 +395,9 @@ public class Utils {
} }
public static String getIMEI() { public static String getIMEI() {
if( Build.VERSION.SDK_INT>=29){
return "android10";
}
String imei = "-1"; String imei = "-1";
TelephonyManager telephonyManager = (TelephonyManager) Application.application.getSystemService(Context.TELEPHONY_SERVICE); TelephonyManager telephonyManager = (TelephonyManager) Application.application.getSystemService(Context.TELEPHONY_SERVICE);
if (telephonyManager != null && ActivityCompat.checkSelfPermission(Application.application, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) { if (telephonyManager != null && ActivityCompat.checkSelfPermission(Application.application, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) {

View File

@ -13,9 +13,9 @@ import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.os.IBinder; import android.os.IBinder;
import android.provider.Settings; import android.provider.Settings;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import android.support.constraint.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.view.Gravity; import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
@ -32,14 +32,10 @@ import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.SeekBar; import android.widget.SeekBar;
import android.widget.Toast;
import com.tencent.smtt.sdk.TbsReaderView;
import com.yutou.jianr_mg.Data.AppData; import com.yutou.jianr_mg.Data.AppData;
import com.yutou.jianr_mg.R; import com.yutou.jianr_mg.R;
import com.yutou.jianr_mg.Tools.ExcelUtils; import com.yutou.jianr_mg.Tools.ExcelUtils;
import com.yutou.jianr_mg.Tools.Log;
import com.yutou.jianr_mg.Tools.RootUtils;
import com.yutou.jianr_mg.Tools.Utils; import com.yutou.jianr_mg.Tools.Utils;
import com.yutou.jianr_mg.views.ExcelActivity; import com.yutou.jianr_mg.views.ExcelActivity;
import com.yutou.jianr_mg.views.WarView; import com.yutou.jianr_mg.views.WarView;
@ -47,16 +43,11 @@ import com.yutou.jianr_mg.views.WarView;
import org.json.JSONObject; import org.json.JSONObject;
import java.io.File; import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import Interfaces.MagicBoxInterface;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
public class WindowsService extends Service { public class WindowsService extends Service {

View File

@ -3,7 +3,7 @@ package com.yutou.jianr_mg.views;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.widget.LinearLayout; import android.widget.LinearLayout;

View File

@ -1,16 +1,14 @@
package com.yutou.jianr_mg.views; package com.yutou.jianr_mg.views;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.ListView; import android.widget.ListView;
import android.widget.Toast; import android.widget.Toast;
import com.yutou.jianr_mg.Application; import com.yutou.jianr_mg.Application;
import com.yutou.jianr_mg.Data.AppData;
import com.yutou.jianr_mg.Network.HttpApi; import com.yutou.jianr_mg.Network.HttpApi;
import com.yutou.jianr_mg.R; import com.yutou.jianr_mg.R;
import com.yutou.jianr_mg.Tools.JianRUtils; import com.yutou.jianr_mg.Tools.JianRUtils;
@ -65,6 +63,10 @@ public class ConfigActivity extends AppCompatActivity {
Utils.toast(Application.application,"已切换至共存版兼容模式"); Utils.toast(Application.application,"已切换至共存版兼容模式");
} }
break; break;
case 6:
intent=new Intent(this,WebActivity.class);
intent.putExtra("url","http://debugtbs.qq.com");
break;
} }
if (intent != null) { if (intent != null) {
startActivity(intent); startActivity(intent);
@ -80,5 +82,6 @@ public class ConfigActivity extends AppCompatActivity {
config.add("关于我们"); config.add("关于我们");
config.add("开源项目协议"); config.add("开源项目协议");
config.add("切换专用客户端版本"); config.add("切换专用客户端版本");
config.add("设置TBS内核");
} }
} }

View File

@ -3,8 +3,8 @@ package com.yutou.jianr_mg.views;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.widget.ListView; import android.widget.ListView;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;

View File

@ -1,14 +1,17 @@
package com.yutou.jianr_mg.views; package com.yutou.jianr_mg.views;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import android.view.View;
import android.support.constraint.ConstraintLayout;
import android.support.v7.app.AppCompatActivity; import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.appcompat.app.AppCompatActivity;
import com.kaopiz.kprogresshud.KProgressHUD; import com.kaopiz.kprogresshud.KProgressHUD;
import com.tencent.smtt.sdk.TbsReaderView;
import com.yutou.jianr_mg.Data.AppData; import com.yutou.jianr_mg.Data.AppData;
import com.yutou.jianr_mg.Interfaces.DownloadFileInerface; import com.yutou.jianr_mg.Interfaces.DownloadFileInerface;
import com.yutou.jianr_mg.Network.HttpUtils; import com.yutou.jianr_mg.Network.HttpUtils;
@ -56,6 +59,18 @@ public class ExcelActivity extends AppCompatActivity {
ConstraintLayout layout = findViewById(R.id.layout); ConstraintLayout layout = findViewById(R.id.layout);
layout.addView(excel.getReader(), ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT); layout.addView(excel.getReader(), ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT);
initData(); initData();
SharedPreferences preferences=getSharedPreferences("config", Context.MODE_PRIVATE);
if(Build.VERSION.SDK_INT>=29&&!preferences.getBoolean("exceldialog",false)){
MaterialDialog dialog=new MaterialDialog(this);
dialog.setTitle("看不到攻略?");
dialog.setMessage("如果本页面内容是空的,请前往 个人中心-设置-设置TBS内核-安装线上内核\n成功后手动重启下盒子应该就行了如果还是没有请再试一次");
dialog.setPositiveButton("已经正常", view -> {
preferences.edit().putBoolean("exceldialog",true).apply();
dialog.dismiss();
});
dialog.setNegativeButton("下次再说", view -> dialog.dismiss());
dialog.show();
}
} }
SharedPreferences sp; SharedPreferences sp;
private void initData() { private void initData() {
@ -149,6 +164,7 @@ public class ExcelActivity extends AppCompatActivity {
System.out.println(file.getAbsolutePath()+" "+file.exists()); System.out.println(file.getAbsolutePath()+" "+file.exists());
excel.start(file); excel.start(file);
setTitle(parame.getString("name")+" by-"+parame.getString("by")); setTitle(parame.getString("name")+" by-"+parame.getString("by"));
System.out.println("------->"+excel.getReader().getHeight());
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
finish(); finish();

View File

@ -2,9 +2,9 @@ package com.yutou.jianr_mg.views;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;

View File

@ -1,39 +1,32 @@
package com.yutou.jianr_mg.views; package com.yutou.jianr_mg.views;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.kaopiz.kprogresshud.KProgressHUD; import com.kaopiz.kprogresshud.KProgressHUD;
import com.leon.lfilepickerlibrary.LFilePicker;
import com.qq.e.comm.util.StringUtil; import com.qq.e.comm.util.StringUtil;
import com.yutou.jianr_mg.Data.AppData; import com.yutou.jianr_mg.Data.AppData;
import com.yutou.jianr_mg.Fragments.GameData;
import com.yutou.jianr_mg.Interfaces.DownloadFileInerface; import com.yutou.jianr_mg.Interfaces.DownloadFileInerface;
import com.yutou.jianr_mg.Interfaces.HttpInterface; import com.yutou.jianr_mg.Interfaces.HttpInterface;
import com.yutou.jianr_mg.Network.HttpApi; import com.yutou.jianr_mg.Network.HttpApi;
import com.yutou.jianr_mg.Network.HttpUtils; import com.yutou.jianr_mg.Network.HttpUtils;
import com.yutou.jianr_mg.Tools.CDNTools; import com.yutou.jianr_mg.Tools.CDNTools;
import com.yutou.jianr_mg.Tools.RootUtils;
import com.yutou.jianr_mg.Tools.SocketTools; import com.yutou.jianr_mg.Tools.SocketTools;
import com.yutou.jianr_mg.Tools.Utils; import com.yutou.jianr_mg.Tools.Utils;
import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.io.File; import java.io.File;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List;
import me.drakeet.materialdialog.MaterialDialog; import me.drakeet.materialdialog.MaterialDialog;

View File

@ -174,12 +174,13 @@ public class HomeHeader {
bannerView=new UnifiedBannerView((Activity) context, APPID, POSID, new UnifiedBannerADListener() { bannerView=new UnifiedBannerView((Activity) context, APPID, POSID, new UnifiedBannerADListener() {
@Override @Override
public void onNoAD(AdError adError) { public void onNoAD(AdError adError) {
Utils.toast(getContext(),adError.getErrorMsg()); // Utils.toast(getContext(),adError.getErrorMsg());
Log.e("Banner错误",adError.getErrorMsg());
} }
@Override @Override
public void onADReceive() { public void onADReceive() {
System.out.println("测试Receive");
} }
@Override @Override
@ -324,11 +325,14 @@ public class HomeHeader {
public View createView(Context context) { public View createView(Context context) {
imageView = new ImageView(context); imageView = new ImageView(context);
imageView.setScaleType(ImageView.ScaleType.FIT_XY); imageView.setScaleType(ImageView.ScaleType.FIT_XY);
LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
imageView.setLayoutParams(params);
return imageView; return imageView;
} }
@Override @Override
public void UpdateUI(Context context, int position, final MBanner data) { public void UpdateUI(Context context, int position, final MBanner data) {
try {
imageLoader.displayImage(data.getUrl(), imageView); imageLoader.displayImage(data.getUrl(), imageView);
imageView.setOnClickListener(view -> { imageView.setOnClickListener(view -> {
Intent intent; Intent intent;
@ -342,6 +346,10 @@ public class HomeHeader {
} }
context.startActivity(intent); context.startActivity(intent);
}); });
}catch (Exception ignored){
}
} }
} }
} }

View File

@ -3,10 +3,9 @@ package com.yutou.jianr_mg.views;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.ListView; import android.widget.ListView;

View File

@ -5,8 +5,8 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.widget.Button; import android.widget.Button;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
@ -143,6 +143,7 @@ public class ModActivity extends AppCompatActivity {
} }
private void initData(final TMod tMod) { private void initData(final TMod tMod) {
try {
Log.i(TAG,"---------->" + AppData.appConfig.getDownloadhome() + tMod.getImage()); Log.i(TAG,"---------->" + AppData.appConfig.getDownloadhome() + tMod.getImage());
Log.i(TAG,"---------->" + AppData.appConfig.getDownloadhome() + tMod.getIcon()); Log.i(TAG,"---------->" + AppData.appConfig.getDownloadhome() + tMod.getIcon());
if(StringUtil.isEmpty(tMod.getImage())){ if(StringUtil.isEmpty(tMod.getImage())){
@ -151,6 +152,10 @@ public class ModActivity extends AppCompatActivity {
imageLoader.displayImage(AppData.appConfig.getDownloadhome() + tMod.getImage(), modImage); imageLoader.displayImage(AppData.appConfig.getDownloadhome() + tMod.getImage(), modImage);
} }
imageLoader.displayImage(AppData.appConfig.getDownloadhome() + tMod.getIcon(), icon); imageLoader.displayImage(AppData.appConfig.getDownloadhome() + tMod.getIcon(), icon);
}catch (Exception e){
e.printStackTrace();
}
title.setText(tMod.getTitle()); title.setText(tMod.getTitle());
by.setText("@" + tMod.getByuser()); by.setText("@" + tMod.getByuser());
by.setOnClickListener(v -> { by.setOnClickListener(v -> {
@ -161,10 +166,15 @@ public class ModActivity extends AppCompatActivity {
//.type(RichType.html) //.type(RichType.html)
.into(richText); .into(richText);
downloadText.setTag(0); downloadText.setTag(0);
try {
if (ModUtils.getModPath(tMod,"",true).listFiles().length > 0) { if (ModUtils.getModPath(tMod,"",true).listFiles().length > 0) {
downloadText.setText("安装"); downloadText.setText("安装");
downloadText.setTag(2); downloadText.setTag(2);
} }
}catch (Exception e){
e.printStackTrace();
}
download.setOnClickListener(view -> downloadButtonClick()); download.setOnClickListener(view -> downloadButtonClick());
collection.setOnClickListener(view -> { collection.setOnClickListener(view -> {
if (Utils.testStringIsNull(AppData.Token)) { if (Utils.testStringIsNull(AppData.Token)) {

View File

@ -3,10 +3,10 @@ package com.yutou.jianr_mg.views;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.view.ViewPager; import androidx.viewpager.widget.ViewPager;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;

View File

@ -2,8 +2,8 @@ package com.yutou.jianr_mg.views;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;

View File

@ -2,8 +2,8 @@ package com.yutou.jianr_mg.views;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;

View File

@ -1,8 +1,8 @@
package com.yutou.jianr_mg.views; package com.yutou.jianr_mg.views;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.widget.TextView; import android.widget.TextView;
public class TestActivity extends AppCompatActivity { public class TestActivity extends AppCompatActivity {

View File

@ -1,12 +1,10 @@
package com.yutou.jianr_mg.views; package com.yutou.jianr_mg.views;
import android.annotation.SuppressLint;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.Switch; import android.widget.Switch;
import android.widget.TextView; import android.widget.TextView;

View File

@ -4,17 +4,16 @@ import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.text.InputType; import android.text.InputType;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.Toast;
import com.leon.lfilepickerlibrary.LFilePicker; import com.leon.lfilepickerlibrary.LFilePicker;
import com.nostra13.universalimageloader.core.ImageLoader; import com.yutou.jianr_mg.Application;
import com.yutou.jianr_mg.Data.AppData; import com.yutou.jianr_mg.Data.AppData;
import com.yutou.jianr_mg.Interfaces.HttpInterface; import com.yutou.jianr_mg.Interfaces.HttpInterface;
import com.yutou.jianr_mg.Network.HttpApi; import com.yutou.jianr_mg.Network.HttpApi;
@ -138,7 +137,7 @@ public class UserDataActivity extends AppCompatActivity {
new LFilePicker() new LFilePicker()
.withActivity(UserDataActivity.this) .withActivity(UserDataActivity.this)
.withRequestCode(100) .withRequestCode(100)
.withStartPath(Environment.getExternalStorageDirectory().getPath()+"/jianRMG")//指定初始显示路径 .withStartPath(Application.application.getFilesDir()+"/jianRMG")//指定初始显示路径
.withIsGreater(false)//过滤文件大小 小于指定大小的文件 .withIsGreater(false)//过滤文件大小 小于指定大小的文件
.withMutilyMode(false) .withMutilyMode(false)
.withFileSize(5*1024*1024)//指定文件大小为500K .withFileSize(5*1024*1024)//指定文件大小为500K

View File

@ -4,8 +4,8 @@ import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.os.Handler; import android.os.Handler;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.view.View; import android.view.View;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
@ -15,10 +15,9 @@ import android.widget.Toast;
import com.leon.lfilepickerlibrary.LFilePicker; import com.leon.lfilepickerlibrary.LFilePicker;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
import com.yutou.jianr_mg.Application;
import com.yutou.jianr_mg.Data.AppData; import com.yutou.jianr_mg.Data.AppData;
import com.yutou.jianr_mg.Data.MGamePackname; import com.yutou.jianr_mg.Data.MGamePackname;
import com.yutou.jianr_mg.Data.TMod;
import com.yutou.jianr_mg.Data.TModfile;
import com.yutou.jianr_mg.Data.TModfilePath; import com.yutou.jianr_mg.Data.TModfilePath;
import com.yutou.jianr_mg.Interfaces.ModInterface; import com.yutou.jianr_mg.Interfaces.ModInterface;
import com.yutou.jianr_mg.R; import com.yutou.jianr_mg.R;
@ -32,8 +31,6 @@ import java.util.List;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import me.drakeet.materialdialog.MaterialDialog;
public class UserDefinedActivity extends AppCompatActivity implements View.OnClickListener { public class UserDefinedActivity extends AppCompatActivity implements View.OnClickListener {
private Button srcFile; private Button srcFile;
private Spinner outPath; private Spinner outPath;
@ -105,7 +102,7 @@ public class UserDefinedActivity extends AppCompatActivity implements View.OnCli
new LFilePicker() new LFilePicker()
.withActivity(this) .withActivity(this)
.withRequestCode(100) .withRequestCode(100)
.withStartPath(Environment.getExternalStorageDirectory().getPath()+"/jianRMG")//指定初始显示路径 .withStartPath(Application.application.getFilesDir()+"/jianRMG")//指定初始显示路径
.withIsGreater(false)//过滤文件大小 小于指定大小的文件 .withIsGreater(false)//过滤文件大小 小于指定大小的文件
.withMutilyMode(true) .withMutilyMode(true)
.withFileSize(5*1024*1024)//指定文件大小为500K .withFileSize(5*1024*1024)//指定文件大小为500K

View File

@ -1,12 +1,11 @@
package com.yutou.jianr_mg.views; package com.yutou.jianr_mg.views;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.view.ViewPager; import androidx.viewpager.widget.ViewPager;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.alibaba.fastjson.JSON;
import com.yutou.jianr_mg.Adapters.ViewPagerAdapter; import com.yutou.jianr_mg.Adapters.ViewPagerAdapter;
import com.yutou.jianr_mg.Data.ShipEquipmnt; import com.yutou.jianr_mg.Data.ShipEquipmnt;
import com.yutou.jianr_mg.Data.TeamData; import com.yutou.jianr_mg.Data.TeamData;
@ -21,9 +20,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map;
import me.majiajie.pagerbottomtabstrip.NavigationController; import me.majiajie.pagerbottomtabstrip.NavigationController;
import me.majiajie.pagerbottomtabstrip.PageNavigationView; import me.majiajie.pagerbottomtabstrip.PageNavigationView;

View File

@ -1,15 +1,16 @@
package com.yutou.jianr_mg.views; package com.yutou.jianr_mg.views;
import android.net.http.SslError;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.alibaba.fastjson.JSONObject;
import com.tencent.smtt.export.external.interfaces.SslErrorHandler;
import com.tencent.smtt.export.external.interfaces.WebResourceRequest;
import com.tencent.smtt.sdk.WebSettings;
import com.tencent.smtt.sdk.WebView;
import com.tencent.smtt.sdk.WebViewClient;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
import com.yutou.jianr_mg.R; import com.yutou.jianr_mg.R;
import com.yutou.jianr_mg.Tools.Log; import com.yutou.jianr_mg.Tools.Log;
@ -28,10 +29,21 @@ public class WebActivity extends AppCompatActivity{
initView(); initView();
initWeb(); initWeb();
String url=getIntent().getStringExtra("url"); String url=getIntent().getStringExtra("url");
if(url==null) if(url==null) {
url="http://www.jianrmod.cn"; if(getIntent().getStringExtra("parameter")==null) {
url = "http://www.jianrmod.cn";
}else{
url= JSONObject.parseObject(getIntent().getStringExtra("parameter")).getString("url");
}
}
Log.i("网页URL",url); Log.i("网页URL",url);
try {
webView.loadUrl(url); webView.loadUrl(url);
}catch (Exception e){
e.printStackTrace();
finish();
}
} }
private void initView(){ private void initView(){
webView=findViewById(R.id.webView); webView=findViewById(R.id.webView);
@ -50,9 +62,9 @@ public class WebActivity extends AppCompatActivity{
} }
@Override @Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, com.tencent.smtt.export.external.interfaces.SslError sslError) {
super.onReceivedSslError(view, handler, error); super.onReceivedSslError(webView, sslErrorHandler, sslError);
handler.proceed(); sslErrorHandler.proceed();
} }
@Override @Override

View File

@ -2,8 +2,8 @@ package com.yutou.jianr_mg.views;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import androidx.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.view.View; import android.view.View;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:id="@+id/layout" android:id="@+id/layout"
android:layout_height="match_parent"> android:layout_height="match_parent">
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -17,7 +17,7 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" /> tools:visibility="visible" />
<android.support.constraint.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="5"> android:layout_weight="5">
@ -96,5 +96,5 @@
android:textColor="@color/lite_blue" android:textColor="@color/lite_blue"
android:visibility="invisible" /> android:visibility="invisible" />
</LinearLayout> </LinearLayout>
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout> </LinearLayout>

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity"> tools:context=".MainActivity">
<android.support.v4.view.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/pager" android:id="@+id/pager"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@ -23,4 +23,4 @@
android:background="#FFF" android:background="#FFF"
android:elevation="8dp" android:elevation="8dp"
app:layout_constraintBottom_toBottomOf="parent" /> app:layout_constraintBottom_toBottomOf="parent" />
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -8,24 +8,29 @@
<ScrollView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ImageView <ImageView
android:id="@+id/ModImage" android:id="@+id/ModImage"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="120dp" android:layout_height="120dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:scaleType="fitXY" android:layout_marginEnd="8dp"
android:scaleType="fitCenter"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_launcher_background" app:srcCompat="@drawable/ic_launcher_background"
tools:ignore="VectorDrawableCompat" /> tools:ignore="VectorDrawableCompat" />
@ -66,23 +71,23 @@
android:id="@+id/tags" android:id="@+id/tags"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="@+id/richText" app:layout_constraintBottom_toTopOf="@+id/richText"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/by" app:layout_constraintStart_toEndOf="@+id/by"
app:layout_constraintTop_toBottomOf="@+id/title"/> app:layout_constraintTop_toBottomOf="@+id/title" />
<TextView <TextView
android:id="@+id/richText" android:id="@+id/richText"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="200dp" android:layout_height="200dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:padding="16dp" android:padding="16dp"
android:text="Info" android:text="Info"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@ -93,9 +98,9 @@
android:id="@+id/textView" android:id="@+id/textView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:text="相关内容" android:text="相关内容"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/richText" /> app:layout_constraintTop_toBottomOf="@+id/richText" />
@ -107,21 +112,21 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0" app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" app:layout_constraintTop_toBottomOf="@+id/textView" />
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</ScrollView>
<include <include
android:id="@+id/include" android:id="@+id/include"
layout="@layout/layout_mod_bottom" layout="@layout/layout_mod_bottom"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="50dp" android:layout_height="50dp"
app:layout_constraintTop_toBottomOf="@+id/quote" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent"
/>
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>

View File

@ -12,7 +12,7 @@
android:elevation="8dp" android:elevation="8dp"
/> />
<android.support.v4.view.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/pager" android:id="@+id/pager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
@ -186,4 +186,4 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttons" /> app:layout_constraintTop_toBottomOf="@+id/buttons" />
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -38,7 +38,7 @@
android:layout_height="20dp" android:layout_height="20dp"
android:src="@drawable/item_fg" /> android:src="@drawable/item_fg" />
<android.support.v4.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fillViewport="true"> android:fillViewport="true">
@ -48,7 +48,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" /> android:orientation="vertical" />
</android.support.v4.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>
@ -75,4 +75,4 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/contextLayout" app:layout_constraintStart_toEndOf="@+id/contextLayout"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -66,4 +66,4 @@
android:text="操作日志:" /> android:text="操作日志:" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -7,4 +7,4 @@
android:id="@+id/list" android:id="@+id/list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<WebView <com.tencent.smtt.sdk.WebView
android:id="@+id/webView" android:id="@+id/webView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
@ -132,4 +132,4 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/start" app:layout_constraintStart_toEndOf="@+id/start"
app:layout_constraintTop_toBottomOf="@+id/help" /> app:layout_constraintTop_toBottomOf="@+id/help" />
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
@ -42,4 +42,4 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout6"/> app:layout_constraintTop_toBottomOf="@+id/linearLayout6"/>
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -16,7 +16,7 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<android.support.v4.view.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/pager" android:id="@+id/pager"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="0dp" android:layout_height="0dp"
@ -26,4 +26,4 @@
app:layout_constraintTop_toBottomOf="@+id/tab" /> app:layout_constraintTop_toBottomOf="@+id/tab" />
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -12,7 +12,7 @@
android:scaleType="centerCrop" android:scaleType="centerCrop"
app:srcCompat="@mipmap/ic_launcher_round" /> app:srcCompat="@mipmap/ic_launcher_round" />
<android.support.constraint.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
@ -54,7 +54,7 @@
app:layout_constraintStart_toEndOf="@+id/icon" app:layout_constraintStart_toEndOf="@+id/icon"
app:layout_constraintTop_toBottomOf="@+id/uname" /> app:layout_constraintTop_toBottomOf="@+id/uname" />
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<ListView <ListView
android:id="@+id/_my_items" android:id="@+id/_my_items"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -8,7 +8,7 @@ buildscript {
maven { url 'https://dl.bintray.com/umsdk/release' } maven { url 'https://dl.bintray.com/umsdk/release' }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.4.1' classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1" classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1"

View File

@ -9,7 +9,10 @@
# Specifies the JVM arguments used for the daemon process. # Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings. # The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m org.gradle.jvmargs=-Xmx1536m
Android.useDeprecatedNdk=true;
# When configured, Gradle will run in incubating parallel mode. # When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit # This option should only be used with decoupled projects. More details, visit

View File

@ -1,6 +1,6 @@
#Sat Apr 27 15:44:25 CST 2019 #Tue Nov 05 15:03:29 CST 2019
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

View File

@ -10,7 +10,7 @@ android {
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
@ -26,14 +26,14 @@ android {
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'androidx.appcompat:appcompat:1.0.0'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
// //
implementation 'com.leon:lfilepickerlibrary:1.8.0' implementation 'com.leon:lfilepickerlibrary:1.8.0'
// //
implementation 'com.kaopiz:kprogresshud:1.1.0' implementation 'com.kaopiz:kprogresshud:1.1.0'
implementation 'com.android.support:support-v4:28.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0' implementation 'androidx.recyclerview:recyclerview:1.0.0'
} }

View File

@ -1,8 +1,8 @@
package com.jianrmod.plugins.harmony; package com.jianrmod.plugins.harmony;
import android.content.Context; import android.content.Context;
import android.support.test.InstrumentationRegistry; import androidx.test.platform.app.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -15,8 +15,11 @@ import android.widget.CompoundButton;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.Switch; import android.widget.Switch;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.jianrmod.plugins.harmony.Tools.ClientUttls; import com.jianrmod.plugins.harmony.Tools.ClientUttls;
import com.jianrmod.plugins.harmony.Tools.HttpInterface;
import com.jianrmod.plugins.harmony.Tools.HttpTools;
import com.jianrmod.plugins.harmony.Tools.Utils; import com.jianrmod.plugins.harmony.Tools.Utils;
import com.jianrmod.plugins.harmony.Tools.ZipUtils; import com.jianrmod.plugins.harmony.Tools.ZipUtils;
import com.kaopiz.kprogresshud.KProgressHUD; import com.kaopiz.kprogresshud.KProgressHUD;
@ -32,6 +35,7 @@ public class MainActivity implements BaseActivityInterface {
private Context context; private Context context;
private KProgressHUD hud; private KProgressHUD hud;
private String httpData;
public MainActivity() { public MainActivity() {
} }
@ -101,7 +105,7 @@ public class MainActivity implements BaseActivityInterface {
Button button3=new Button(context); Button button3=new Button(context);
final Switch siwtch = new Switch(context); final Switch siwtch = new Switch(context);
siwtch.setText("共存版"); siwtch.setText("共存版");
text1.setText("更新说明" + text1.setText("更新说明(v3)" +
"\n1、已支持覆盖版" + "\n1、已支持覆盖版" +
"\n2、已安装压缩包时下次点击不再解压(如需覆盖解压请删除后缀.unzip)" + "\n2、已安装压缩包时下次点击不再解压(如需覆盖解压请删除后缀.unzip)" +
"\n使用说明请将proj.manifest、Cocos2dxPrefsFile.xml和压缩包放到jianRMG/harmony/文件夹中" + "\n使用说明请将proj.manifest、Cocos2dxPrefsFile.xml和压缩包放到jianRMG/harmony/文件夹中" +
@ -154,6 +158,11 @@ public class MainActivity implements BaseActivityInterface {
button2.setOnClickListener(new View.OnClickListener() { button2.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if(httpData==null){
Toast.makeText(context,"网络请求失败1秒钟后再试试",Toast.LENGTH_LONG).show();
return;
}
System.out.println("httpData:"+httpData);
hud.show(); hud.show();
final File file = new File(Utils.getAppPath() + "/harmony/"); final File file = new File(Utils.getAppPath() + "/harmony/");
if(!file.exists()){ if(!file.exists()){
@ -178,10 +187,10 @@ public class MainActivity implements BaseActivityInterface {
if (listFile.getName().endsWith(".zip")) { if (listFile.getName().endsWith(".zip")) {
File path; File path;
if (siwtch.isChecked()) { if (siwtch.isChecked()) {
path = new File(Utils.getSDCardPath() + "/Android/data/com.huanmeng.zhanjian2/files/res_default/10/"); path = new File(Utils.getSDCardPath() + "/Android/data/com.huanmeng.zhanjian2/"+httpData);
System.out.println("操作对象:覆盖版"); System.out.println("操作对象:覆盖版");
} else { } else {
path = new File(Utils.getSDCardPath() + "/Android/data/com.bigzhao.jianrmagicbox/files/res_default/10/"); path = new File(Utils.getSDCardPath() + "/Android/data/com.bigzhao.jianrmagicbox/"+httpData);
System.out.println("操作对象:共存版"); System.out.println("操作对象:共存版");
} }
if (!path.exists()) { if (!path.exists()) {
@ -221,6 +230,17 @@ public class MainActivity implements BaseActivityInterface {
context.startActivity(intent); context.startActivity(intent);
} }
}); });
new HttpTools().httpGet("http://jianr.jianrmod.cn/admin/data.do?data=harmony", new HttpInterface() {
@Override
public void httpGetData(Object data, int state) {
httpData= (String) data;
}
@Override
public void httpError(Exception e) {
e.printStackTrace();
}
});
return linearLayout; return linearLayout;
} }

View File

@ -0,0 +1,19 @@
package com.jianrmod.plugins.harmony.Tools;
/**
* 协议接口
*/
public interface HttpInterface {
/**
* 请求成功
* @param data 请求参数
* @param state http状态
*/
void httpGetData(Object data, int state);
/**
* 请求异常
* @param e 异常
*/
void httpError(Exception e);
}

View File

@ -0,0 +1,31 @@
package com.jianrmod.plugins.harmony.Tools;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class HttpTools {
public void httpGet(final String url, final HttpInterface networkInterface) {
new Thread(new Runnable() {
@Override
public void run() {
try {
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
connection.connect();
String tmp, str = "";
while ((tmp = reader.readLine()) != null) {
str += tmp;
}
reader.close();
networkInterface.httpGetData(str, connection.getResponseCode());
} catch (Exception e) {
e.printStackTrace();
networkInterface.httpError(e);
}
}
}).start();
}
}

View File

@ -65,12 +65,12 @@ public class Utils {
} }
public static String getSDCardPath() { public static String getSDCardPath() {
String path = Environment.getExternalStorageDirectory().getPath() + "/"; String path = Application.application.getFilesDir() + "/";
return path; return path;
} }
public static String getAppPath() { public static String getAppPath() {
String path = Environment.getExternalStorageDirectory().getPath() + "/jianRMG"; String path = Application.application.getFilesDir() + "/jianRMG";
return path; return path;
} }

View File

@ -8,5 +8,5 @@ public class Data {
public static String image="https://i.loli.net/2019/06/10/5cfe1f8f725b430506.png"; public static String image="https://i.loli.net/2019/06/10/5cfe1f8f725b430506.png";
public static String mainFunction="com.jianrmod.plugins.harmony.Activitys.MainActivity#localActivity"; public static String mainFunction="com.jianrmod.plugins.harmony.Activitys.MainActivity#localActivity";
public static Integer permission=0; public static Integer permission=0;
public static String version="2.0"; public static String version="2.1";
} }

View File

@ -10,7 +10,7 @@ android {
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
@ -25,10 +25,10 @@ android {
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'androidx.appcompat:appcompat:1.0.0'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
// //
implementation 'com.kaopiz:kprogresshud:1.1.0' implementation 'com.kaopiz:kprogresshud:1.1.0'
implementation files('libs/GDTUnionSDK.4.28.902.min.jar') implementation files('libs/GDTUnionSDK.4.28.902.min.jar')

View File

@ -1,8 +1,8 @@
package com.yutou.jianr_mg.plugs.test.app1; package com.yutou.jianr_mg.plugs.test.app1;
import android.content.Context; import android.content.Context;
import android.support.test.InstrumentationRegistry; import androidx.test.platform.app.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -3,6 +3,7 @@ package com.yutou.jianr_mg.plugins.Activitys;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.widget.LinearLayout; import android.widget.LinearLayout;
@ -17,6 +18,8 @@ public class MainActivity implements BaseActivityInterface {
public static String image="#"; public static String image="#";
public static String mainFunction="com.yutou.jianr_mg.plugs.test.app1.MainActivity#localActivity"; public static String mainFunction="com.yutou.jianr_mg.plugs.test.app1.MainActivity#localActivity";
public static Integer permission=0; public static Integer permission=0;
public static String homeurl="";
public static Handler handler;
public MainActivity() { public MainActivity() {
} }

View File

@ -4,7 +4,7 @@ import android.Manifest;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.support.v4.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.widget.Toast; import android.widget.Toast;