11 Commits

Author SHA1 Message Date
c0dc7acca8 version:1.3.4
update:
fix:
add:增加丢失模式,增加开发人员选项管控
2021-05-07 15:53:45 +08:00
FHT
cbf58613d8 version:
update:
fix:
add:增加清除应用数据功能
2021-04-26 18:16:10 +08:00
FHT
2dec55000e version:1.3.0
update:
fix:按键屏蔽异常
add:
2021-04-21 18:20:38 +08:00
FHT
3bdfe21466 version:1.2.9
update:
fix:屏蔽清除桌面缓存,增加首页显示自定义版本号
add:
2021-04-21 11:04:30 +08:00
FHT
79ea4abb18 version:2.0.3.6
update:
fix:修复桌面图标丢失,安装会出现教官壹两个图标
add:
2021-04-14 10:42:08 +08:00
FHT
22d36cba60 version:1.2.9
update:
fix:
add:
2021-04-13 15:20:44 +08:00
FHT
6d4d09a49e version:
update:根据网址获取重定向网址加入白名单
fix:
add:
2021-04-12 09:47:13 +08:00
FHT
4c11814f06 version:1.2.8
update:
fix:
add:
2021-04-08 14:04:36 +08:00
FHT
ee0b49f465 version:
update:2021.04.08
fix:取消亮屏请求
add:
2021-04-08 11:07:53 +08:00
FHT
9d985b6f07 version:
update:2021.04.07
fix:
add:增加xapk安装,增加导航栏按钮管控
2021-04-07 15:13:46 +08:00
FHT
b34694838c version:
update:2021.04.02
fix:新的app内部管控接口
add:
2021-04-02 17:34:50 +08:00
158 changed files with 2683 additions and 1219 deletions

View File

@@ -12,7 +12,7 @@ android {
compileSdkVersion 29
defaultConfig {
applicationId "com.jiaoguanyi.appstore"
minSdkVersion 20
minSdkVersion 24
targetSdkVersion 29
// versionCode 105
@@ -50,14 +50,14 @@ android {
productFlavors {
official {
flavorDimensions "default"
versionCode 1035
versionName "2.0.3.5"
versionCode 1037
versionName "2.0.3.7"
/*********************************极光推送************************************/
manifestPlaceholders = [
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
JPUSH_APPKEY : "20f70bbeb78bad23eddd08d0", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
channel_value : "official",
channel_value: "official",
]
signingConfig signingConfigs.debug
/*********************************极光推送end************************************/
@@ -76,7 +76,7 @@ android {
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
JPUSH_APPKEY : "52d81643665bb2cadacf0e9e", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
channel_value : "beta"
channel_value: "beta"
]
signingConfig signingConfigs.debug
/*********************************极光推送end************************************/
@@ -95,7 +95,7 @@ android {
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
JPUSH_APPKEY : "a98c8a210687b4bb43c39c39", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
channel_value : "zhongyou"
channel_value: "zhongyou"
]
signingConfig signingConfigs.debug
/*********************************极光推送end************************************/
@@ -103,17 +103,17 @@ android {
buildConfigField "String", "WebsocketURL", '"ws://39.98.59.202:2345"'
}
newl {
newly {
flavorDimensions "default"
// versionCode 167
versionCode 1033
versionName "1.2.7"
versionCode 174
// versionCode 1037
versionName "1.3.4"
/*********************************极光推送************************************/
manifestPlaceholders = [
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
JPUSH_APPKEY : "52d81643665bb2cadacf0e9e", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
channel_value : "newl"
channel_value: "newly"
]
signingConfig signingConfigs.debug
/*********************************极光推送end************************************/
@@ -123,7 +123,7 @@ android {
}
sourceSets {
beta.res.srcDirs = ['src/beta/res']
newl.res.srcDirs = ['src/beta/res']
newly.res.srcDirs = ['src/beta/res']
}
//签名
@@ -135,7 +135,7 @@ android {
keyPassword "123456"
v2SigningEnabled false
}
release {// 签名文件
storeFile file("src/main/doc/xueshibaoos.jks")
storePassword "123456"
@@ -182,7 +182,6 @@ android {
if (outputFile != null) {
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${productFlavors[0].name}-${buildType.name}.apk"
output.outputFileName = fileName
}
}
}
@@ -191,7 +190,9 @@ android {
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// implementation fileTree(include: ['*.jar'], dir: 'libs')
compileOnly files('src/main/libs/classes.jar')
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
@@ -226,4 +227,27 @@ dependencies {
annotationProcessor 'com.arialyy.aria:compiler:3.8.15'
implementation 'com.amap.api:location:5.1.0'
//高德地图定位
implementation 'org.zeroturnaround:zt-zip:1.13'
//压缩文件解压
}
preBuild {
doLast {
def imlFile = file(project.name + ".iml")
println 'Change ' + project.name + '.iml order'
try {
def parsedXml = (new XmlParser()).parse(imlFile)
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
parsedXml.component[1].remove(jdkNode)
def sdkString = "Android API " + android.compileSdkVersion.substring("android-".length()) + " Platform"
println 'what' + sdkString
new Node(parsedXml.component[1], 'orderEntry', ['type': 'jdk', 'jdkName': sdkString, 'jdkType': 'Android SDK'])
groovy.xml.XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile))
} catch (FileNotFoundException e) {
// nop, iml not found
println "no iml found"
}
}
//https://www.pianshen.com/article/93481144911/
//使用系统编译后的framework.jar
}

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.jiaoguanyi.appstore"
package="com.mjsheng.myappstore"
android:sharedUserId="android.uid.system">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
@@ -25,7 +25,10 @@
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.SHUTDOWN" />
<uses-permission android:name="android.permission.GET_PACKAGE_SIZE"/>
<uses-permission android:name="android.permission.DELETE_CACHE_FILES"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- 静默安装权限 -->
<uses-permission
android:name="android.permission.INSTALL_PACKAGES"
@@ -82,7 +85,7 @@
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<application
android:name="com.jiaoguanyi.appstore.base.BaseApplication"
android:name="com.mjsheng.myappstore.base.BaseApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
@@ -91,8 +94,8 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.jiaoguanyi.appstore.activity.TopActivity" />
<activity android:name="com.jiaoguanyi.appstore.activity.SplashActivity">
<activity android:name="com.mjsheng.myappstore.activity.TopActivity" />
<activity android:name="com.mjsheng.myappstore.activity.HomeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -101,7 +104,7 @@
</intent-filter>
</activity>
<activity
android:name="com.jiaoguanyi.appstore.activity.MainActivity"
android:name="com.mjsheng.myappstore.activity.MainActivity"
android:excludeFromRecents="true"
android:launchMode="singleTop">
<!-- <intent-filter>-->
@@ -111,16 +114,16 @@
<!-- </intent-filter>-->
</activity>
<activity
android:name="com.jiaoguanyi.appstore.activity.OldActivity"
android:name="com.mjsheng.myappstore.activity.OldActivity"
android:excludeFromRecents="true"
android:launchMode="singleTop" />
<!-- <service android:name=".server.MyDownloadService" />-->
<service android:name="com.jiaoguanyi.appstore.server.GuardService" />
<service android:name="com.mjsheng.myappstore.server.GuardService" />
<service
android:name="com.jiaoguanyi.appstore.server.StepService"
android:name="com.mjsheng.myappstore.server.StepService"
android:exported="true" />
<service
android:name="com.jiaoguanyi.appstore.server.MainService"
android:name="com.mjsheng.myappstore.server.MainService"
android:enabled="true"
android:exported="true">
<intent-filter android:priority="1000">
@@ -139,7 +142,7 @@
<!-- </service>-->
<receiver
android:name="com.jiaoguanyi.appstore.receiver.NewAppReceiver"
android:name="com.mjsheng.myappstore.receiver.NewAppReceiver"
android:enabled="true"
android:exported="true"
android:permission="com.example.broadcast.permission">
@@ -152,11 +155,11 @@
</intent-filter>
</receiver>
<receiver
android:name="com.jiaoguanyi.appstore.utils.InstallResultReceiver"
android:name="com.mjsheng.myappstore.utils.InstallResultReceiver"
android:enabled="true"
android:exported="true" />
<receiver
android:name="com.jiaoguanyi.appstore.receiver.BootReceiver"
android:name="com.mjsheng.myappstore.receiver.BootReceiver"
android:enabled="true"
android:exported="true">
<intent-filter android:priority="1000">
@@ -198,7 +201,7 @@
<!-- </intent-filter> -->
<!-- </receiver> -->
<receiver
android:name="com.jiaoguanyi.appstore.receiver.MyJPushReceiver"
android:name="com.mjsheng.myappstore.receiver.MyJPushReceiver"
android:enabled="true">
<intent-filter>
@@ -339,7 +342,7 @@
<!-- Since JCore2.0.0 Required SDK核心功能 -->
<!-- 这个Service要继承JCommonService -->
<service
android:name="com.jiaoguanyi.appstore.jpush.PushService"
android:name="com.mjsheng.myappstore.jpush.PushService"
android:process=":pushcore">
<intent-filter>
<action android:name="cn.jiguang.user.service.action" />
@@ -347,7 +350,7 @@
</service>
<!-- User defined. For test only 用户自定义的广播接收器 -->
<receiver
android:name="com.jiaoguanyi.appstore.jpush.MyReceiver"
android:name="com.mjsheng.myappstore.jpush.MyReceiver"
android:enabled="true"
android:exported="false">
<intent-filter>
@@ -365,7 +368,7 @@
</intent-filter>
</receiver>
<!-- User defined. For test only 用户自定义接收消息器,3.0.7开始支持,目前新tag/alias接口设置结果会在该广播接收器对应的方法中回调 -->
<receiver android:name="com.jiaoguanyi.appstore.jpush.MyJPushMessageReceiver">
<receiver android:name="com.mjsheng.myappstore.jpush.MyJPushMessageReceiver">
<intent-filter>
<action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" />

View File

@@ -1,5 +1,5 @@
// KeepAliveConnection.aidl
package com.jiaoguanyi.appstore;
package com.mjsheng.myappstore;
// Declare any non-default types here with import statements

View File

@@ -1,161 +0,0 @@
package com.jiaoguanyi.appstore.activity;
import android.app.StatusBarManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.util.Log;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.appcompat.app.AppCompatActivity;
import com.jiaoguanyi.appstore.BuildConfig;
import com.jiaoguanyi.appstore.R;
import com.jiaoguanyi.appstore.utils.Utils;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class SplashActivity extends AppCompatActivity {
private static String TAG = SplashActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
startActivity(new Intent(SplashActivity.this, MainActivity.class));
finish();
}
}, 2000);
if (BuildConfig.DEBUG) {
DebugTest();
}
}
private void DebugTest() {
// Utils.getHardware(this);
hookWebView();
setWebView();
}
private void bootanimotion() {
// File file = new File(Environment.getExternalStorageDirectory() + File.separator + "bootanimation.zip");
// String path0 = "/data/local/qchmedia/bootanimation.zip";
// if (file.exists()) {
// File file1 = new File(path0);
// if (!file1.exists()) {
// file.mkdirs();
// try {
// file.createNewFile();
// } catch (IOException e) {
// e.printStackTrace();
// Log.e("bootanimation", e.getMessage());
// }
// }
// Log.e("bootanimation", "SD卡路径存在");
// try {
// Path path = Paths.get(file.getAbsolutePath());
// Files.copy(path, new FileOutputStream(path0));
// } catch (Exception e) {
// Log.e("bootanimation", e.getMessage());
// }
// }
}
static final String url = "www.baidu.com";
private void setWebView() {
WebView webView = new WebView(this);
webView.loadUrl(url);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient() {
//页面加载开始
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
}
//页面加载完成
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
String realUrl = url;
//这个realUrl即为重定向之后的地址
Log.e(TAG, "onPageFinished: " + realUrl);
}
});
}
public static void hookWebView(){
int sdkInt = Build.VERSION.SDK_INT;
try {
Class<?> factoryClass = Class.forName("android.webkit.WebViewFactory");
Field field = factoryClass.getDeclaredField("sProviderInstance");
field.setAccessible(true);
Object sProviderInstance = field.get(null);
if (sProviderInstance != null) {
Log.i(TAG,"sProviderInstance isn't null");
return;
}
Method getProviderClassMethod;
if (sdkInt > 22) {
getProviderClassMethod = factoryClass.getDeclaredMethod("getProviderClass");
} else if (sdkInt == 22) {
getProviderClassMethod = factoryClass.getDeclaredMethod("getFactoryClass");
} else {
Log.i(TAG,"Don't need to Hook WebView");
return;
}
getProviderClassMethod.setAccessible(true);
Class<?> factoryProviderClass = (Class<?>) getProviderClassMethod.invoke(factoryClass);
Class<?> delegateClass = Class.forName("android.webkit.WebViewDelegate");
Constructor<?> delegateConstructor = delegateClass.getDeclaredConstructor();
delegateConstructor.setAccessible(true);
if(sdkInt < 26){//低于Android O版本
Constructor<?> providerConstructor = factoryProviderClass.getConstructor(delegateClass);
if (providerConstructor != null) {
providerConstructor.setAccessible(true);
sProviderInstance = providerConstructor.newInstance(delegateConstructor.newInstance());
}
} else {
Field chromiumMethodName = factoryClass.getDeclaredField("CHROMIUM_WEBVIEW_FACTORY_METHOD");
chromiumMethodName.setAccessible(true);
String chromiumMethodNameStr = (String)chromiumMethodName.get(null);
if (chromiumMethodNameStr == null) {
chromiumMethodNameStr = "create";
}
Method staticFactory = factoryProviderClass.getMethod(chromiumMethodNameStr, delegateClass);
if (staticFactory!=null){
sProviderInstance = staticFactory.invoke(null, delegateConstructor.newInstance());
}
}
if (sProviderInstance != null){
field.set("sProviderInstance", sProviderInstance);
Log.i(TAG,"Hook success!");
} else {
Log.i(TAG,"Hook failed!");
}
} catch (Throwable e) {
Log.w(TAG,e);
}
}
}

View File

@@ -1,4 +0,0 @@
package com.jiaoguanyi.appstore.base;
public interface BaseView {
}

View File

@@ -1,4 +0,0 @@
package com.jiaoguanyi.appstore.utils;
public class XAPKUtils {
}

View File

@@ -0,0 +1,124 @@
package com.mjsheng.myappstore.activity;
import android.annotation.SuppressLint;
import android.app.StatusBarManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.provider.Settings;
import android.util.Log;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.appcompat.app.AppCompatActivity;
import com.mjsheng.myappstore.BuildConfig;
import com.mjsheng.myappstore.R;
import com.lzy.okgo.model.HttpHeaders;
import com.mjsheng.myappstore.utils.CacheUtils;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
public class HomeActivity extends AppCompatActivity {
private static String TAG = HomeActivity.class.getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
startActivity(new Intent(HomeActivity.this, MainActivity.class));
finish();
}
}, 2000);
if (BuildConfig.DEBUG) {
DebugTest();
}
}
private void DebugTest() {
// Utils.getHardware(this);
// setWebView();
// hideStatusBar();
Log.e(TAG, "DebugTest: " + HttpHeaders.getUserAgent());
boolean qch_force_app = Settings.System.putString(getContentResolver(), "qch_launcher_icon_app", "");
Log.e(TAG, "DebugTest: " + Settings.System.getString(getContentResolver(), "qch_launcher_icon_app"));
// try {
// new CacheUtils().cleanApplicationUserData(HomeActivity.this, "com.android.launcher3");
// } catch (Exception e) {
// e.printStackTrace();
// Log.e(TAG, "DebugTest: " + e.getMessage());
// }
}
@SuppressLint("NewApi")
private void hideStatusBar() {
StatusBarManager mStatusBarManager = (StatusBarManager) getApplicationContext().getSystemService(Context.STATUS_BAR_SERVICE);
mStatusBarManager.disable(StatusBarManager.DISABLE_HOME);//隐藏home键
mStatusBarManager.disable(StatusBarManager.DISABLE_BACK);//隐藏返回键
mStatusBarManager.disable(StatusBarManager.DISABLE_RECENT | StatusBarManager.DISABLE_HOME);
mStatusBarManager.disable(StatusBarManager.DISABLE_BACK | StatusBarManager.DISABLE_RECENT | StatusBarManager.DISABLE_HOME);
mStatusBarManager.disable(StatusBarManager.DISABLE_RECENT);//隐藏recent键
mStatusBarManager.disable(StatusBarManager.DISABLE_NONE);//显示隐藏的虚拟按键
}
private void bootanimotion() {
// File file = new File(Environment.getExternalStorageDirectory() + File.separator + "bootanimation.zip");
// String path0 = "/data/local/qchmedia/bootanimation.zip";
// if (file.exists()) {
// File file1 = new File(path0);
// if (!file1.exists()) {
// file.mkdirs();
// try {
// file.createNewFile();
// } catch (IOException e) {
// e.printStackTrace();
// Log.e("bootanimation", e.getMessage());
// }
// }
// Log.e("bootanimation", "SD卡路径存在");
// try {
// Path path = Paths.get(file.getAbsolutePath());
// Files.copy(path, new FileOutputStream(path0));
// } catch (Exception e) {
// Log.e("bootanimation", e.getMessage());
// }
// }
}
static final String url = "www.baidu.com";
private void setWebView() {
WebView webView = new WebView(this);
webView.loadUrl(url);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient() {
//页面加载开始
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
}
//页面加载完成
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
String realUrl = url;
//这个realUrl即为重定向之后的地址
Log.e(TAG, "onPageFinished: " + realUrl);
}
});
}
}

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.activity;
package com.mjsheng.myappstore.activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
@@ -7,6 +7,7 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
@@ -16,16 +17,17 @@ import android.widget.TextView;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.google.gson.JsonObject;
import com.jiaoguanyi.appstore.BuildConfig;
import com.jiaoguanyi.appstore.R;
import com.jiaoguanyi.appstore.base.BaseActivity;
import com.jiaoguanyi.appstore.utils.ApkUtils;
import com.jiaoguanyi.appstore.utils.ExampleUtil;
import com.jiaoguanyi.appstore.utils.JGYUtils;
import com.jiaoguanyi.appstore.utils.SaveListUtils;
import com.jiaoguanyi.appstore.utils.SysSettingUtils;
import com.jiaoguanyi.appstore.utils.ToastUtil;
import com.jiaoguanyi.appstore.utils.Utils;
import com.mjsheng.myappstore.BuildConfig;
import com.mjsheng.myappstore.R;
import com.mjsheng.myappstore.base.BaseActivity;
import com.mjsheng.myappstore.server.MainService;
import com.mjsheng.myappstore.utils.ApkUtils;
import com.mjsheng.myappstore.utils.ExampleUtil;
import com.mjsheng.myappstore.utils.JGYUtils;
import com.mjsheng.myappstore.utils.SaveListUtils;
import com.mjsheng.myappstore.utils.SysSettingUtils;
import com.mjsheng.myappstore.utils.ToastUtil;
import com.mjsheng.myappstore.utils.Utils;
import java.util.concurrent.TimeUnit;
@@ -71,6 +73,8 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
RelativeLayout layout_number;
@BindView(R.id.layout_name)
RelativeLayout layout_name;
@BindView(R.id.tv_customversion)
TextView tv_customversion;
private static final String TAG = MainActivity.class.getSimpleName();
private MainPresenter mPresenter;
@@ -115,6 +119,8 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
tv_devmac.setText(macaddr);
}
tv_version.setText(BuildConfig.VERSION_NAME);
String customVersion = Utils.getProperty("ro.custom.build.version", "获取失败");//获取自定义版本
tv_customversion.setText(customVersion);
}
private void showSNErrorDialog() {
@@ -170,7 +176,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
iv_locked.setVisibility(View.VISIBLE);
ApkUtils.getAppInfo(this);
//上传APP信息
if (netWorkIsRunning) {
if (netWorkIsRunning|| MainService.netWorkIsRunning) {
//如果正在执行不执行
return;
}
@@ -299,6 +305,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
@Override
public void getBrowserBookmarksFinished() {
mPresenter.getBrowserWhiteList();
mPresenter.getDesktopIcon();
}
@@ -329,6 +336,16 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
@Override
public void setLogoImgFinished() {
mPresenter.setTopApp();
}
@Override
public void setTopAppFinished() {
mPresenter.getDeveloper();
}
@Override
public void getDeveloperFinished() {
netWorkIsRunning = false;
Log.e(TAG, "SettingFinished: " + (System.currentTimeMillis() - timeMillis) + " ms");
}
@@ -367,6 +384,26 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
mPresenter.detachView();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
lazyExit();
return true;
}
return super.onKeyDown(keyCode, event);
}
private long mPreClickTime;
private void lazyExit() {
if (System.currentTimeMillis() - mPreClickTime > 3000) {
ToastUtil.show("再按一次,退出");
mPreClickTime = System.currentTimeMillis();
} else {
finish();
}
}
@OnClick({R.id.back, R.id.chkupd})
public void onClick(View view) {
switch (view.getId()) {
@@ -425,17 +462,6 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
.subscribe(mObserver);
}
private long mPreClickTime;
private void lazyExit() {
if (System.currentTimeMillis() - mPreClickTime > 1000) {
ToastUtil.show("再按一次,退出");
mPreClickTime = System.currentTimeMillis();
} else {
finish();
}
}
//jiguang
public void registerMessageReceiver() {
mMessageReceiver = new MessageReceiver();

View File

@@ -1,10 +1,10 @@
package com.jiaoguanyi.appstore.activity;
package com.mjsheng.myappstore.activity;
import android.view.View;
import com.google.gson.JsonObject;
import com.jiaoguanyi.appstore.base.BasePresenter;
import com.jiaoguanyi.appstore.base.BaseView;
import com.mjsheng.myappstore.base.BasePresenter;
import com.mjsheng.myappstore.base.BaseView;
public class MainContact {
public interface MainView extends BaseView {
@@ -61,6 +61,10 @@ public class MainContact {
//获取系统其他管控设置结束
void setLogoImgFinished ();
//设置开机动画
void setTopAppFinished();
//获取应用霸屏结束
void getDeveloperFinished();
//获取开发者选项结束
/*
* MainService
* */
@@ -108,6 +112,8 @@ public class MainContact {
//获取浏览器上网管控设置
void getBrowserBookmarks(String whitelist);
//获取浏览器书签设置管控
void getBrowserWhiteList();
//设置白名单的url
void getDesktopIcon();
//获取应用图标桌面可见性管控
void getAppAutoStartUpdateAndNet();
@@ -120,6 +126,10 @@ public class MainContact {
//获取系统其他管控设置
void setLogoImg();
//设置开机动画
void setTopApp();
//应用霸屏
void getDeveloper();
//获取开发者选项
/*
* MainService
* */

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.activity;
package com.mjsheng.myappstore.activity;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -18,29 +18,30 @@ import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.jiaoguanyi.appstore.BuildConfig;
import com.jiaoguanyi.appstore.base.BaseApplication;
import com.jiaoguanyi.appstore.bean.Appground;
import com.jiaoguanyi.appstore.bean.BaseResponse;
import com.jiaoguanyi.appstore.bean.Batch;
import com.jiaoguanyi.appstore.bean.BrowserBookmarks;
import com.jiaoguanyi.appstore.bean.BrowserData;
import com.jiaoguanyi.appstore.bean.Desktop;
import com.jiaoguanyi.appstore.bean.ForceDownloadBean;
import com.jiaoguanyi.appstore.bean.LogoImg;
import com.jiaoguanyi.appstore.bean.NetAndLaunchBean;
import com.jiaoguanyi.appstore.bean.NewAppground;
import com.jiaoguanyi.appstore.bean.StudentsInfo;
import com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper;
import com.jiaoguanyi.appstore.manager.NetInterfaceManager;
import com.jiaoguanyi.appstore.network.api.newapi.UpdateDeviceInfoApi;
import com.jiaoguanyi.appstore.server.MainService;
import com.jiaoguanyi.appstore.utils.ApkUtils;
import com.jiaoguanyi.appstore.utils.JGYUtils;
import com.jiaoguanyi.appstore.utils.SPUtils;
import com.jiaoguanyi.appstore.utils.SysSettingUtils;
import com.jiaoguanyi.appstore.utils.TimeUtils;
import com.jiaoguanyi.appstore.utils.Utils;
import com.mjsheng.myappstore.BuildConfig;
import com.mjsheng.myappstore.base.BaseApplication;
import com.mjsheng.myappstore.bean.Appground;
import com.mjsheng.myappstore.bean.BaseResponse;
import com.mjsheng.myappstore.bean.Batch;
import com.mjsheng.myappstore.bean.BrowserBookmarks;
import com.mjsheng.myappstore.bean.BrowserData;
import com.mjsheng.myappstore.bean.ForceDownloadBean;
import com.mjsheng.myappstore.bean.LogoImg;
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
import com.mjsheng.myappstore.bean.NewAppground;
import com.mjsheng.myappstore.bean.StudentsInfo;
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
import com.mjsheng.myappstore.manager.NetInterfaceManager;
import com.mjsheng.myappstore.network.api.newapi.UpdateDeviceInfoApi;
import com.mjsheng.myappstore.server.MainService;
import com.mjsheng.myappstore.utils.ApkUtils;
import com.mjsheng.myappstore.utils.ForegroundAppUtil;
import com.mjsheng.myappstore.utils.JGYUtils;
import com.mjsheng.myappstore.utils.SPUtils;
import com.mjsheng.myappstore.utils.SysSettingUtils;
import com.mjsheng.myappstore.utils.TimeUtils;
import com.mjsheng.myappstore.utils.URLUtils;
import com.mjsheng.myappstore.utils.Utils;
import java.io.IOException;
import java.util.Arrays;
@@ -57,8 +58,8 @@ import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import okhttp3.ResponseBody;
import static com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.ACTION_SET;
import static com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.sequence;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_SET;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
public class MainPresenter implements MainContact.Presenter {
private static final String TAG = MainPresenter.class.getSimpleName();
@@ -80,6 +81,7 @@ public class MainPresenter implements MainContact.Presenter {
this.mView = null;
}
/**
* 通过sn获取用户信息
*/
@@ -126,6 +128,7 @@ public class MainPresenter implements MainContact.Presenter {
mView.setBatchText(batch, View.VISIBLE);
SPUtils.put(mContext, "batch", batch);
}
SPUtils.put(mContext, "admin_id", studentsInfoBaseResponse.data.getAdmin_id());
} else {
Log.e("getStudesInfo", "onNext: " + studentsInfoBaseResponse.toString());
}
@@ -268,8 +271,7 @@ public class MainPresenter implements MainContact.Presenter {
@Override
public void updateDeviceInfo() {
String channel_value = JGYUtils.getInstance().getStringMetaData();
if ("official".equals(channel_value)) {
if (JGYUtils.isOfficialVersion()) {
mView.updateDeviceInfoFinished();
return;
}
@@ -328,8 +330,7 @@ public class MainPresenter implements MainContact.Presenter {
@Override
public void getSnTimeControl() {
String channel_value = JGYUtils.getInstance().getStringMetaData();
if ("official".equals(channel_value)) {
if (JGYUtils.isOfficialVersion()) {
mView.getSnTimeControlFinished();
return;
}
@@ -551,8 +552,7 @@ public class MainPresenter implements MainContact.Presenter {
@Override
public void checkTestUpdate() {
String channel_value = JGYUtils.getInstance().getStringMetaData();
if ("official".equals(channel_value)) {
if (JGYUtils.isOfficialVersion()) {
mView.checkTestUpdateFinished();
return;
}
@@ -617,10 +617,15 @@ public class MainPresenter implements MainContact.Presenter {
int code = jsonObject.get("code").getAsInt();
if (code == 200) {
String data = jsonObject.get("data").getAsJsonObject().get("result").getAsString();
JGYUtils.getInstance().writeAppPackageList(data);
boolean write = Settings.System.putString(mContext.getContentResolver(), "only_jgy_shortcut_list", data);
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
//开机图标
JGYUtils.getInstance().writeAppPackageList(mContext, data);
mView.getAppLimitFinished(data);
} else {
mView.getAppLimitFinished("");
boolean write = Settings.System.putString(mContext.getContentResolver(), "only_jgy_shortcut_list", "");
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
Log.e("getAppLimit", "onNext: " + bodyString);
}
} catch (IOException e) {
@@ -644,8 +649,7 @@ public class MainPresenter implements MainContact.Presenter {
@Override
public void getDeviceBatch(String packageList) {
String channel_value = JGYUtils.getInstance().getStringMetaData();
if ("official".equals(channel_value)) {
if (JGYUtils.isOfficialVersion()) {
mView.getDeviceBatchFinished();
return;
}
@@ -671,6 +675,7 @@ public class MainPresenter implements MainContact.Presenter {
String data = jsonObject.getString("data");
List<Batch> batchList = JSON.parseArray(data, Batch.class);
if (null != batchList && batchList.size() > 1) {
Log.e("getDeviceBatch", "onNext: " + "deleteOtherApp");
if (!BuildConfig.DEBUG) {
JGYUtils.getInstance().deleteOtherApp(packageList);
}
@@ -749,6 +754,15 @@ public class MainPresenter implements MainContact.Presenter {
@Override
public void getBrowserList() {
// if (JGYUtils.isOfficialVersion()) {
oldSetBrowserList();
// } else {
// setBrowserList();
// }
}
private void setBrowserList() {
NetInterfaceManager.getInstance()
.getBrowserListSettingObservable()
.observeOn(Schedulers.io())
@@ -763,26 +777,36 @@ public class MainPresenter implements MainContact.Presenter {
Log.e("getBrowserList", "onNext: ");
if (browserDataBaseResponse.code == 200) {
String white = browserDataBaseResponse.data.getWhite();
mView.getBrowserListFinished(white);
if (!TextUtils.isEmpty(white)) {
String homePage = Settings.System.getString(mContext.getContentResolver(), "homepagURL");
if (!white.contains(homePage) && !TextUtils.isEmpty(homePage)) {
white += "," + homePage;
}
boolean whiteList = Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", white);
Log.e("getBrowserList", "setBrowserList white: " + white + ":" + whiteList);
} else {
Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", " ");
}
String black = browserDataBaseResponse.data.getBlack();
if (!TextUtils.isEmpty(black)) {
if (!TextUtils.isEmpty(white) && !TextUtils.isEmpty(black)) {
Settings.System.putInt(mContext.getContentResolver(), "qch_website_isBlackWebUrl", 0);
Settings.System.putString(mContext.getContentResolver(), "BlackBrowserArray", " ");
//黑白名单同时存在时由以前的逻辑管控
boolean whiteList = Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", white);
Log.e("setBrowserList", "setBrowserList white: " + white + ":" + whiteList);
boolean blackList = Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", black);
Log.e("getBrowserList", "setBrowserList black: " + black + ":" + blackList);
} else {
Log.e("setBrowserList", "setBrowserList black: " + black + ":" + blackList);
mView.getBrowserListFinished(white);
} else if (TextUtils.isEmpty(white)) {
//设置黑名单
Settings.System.putInt(mContext.getContentResolver(), "qch_website_isBlackWebUrl", 1);
Settings.System.putString(mContext.getContentResolver(), "BlackBrowserArray", black);
//白名单为空由新的管控执行
mView.getBrowserListFinished("");
Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", " ");
} else if (TextUtils.isEmpty(black)) {
Settings.System.putInt(mContext.getContentResolver(), "qch_website_isBlackWebUrl", 0);
Settings.System.putString(mContext.getContentResolver(), "BlackBrowserArray", " ");
//黑名单为空由旧的管控执行
mView.getBrowserListFinished(white);
Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", " ");
}
} else {
//所有置空
Settings.System.putInt(mContext.getContentResolver(), "qch_website_isBlackWebUrl", 0);
Settings.System.putString(mContext.getContentResolver(), "BlackBrowserArray", " ");
mView.getBrowserListFinished("");
Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", " ");
}
}
@@ -799,8 +823,64 @@ public class MainPresenter implements MainContact.Presenter {
});
}
private void oldSetBrowserList() {
NetInterfaceManager.getInstance()
.getBrowserListSettingObservable()
.observeOn(Schedulers.io())
.subscribe(new Observer<BaseResponse<BrowserData>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
Log.e("oldSetBrowserList", "onSubscribe: ");
}
@Override
public void onNext(@NonNull BaseResponse<BrowserData> browserDataBaseResponse) {
Settings.System.putInt(mContext.getContentResolver(), "qch_website_isBlackWebUrl", 0);
Log.e("oldSetBrowserList", "onNext: ");
if (browserDataBaseResponse.code == 200) {
//白名单
String white = browserDataBaseResponse.data.getWhite();
if (!TextUtils.isEmpty(white)) {
String homePage = Settings.System.getString(mContext.getContentResolver(), "homepagURL");
if (!TextUtils.isEmpty(homePage) && !white.contains(homePage)) {
white += "," + homePage;
}
boolean whiteList = Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", white);
Log.e("oldSetBrowserList", "setBrowserList white: " + white + ":" + whiteList);
mView.getBrowserListFinished(white);
} else {
Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", " ");
mView.getBrowserListFinished("");
}
//黑名单
String black = browserDataBaseResponse.data.getBlack();
if (!TextUtils.isEmpty(black)) {
boolean blackList = Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", black);
Log.e("oldSetBrowserList", "setBrowserList black: " + black + ":" + blackList);
} else {
Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", " ");
}
} else {
mView.getBrowserListFinished("");
}
}
@Override
public void onError(@NonNull Throwable e) {
Log.e("oldSetBrowserList", "onError: " + e.getMessage());
onComplete();
}
@Override
public void onComplete() {
Log.e("oldSetBrowserList", "onComplete: ");
}
});
}
@Override
public void getBrowserBookmarks(String whitelist) {
Log.e(TAG, "getBrowserBookmarks: " + "whitelist: " + whitelist);
List<String> whiteLists = Arrays.asList(whitelist.split(","));
NetInterfaceManager.getInstance()
.getBrowserBookmarksObservable()
@@ -814,15 +894,16 @@ public class MainPresenter implements MainContact.Presenter {
@Override
public void onNext(@NonNull BaseResponse<BrowserBookmarks> browserBookmarksBaseResponse) {
Log.e("getBrowserBookmarks", "onNext: ");
String whiteString = whitelist;
StringBuilder whiteString = new StringBuilder(whitelist);
if (browserBookmarksBaseResponse.code == 200) {
//主页
String homepagURL = browserBookmarksBaseResponse.data.getHomepage();
boolean home = Settings.System.putString(mContext.getContentResolver(), "homepagURL", homepagURL);
Log.e("getBrowserBookmarks", "onNext: homepagURL: save homepagURL = " + home);
if (whiteLists.size() <= 0 || !whiteLists.contains(homepagURL)) {
whiteString += "," + homepagURL;
boolean white = Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", whiteString);
whiteString.append(",").append(homepagURL);
Log.e("getBrowserBookmarks ", "homepagURL: " + homepagURL);
boolean white = Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", whiteString.toString());
Log.e("getBrowserBookmarks", "onNext: homepagURL: add to whiteList = " + whiteString + "write: " + white);
}
@@ -859,6 +940,7 @@ public class MainPresenter implements MainContact.Presenter {
}
intent1.putExtra("homepage", "Invalid");
mContext.sendBroadcast(intent1);
Settings.System.putString(mContext.getContentResolver(), "homepagURL", "");
Intent intent2 = new Intent("qch_app_brower_website");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
@@ -884,6 +966,23 @@ public class MainPresenter implements MainContact.Presenter {
});
}
@Override
public void getBrowserWhiteList() {
new URLUtils(mContext).setBrowserList();
try {
int qch_website_isBlackWebUrl = Settings.System.getInt(mContext.getContentResolver(), "qch_website_isBlackWebUrl");
String BlackBrowserArray = Settings.System.getString(mContext.getContentResolver(), "BlackBrowserArray");
String DeselectBrowserArray = Settings.System.getString(mContext.getContentResolver(), "DeselectBrowserArray");
String qch_webblack_url = Settings.System.getString(mContext.getContentResolver(), "qch_webblack_url");
Log.e("getBrowserWhiteList", "qch_website_isBlackWebUrl: " + qch_website_isBlackWebUrl);
Log.e("getBrowserWhiteList", "BlackBrowserArray: " + BlackBrowserArray);
Log.e("getBrowserWhiteList", "DeselectBrowserArray: " + DeselectBrowserArray);
Log.e("getBrowserWhiteList", "qch_webblack_url: " + qch_webblack_url);
} catch (Settings.SettingNotFoundException e) {
e.printStackTrace();
}
}
@Override
public void getDesktopIcon() {
NetInterfaceManager.getInstance()
@@ -937,7 +1036,8 @@ public class MainPresenter implements MainContact.Presenter {
public void getAppAutoStartUpdateAndNet() {
NetInterfaceManager.getInstance()
.getAppAutoStartUpdateAndNetObservable()
.observeOn(Schedulers.io())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<NetAndLaunchBean>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
@@ -984,6 +1084,7 @@ public class MainPresenter implements MainContact.Presenter {
Log.e("getAppIDControl", "onNext: ");
try {
String bodyString = responseBody.string();
Log.e("getAppIDControl", "bodyString: " + bodyString);
JsonObject jsonObject = JsonParser.parseString(bodyString).getAsJsonObject();
int code = jsonObject.get("code").getAsInt();
if (code == 200) {
@@ -1020,8 +1121,7 @@ public class MainPresenter implements MainContact.Presenter {
@Override
public void setAppinsideWeb() {
String channel_value = JGYUtils.getInstance().getStringMetaData();
if ("official".equals(channel_value)) {
if (JGYUtils.isOfficialVersion()) {
getAppinsideWeb();
} else {
getNewAppinsideWeb();
@@ -1083,6 +1183,7 @@ public class MainPresenter implements MainContact.Presenter {
@Override
public void onComplete() {
Log.e("getNewAppinsideWeb", "onComplete: ");
mView.setAppinsideWebFinished();
}
});
}
@@ -1135,6 +1236,10 @@ public class MainPresenter implements MainContact.Presenter {
@Override
public void setLogoImg() {
if (JGYUtils.isOfficialVersion()) {
mView.setLogoImgFinished();
return;
}
NetInterfaceManager.getInstance()
.getLogoImgObservable()
.subscribe(new Observer<BaseResponse<LogoImg>>() {
@@ -1176,11 +1281,93 @@ public class MainPresenter implements MainContact.Presenter {
});
}
@Override
public void setTopApp() {
NetInterfaceManager.getInstance().getTopAppControl()
.subscribe(new Observer<BaseResponse>() {
@Override
public void onSubscribe(Disposable d) {
Log.e("setTopApp", "onSubscribe: ");
}
@Override
public void onNext(BaseResponse response) {
Log.e("setTopApp", "onNext: " + response.data);
if (response.code == 200) {
JSONObject jsonObject = (JSONObject) JSON.toJSON(response.data);
String app_package = jsonObject.getString("app_package");
SPUtils.put(mContext, ForegroundAppUtil.TOPAPP_KEY, app_package);
ForegroundAppUtil.openTopApp(mContext);
} else {
SPUtils.put(mContext, ForegroundAppUtil.TOPAPP_KEY, "");
}
}
@Override
public void onError(Throwable e) {
Log.e("setTopApp", "onError: " + e.getMessage());
onComplete();
}
@Override
public void onComplete() {
Log.e("setTopApp", "onComplete: ");
mView.setTopAppFinished();
}
});
}
@Override
public void getDeveloper() {
NetInterfaceManager.getInstance().getDeveloperControl()
.subscribe(new Observer<BaseResponse>() {
@Override
public void onSubscribe(Disposable d) {
Log.e("getDeveloper", "onSubscribe: ");
}
@Override
public void onNext(BaseResponse baseResponse) {
Log.e("getDeveloper", "onNext: ");
if (baseResponse.code == 200) {
JSONObject jsonObject = (JSONObject) JSON.toJSON(baseResponse.data);
int is_developer = jsonObject.getInteger("is_developer");
//后台1是0否 底层0是1否
setDeveloper(is_developer == 0 ? 1 : 0);
} else {
setDeveloper(1);
}
}
@Override
public void onError(Throwable e) {
Log.e("getDeveloper", "onError: " + e.getMessage());
onComplete();
}
@Override
public void onComplete() {
mView.getDeveloperFinished();
Log.e("getDeveloper", "onComplete: ");
}
});
}
private void setDeveloper(int state) {
Settings.System.putInt(mContext.getContentResolver(), "qch_Developeroptions", state);
if (state == 1) {
Intent intent = new Intent();
intent.setAction("qch_developeroptions_close");
intent.setPackage("com.android.settings");
mContext.sendBroadcast(intent);
}
}
@Override
public void getScreenLockState() {
String channel_value = JGYUtils.getInstance().getStringMetaData();
int locked = Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", 1);
if ("official".equals(channel_value) || locked == 1) {
if (JGYUtils.isOfficialVersion() || locked == 1) {
mView.setScreenLockStateFinished(false, "");
return;
}
@@ -1222,8 +1409,7 @@ public class MainPresenter implements MainContact.Presenter {
@Override
public void getDefaultDesktop() {
String channel_value = JGYUtils.getInstance().getStringMetaData();
if ("official".equals(channel_value)) {
if (JGYUtils.isOfficialVersion()) {
mView.getDefaultDesktopFinished();
return;
}

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.activity;
package com.mjsheng.myappstore.activity;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
@@ -36,33 +36,33 @@ import com.blankj.utilcode.util.EncryptUtils;
import com.blankj.utilcode.util.PathUtils;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.jiaoguanyi.appstore.BuildConfig;
import com.jiaoguanyi.appstore.R;
import com.jiaoguanyi.appstore.base.BaseApplication;
import com.jiaoguanyi.appstore.bean.ForceDownloadBean;
import com.jiaoguanyi.appstore.bean.ForceDownloadData;
import com.jiaoguanyi.appstore.bean.LzyResponse;
import com.jiaoguanyi.appstore.bean.NetAndLaunchBean;
import com.jiaoguanyi.appstore.bean.NetAndLaunchData;
import com.jiaoguanyi.appstore.bean.StudentsInfo;
import com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper;
import com.jiaoguanyi.appstore.manager.NetInterfaceManager;
import com.jiaoguanyi.appstore.network.HTTPInterface;
import com.jiaoguanyi.appstore.network.URLAddress;
import com.jiaoguanyi.appstore.network.api.AppLimitApi;
import com.jiaoguanyi.appstore.network.api.DeselectBrowserIDApi;
import com.jiaoguanyi.appstore.network.api.DeselectIDApi;
import com.jiaoguanyi.appstore.network.api.ForceDownloadApi;
import com.jiaoguanyi.appstore.network.api.NetAndLaunchApi;
import com.jiaoguanyi.appstore.network.api.SystemSettingApi;
import com.jiaoguanyi.appstore.utils.ApkUtils;
import com.jiaoguanyi.appstore.utils.ExampleUtil;
import com.jiaoguanyi.appstore.utils.JGYUtils;
import com.jiaoguanyi.appstore.utils.SPUtils;
import com.jiaoguanyi.appstore.utils.SaveListUtils;
import com.jiaoguanyi.appstore.utils.SysSettingUtils;
import com.jiaoguanyi.appstore.utils.ToastUtil;
import com.jiaoguanyi.appstore.utils.Utils;
import com.mjsheng.myappstore.BuildConfig;
import com.mjsheng.myappstore.R;
import com.mjsheng.myappstore.base.BaseApplication;
import com.mjsheng.myappstore.bean.ForceDownloadBean;
import com.mjsheng.myappstore.bean.ForceDownloadData;
import com.mjsheng.myappstore.bean.LzyResponse;
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
import com.mjsheng.myappstore.bean.NetAndLaunchData;
import com.mjsheng.myappstore.bean.StudentsInfo;
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
import com.mjsheng.myappstore.manager.NetInterfaceManager;
import com.mjsheng.myappstore.network.HTTPInterface;
import com.mjsheng.myappstore.network.URLAddress;
import com.mjsheng.myappstore.network.api.AppLimitApi;
import com.mjsheng.myappstore.network.api.DeselectBrowserIDApi;
import com.mjsheng.myappstore.network.api.DeselectIDApi;
import com.mjsheng.myappstore.network.api.ForceDownloadApi;
import com.mjsheng.myappstore.network.api.NetAndLaunchApi;
import com.mjsheng.myappstore.network.api.SystemSettingApi;
import com.mjsheng.myappstore.utils.ApkUtils;
import com.mjsheng.myappstore.utils.ExampleUtil;
import com.mjsheng.myappstore.utils.JGYUtils;
import com.mjsheng.myappstore.utils.SPUtils;
import com.mjsheng.myappstore.utils.SaveListUtils;
import com.mjsheng.myappstore.utils.SysSettingUtils;
import com.mjsheng.myappstore.utils.ToastUtil;
import com.mjsheng.myappstore.utils.Utils;
import org.json.JSONException;
import org.json.JSONObject;
@@ -85,13 +85,12 @@ import okhttp3.ResponseBody;
import rx.Observable;
import rx.functions.Action1;
import static com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.ACTION_SET;
import static com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.TagAliasBean;
import static com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.sequence;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_SET;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.TagAliasBean;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
public class OldActivity extends AppCompatActivity {
private static final String TAG = OldActivity.class.getSimpleName();
private long mPreClickTime;
private Context mContext;
private final String ACTION_HrReceiver_JGY_DIS = "qch_jgy_network_disallow";
private final String ACTION_HrReceiver_JGY = "qch_jgy_network_allow";
@@ -534,7 +533,7 @@ public class OldActivity extends AppCompatActivity {
@Override
public void call(Long aLong) {
// getDeselectBrowerID();//浏览器网址管控
HTTPInterface.setBrowserList(OldActivity.this);//浏览器网址管控
HTTPInterface.setBrowserBlackList(OldActivity.this);//浏览器网址管控
HTTPInterface.setHomepagtag(OldActivity.this);//设置主页和标签
HTTPInterface.setAppinsideWeb(OldActivity.this);//app内部网页管控
HTTPInterface.setHideDesktopIcon(OldActivity.this);//设置桌面图标隐藏
@@ -999,6 +998,7 @@ public class OldActivity extends AppCompatActivity {
// 用来计算返回键的点击间隔时间
private long exitTime = 0;
private long mPreClickTime;
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
@@ -1041,7 +1041,7 @@ public class OldActivity extends AppCompatActivity {
case 200:
JSONObject data = jsonObject.getJSONObject("data");
String result = data.optString("result");
writeAppPackageList(result);
// writeAppPackageList(result);
break;
default:
Log.e("mjhseng", "getAppLimitApi---code is -200");
@@ -1065,39 +1065,6 @@ public class OldActivity extends AppCompatActivity {
});
}
private void writeAppPackageList(String result) {
String appstore = "com.jiaoguanyi.appstore";
String store = "com.jiaoguanyi.store";
String info = "com.info.sn";
// String iflytek = "com.estrongs.android.pop";
String jgy1 = "com.uiuios.jgy1";
String jgy2 = "com.uiuios.jgy2";
if (!TextUtils.isEmpty(result)) {
Log.e("writeAppPackageList", result);
if (!result.contains(appstore)) {
result = result + "," + appstore;
}
if (!result.contains(store)) {
result = result + "," + store;
}
if (!result.contains(jgy1)) {
result = result + "," + jgy1;
}
if (!result.contains(jgy2)) {
result = result + "," + jgy2;
}
if (!result.contains(info)) {
result = result + "," + info;
}
//人脸识别
boolean b = Settings.System.putString(getContentResolver(), "qch_app_forbid", result);
Log.e("mjsheng", "qch_app_forbid is :" + b + Settings.System.getString(getContentResolver(), "qch_app_forbid"));
} else {
Log.e("mjsheng", "writeAppPackageList is null:");
}
}
private void getDeselectID() {
DeselectIDApi deselectIDApi = NetInterfaceManager.getDeselectIDApi();

View File

@@ -1,11 +1,11 @@
package com.jiaoguanyi.appstore.activity;
package com.mjsheng.myappstore.activity;
import android.content.Intent;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import com.jiaoguanyi.appstore.R;
import com.mjsheng.myappstore.R;
public class TopActivity extends AppCompatActivity {

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.base;
package com.mjsheng.myappstore.base;
import android.os.Bundle;

View File

@@ -1,6 +1,7 @@
package com.jiaoguanyi.appstore.base;
package com.mjsheng.myappstore.base;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@@ -14,7 +15,6 @@ import android.os.Looper;
import android.os.PowerManager;
import android.os.Process;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import androidx.multidex.MultiDexApplication;
@@ -23,35 +23,41 @@ import com.alibaba.fastjson.JSON;
import com.amap.api.location.AMapLocationClient;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.download.DownloadEntity;
import com.mjsheng.myappstore.manager.FileManager;
import com.mjsheng.myappstore.receiver.BootReceiver;
import com.mjsheng.myappstore.utils.XAPKUtils;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.cache.CacheEntity;
import com.lzy.okgo.cache.CacheMode;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.cookie.store.PersistentCookieStore;
import com.jiaoguanyi.appstore.BuildConfig;
import com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper;
import com.jiaoguanyi.appstore.manager.AmapManager;
import com.jiaoguanyi.appstore.manager.NetInterfaceManager;
import com.jiaoguanyi.appstore.network.HTTPInterface;
import com.jiaoguanyi.appstore.network.URLAddress;
import com.jiaoguanyi.appstore.network.api.newapi.GetLockStateApi;
import com.jiaoguanyi.appstore.receiver.NewAppReceiver;
import com.jiaoguanyi.appstore.server.GuardService;
import com.jiaoguanyi.appstore.server.MainService;
import com.jiaoguanyi.appstore.server.StepService;
import com.jiaoguanyi.appstore.statistics.AppInformation;
import com.jiaoguanyi.appstore.statistics.StatisticsInfo;
import com.jiaoguanyi.appstore.utils.JGYUtils;
import com.jiaoguanyi.appstore.utils.NetworkUtils;
import com.jiaoguanyi.appstore.utils.SystemUtils;
import com.jiaoguanyi.appstore.utils.ToastUtil;
import com.jiaoguanyi.appstore.utils.Utils;
import com.mjsheng.myappstore.BuildConfig;
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
import com.mjsheng.myappstore.manager.AmapManager;
import com.mjsheng.myappstore.manager.NetInterfaceManager;
import com.mjsheng.myappstore.network.HTTPInterface;
import com.mjsheng.myappstore.network.URLAddress;
import com.mjsheng.myappstore.network.api.newapi.GetLockStateApi;
import com.mjsheng.myappstore.receiver.NewAppReceiver;
import com.mjsheng.myappstore.server.GuardService;
import com.mjsheng.myappstore.server.MainService;
import com.mjsheng.myappstore.server.StepService;
import com.mjsheng.myappstore.statistics.AppInformation;
import com.mjsheng.myappstore.statistics.StatisticsInfo;
import com.mjsheng.myappstore.utils.JGYUtils;
import com.mjsheng.myappstore.utils.NetworkUtils;
import com.mjsheng.myappstore.utils.SystemUtils;
import com.mjsheng.myappstore.utils.ToastUtil;
import com.mjsheng.myappstore.utils.Utils;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -74,11 +80,12 @@ import rx.functions.Action1;
*/
//public class MyApplication extends MultiDexApplication implements Thread.UncaughtExceptionHandler {
public class BaseApplication extends MultiDexApplication{
public class BaseApplication extends MultiDexApplication {
private final String TAG = BaseApplication.class.getSimpleName();
public static Context context;
private static BaseApplication instance;
private Handler mHandler = new Handler();
public static Context getAppContext() {
@@ -106,6 +113,9 @@ public class BaseApplication extends MultiDexApplication{
private void init() {
NetInterfaceManager.init(this);
JGYUtils.init(this);
XAPKUtils.init(this);
FileManager.init(this);
hookWebView();
Configuration config = getResources().getConfiguration();
int smallestScreenWidthDp = config.smallestScreenWidthDp;
Log.e("mjsheng", "smallestScreenWidthDp=" + smallestScreenWidthDp);
@@ -152,6 +162,63 @@ public class BaseApplication extends MultiDexApplication{
AmapManager.init(this);
}
public void hookWebView() {
int sdkInt = Build.VERSION.SDK_INT;
try {
Class<?> factoryClass = Class.forName("android.webkit.WebViewFactory");
Field field = factoryClass.getDeclaredField("sProviderInstance");
field.setAccessible(true);
Object sProviderInstance = field.get(null);
if (sProviderInstance != null) {
Log.i(TAG, "sProviderInstance isn't null");
return;
}
Method getProviderClassMethod;
if (sdkInt > 22) {
getProviderClassMethod = factoryClass.getDeclaredMethod("getProviderClass");
} else if (sdkInt == 22) {
getProviderClassMethod = factoryClass.getDeclaredMethod("getFactoryClass");
} else {
Log.i(TAG, "Don't need to Hook WebView");
return;
}
getProviderClassMethod.setAccessible(true);
Class<?> factoryProviderClass = (Class<?>) getProviderClassMethod.invoke(factoryClass);
Class<?> delegateClass = Class.forName("android.webkit.WebViewDelegate");
Constructor<?> delegateConstructor = delegateClass.getDeclaredConstructor();
delegateConstructor.setAccessible(true);
if (sdkInt < 26) {//低于Android O版本
Constructor<?> providerConstructor = factoryProviderClass.getConstructor(delegateClass);
if (providerConstructor != null) {
providerConstructor.setAccessible(true);
sProviderInstance = providerConstructor.newInstance(delegateConstructor.newInstance());
}
} else {
Field chromiumMethodName = factoryClass.getDeclaredField("CHROMIUM_WEBVIEW_FACTORY_METHOD");
chromiumMethodName.setAccessible(true);
String chromiumMethodNameStr = (String) chromiumMethodName.get(null);
if (chromiumMethodNameStr == null) {
chromiumMethodNameStr = "create";
}
Method staticFactory = factoryProviderClass.getMethod(chromiumMethodNameStr, delegateClass);
if (staticFactory != null) {
sProviderInstance = staticFactory.invoke(null, delegateConstructor.newInstance());
}
}
if (sProviderInstance != null) {
field.set("sProviderInstance", sProviderInstance);
Log.i(TAG, "Hook success!");
} else {
Log.i(TAG, "Hook failed!");
}
} catch (Throwable e) {
Log.w(TAG, e);
}
}
/**
* 忽略电池优化
@@ -201,6 +268,13 @@ public class BaseApplication extends MultiDexApplication{
private ScreenReceiver screenReceiver;
Long time1 = 0L;
Long time2 = 0L;
Long time3 = 0L;
Long time4 = 0L;
public class ScreenReceiver extends BroadcastReceiver {
@Override
@@ -213,61 +287,58 @@ public class BaseApplication extends MultiDexApplication{
aMapLocationClient.stopLocation();
aMapLocationClient.startLocation();
getLockState("2", String.valueOf(time));
}
// else if (action.equals(Intent.ACTION_USER_PRESENT)) {
//// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
//// /*在8.0以上 除了开机广播其他广播基本上没有用
//// *当静默安装升级时app不会被唤醒只有通过显示广播唤醒
//// * */
//// mHandler.postDelayed(new Runnable() {
//// @Override
//// public void run() {
//// Intent intent1 = new Intent(BootReceiver.BOOT_COMPLETED);
//// intent1.setComponent(new ComponentName("com.jiaoguanyi.store", "com.mjsheng.myappstore.receiver.BootReceiver"));
//// // 携带数据
////// intent1.putExtra("test", "我是来测 A 应用的Android 8.0 系统静态广播的测试数据");
//// // 启动发送广播
//// sendBroadcast(intent1);
////
//// time2 = System.currentTimeMillis();
//// if ((time2 - time1) > 60 * 1000) {
//// //可能会多次触发1分钟之内不执行
//// //application中启动服务,startcommand执行会两次
//// startService(new Intent(context, InitJpushServer.class));
//// startService(new Intent(context, StepService.class));
//// startService(new Intent(context, GuardService.class));
//// time1 = time2;
//// }
//// }
//// }, 5000);
////
//// }
//// }
//// else if (action.equals(Intent.ACTION_SCREEN_OFF)) {
//// mHandler.postDelayed(new Runnable() {
//// @Override
//// public void run() {
//// long time = System.currentTimeMillis();
//// getLockState("1", String.valueOf(time));
//// if (time3 - System.currentTimeMillis() >= 10000) {
//// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
//// Intent intent1 = new Intent(BootReceiver.BOOT_COMPLETED);
//// intent1.setComponent(new ComponentName("com.jiaoguanyi.store", "com.mjsheng.myappstore.receiver.BootReceiver"));
//// sendBroadcast(intent1);
//// deleteScreenshots();
//// }
//// }
//// time3 = System.currentTimeMillis();
//// }
//// }, 10000);
//// }
else if (action.equals("android.intent.action.FACTORY_RESET")
} else if (action.equals(Intent.ACTION_USER_PRESENT)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
/*在8.0以上 除了开机广播其他广播基本上没有用
*当静默安装升级时app不会被唤醒只有通过显示广播唤醒
* */
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
Intent intent1 = new Intent(BootReceiver.BOOT_COMPLETED);
intent1.setComponent(new ComponentName("com.jiaoguanyi.store", "com.mjsheng.myappstore.receiver.BootReceiver"));
// 携带数据
// intent1.putExtra("test", "我是来测 A 应用的Android 8.0 系统静态广播的测试数据");
// 启动发送广播
sendBroadcast(intent1);
time2 = System.currentTimeMillis();
if ((time2 - time1) > 60 * 1000) {
//可能会多次触发1分钟之内不执行
//application中启动服务,startcommand执行会两次
startService(new Intent(context, MainService.class));
startService(new Intent(context, StepService.class));
startService(new Intent(context, GuardService.class));
time1 = time2;
}
}
}, 5000);
}
} else if (action.equals(Intent.ACTION_SCREEN_OFF)) {
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
long time = System.currentTimeMillis();
getLockState("1", String.valueOf(time));
if (time3 - System.currentTimeMillis() >= 10000) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Intent intent1 = new Intent(BootReceiver.BOOT_COMPLETED);
intent1.setComponent(new ComponentName("com.jiaoguanyi.store", "com.mjsheng.myappstore.receiver.BootReceiver"));
sendBroadcast(intent1);
deleteScreenshots();
}
}
time3 = System.currentTimeMillis();
}
}, 10000);
} else if (action.equals("android.intent.action.FACTORY_RESET")
|| action.equals("android.intent.action.MASTER_CLEAR")
//MASTER_CLEAR 7.0可以监听
|| action.equals("android.intent.action.MASTER_CLEAR_NOTIFICATION")
|| action.equals("android.intent.action.FORCE_FACTORY_RESET")
) {
Log.e("receiver", "MASTER_CLEAR");
Log.e("ScreenReceiver", "MASTER_CLEAR");
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(0);
}
@@ -364,6 +435,9 @@ public class BaseApplication extends MultiDexApplication{
}
private void getLockState(String status, String time) {
if (JGYUtils.isOfficialVersion()) {
return;
}
GetLockStateApi getLockState = NetInterfaceManager.getLockState();
getLockState.getLockState(Utils.getSerial(), status, time)
.subscribeOn(Schedulers.io())
@@ -689,7 +763,7 @@ public class BaseApplication extends MultiDexApplication{
if (code == 200) {
com.alibaba.fastjson.JSONObject resultJson = JSON.parseObject(data);
String result = resultJson.getString("result");
writeAppPackageList(result);
// writeAppPackageList(result);
// setAPPUsage(allList);
} else {
// setAPPUsage();
@@ -703,31 +777,13 @@ public class BaseApplication extends MultiDexApplication{
});
}
private void writeAppPackageList(String result) {
String appstore = "com.jiaoguanyi.appstore";
String store = "com.jiaoguanyi.store";
if (!TextUtils.isEmpty(result)) {
Log.e("writeAppPackageList", result);
if (!result.contains(appstore)) {
result = result + "," + appstore;
}
if (!result.contains(store)) {
result = result + "," + store;
}
Settings.System.putString(context.getContentResolver(), "qch_app_forbid", result);
Log.e("mjsheng", "qch_app_forbid :" + result);
} else {
Log.e("mjsheng", "writeAppPackageList is null:");
Settings.System.putString(context.getContentResolver(), "qch_app_forbid", appstore + "," + store);
}
}
private void catchException() {
Thread.setDefaultUncaughtExceptionHandler(
new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread t, Throwable e) {
Log.d("捕获异常子线程:", Thread.currentThread().getName() +
Log.e("捕获异常子线程:", Thread.currentThread().getName() +
"在:" + e.getStackTrace()[0].getClassName());
}
}

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.base;
package com.mjsheng.myappstore.base;
import androidx.annotation.NonNull;

View File

@@ -0,0 +1,4 @@
package com.mjsheng.myappstore.base;
public interface BaseView {
}

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import android.content.ContentValues;
import android.content.Context;
@@ -11,9 +11,9 @@ import android.content.pm.ResolveInfo;
import android.database.Cursor;
import android.util.Log;
import com.jiaoguanyi.appstore.database.DBHelper;
import com.jiaoguanyi.appstore.database.DBSqlBuilder;
import com.jiaoguanyi.appstore.utils.Utils;
import com.mjsheng.myappstore.database.DBHelper;
import com.mjsheng.myappstore.database.DBSqlBuilder;
import com.mjsheng.myappstore.utils.Utils;
import java.util.ArrayList;
import java.util.HashMap;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import android.graphics.drawable.Drawable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
/**
* Created by Administrator on 2017/1/10.

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import androidx.annotation.NonNull;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
/**
* 作者 mjsheng

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import com.google.gson.Gson;
import com.google.gson.JsonIOException;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -0,0 +1,36 @@
package com.mjsheng.myappstore.bean;
import java.io.Serializable;
public class Expansions implements Serializable {
private String file;
//包内文件地址
private String install_location;
//安装位置
private String install_path;
//安装地址
public String getFile() {
return file;
}
public void setFile(String file) {
this.file = file;
}
public String getInstall_location() {
return install_location;
}
public void setInstall_location(String install_location) {
this.install_location = install_location;
}
public String getInstall_path() {
return install_path;
}
public void setInstall_path(String install_path) {
this.install_path = install_path;
}
}

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
/**
* 作者 mjsheng

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import com.google.gson.stream.JsonReader;
import com.lzy.okgo.callback.AbsCallback;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import android.graphics.drawable.Drawable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
/**
* 作者 mjsheng

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;
@@ -6,7 +6,8 @@ public class NewAppground implements Serializable {
private static final long serialVersionUID = -2071117846816082338L;
private String packages;
private String address;
private String type;
private int type;
//type=1白 =0黑
public String getPackages() {
return packages;
@@ -24,11 +25,11 @@ public class NewAppground implements Serializable {
this.address = address;
}
public String getType() {
public int getType() {
return type;
}
public void setType(String type) {
public void setType(int type) {
this.type = type;
}
}

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
/**
* Created by Administrator on 2016/10/9.

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
public class SearchBean {
private String category;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -0,0 +1,24 @@
package com.mjsheng.myappstore.bean;
import java.io.Serializable;
public class SplitApks implements Serializable {
private String file;
private String id;
public String getFile() {
return file;
}
public void setFile(String file) {
this.file = file;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
/**
* 作者 mjsheng

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
/**
* 作者 mjsheng

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
/**
* 作者 mjsheng

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
/**
* 作者 mjsheng

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.bean;
package com.mjsheng.myappstore.bean;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.comm;
package com.mjsheng.myappstore.comm;
public class CommonDatas {

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.database;
package com.mjsheng.myappstore.database;
import android.content.ContentValues;
import android.content.Context;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.database;
package com.mjsheng.myappstore.database;
public class DBSqlBuilder {

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.jpush;
package com.mjsheng.myappstore.jpush;
import android.content.Context;
import android.content.pm.ApplicationInfo;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.jpush;
package com.mjsheng.myappstore.jpush;
import android.content.BroadcastReceiver;
import android.content.Context;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.jpush;
package com.mjsheng.myappstore.jpush;
import android.util.Log;

View File

@@ -1,8 +1,8 @@
package com.jiaoguanyi.appstore.jpush;
package com.mjsheng.myappstore.jpush;
import android.content.Context;
import com.jiaoguanyi.appstore.base.BaseApplication;
import com.mjsheng.myappstore.base.BaseApplication;
import cn.jpush.android.api.CustomMessage;
import cn.jpush.android.api.JPushMessage;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.jpush;
package com.mjsheng.myappstore.jpush;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -6,7 +6,7 @@ import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import com.jiaoguanyi.appstore.activity.MainActivity;
import com.mjsheng.myappstore.activity.MainActivity;
import org.json.JSONException;
import org.json.JSONObject;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.jpush;
package com.mjsheng.myappstore.jpush;
import cn.jpush.android.service.JCommonService;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.jpush;
package com.mjsheng.myappstore.jpush;
import android.content.Context;
import android.os.Handler;

View File

@@ -1,8 +1,8 @@
package com.jiaoguanyi.appstore.jpush.invalid;
package com.mjsheng.myappstore.jpush.invalid;
import android.app.Application;
import com.jiaoguanyi.appstore.jpush.Logger;
import com.mjsheng.myappstore.jpush.Logger;
import cn.jpush.android.api.JPushInterface;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.jpush.invalid;
package com.mjsheng.myappstore.jpush.invalid;
//public class MainActivity extends InstrumentedActivity implements OnClickListener{

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.jpush.invalid;
package com.mjsheng.myappstore.jpush.invalid;
//public class PushSetActivity extends InstrumentedActivity implements OnClickListener {
// private static final String TAG = "JIGUANG-Example";

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.jpush.invalid;
package com.mjsheng.myappstore.jpush.invalid;
//public class SettingActivity extends InstrumentedActivity implements OnClickListener {
// TimePicker startTime;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.jpush.invalid;
package com.mjsheng.myappstore.jpush.invalid;
import android.app.Activity;
import android.content.Intent;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.log;
package com.mjsheng.myappstore.log;
import android.content.BroadcastReceiver;
import android.content.Context;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.log;
package com.mjsheng.myappstore.log;
import android.content.Intent;
import android.os.Handler;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.manager;
package com.mjsheng.myappstore.manager;
import android.content.Context;
import android.util.Log;
@@ -7,7 +7,7 @@ import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationListener;
import com.jiaoguanyi.appstore.utils.SPUtils;
import com.mjsheng.myappstore.utils.SPUtils;
public class AmapManager {
private static AmapManager sInstance;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.manager;
package com.mjsheng.myappstore.manager;
import android.content.Context;
import android.util.Log;

View File

@@ -1,50 +1,50 @@
package com.jiaoguanyi.appstore.manager;
package com.mjsheng.myappstore.manager;
import android.content.Context;
import android.os.Environment;
import com.jiaoguanyi.appstore.BuildConfig;
import com.jiaoguanyi.appstore.bean.Appground;
import com.jiaoguanyi.appstore.bean.BaseResponse;
import com.jiaoguanyi.appstore.bean.BrowserBookmarks;
import com.jiaoguanyi.appstore.bean.BrowserData;
import com.jiaoguanyi.appstore.bean.Desktop;
import com.jiaoguanyi.appstore.bean.ForceDownloadBean;
import com.jiaoguanyi.appstore.bean.LogoImg;
import com.jiaoguanyi.appstore.bean.NetAndLaunchBean;
import com.jiaoguanyi.appstore.bean.NewAppground;
import com.jiaoguanyi.appstore.bean.StudentsInfo;
import com.jiaoguanyi.appstore.network.api.AppLimitApi;
import com.jiaoguanyi.appstore.network.api.BrankPicApi;
import com.jiaoguanyi.appstore.network.api.CategoryPicApi;
import com.jiaoguanyi.appstore.network.api.DeselectBrowserIDApi;
import com.jiaoguanyi.appstore.network.api.DeselectIDApi;
import com.jiaoguanyi.appstore.network.api.ForceDownloadApi;
import com.jiaoguanyi.appstore.network.api.NetAndLaunchApi;
import com.jiaoguanyi.appstore.network.api.ProjectPicApi;
import com.jiaoguanyi.appstore.network.api.RankAppApi;
import com.jiaoguanyi.appstore.network.api.SystemSettingApi;
import com.jiaoguanyi.appstore.network.api.UploadAppInfoApi;
import com.jiaoguanyi.appstore.network.api.newapi.AppinsideWebApi;
import com.jiaoguanyi.appstore.network.api.newapi.BrowserBookmarksApi;
import com.jiaoguanyi.appstore.network.api.newapi.BrowserListApi;
import com.jiaoguanyi.appstore.network.api.newapi.CheckTestUpdateApi;
import com.jiaoguanyi.appstore.network.api.newapi.CheckUpdateApi;
import com.jiaoguanyi.appstore.network.api.newapi.DesktopIconApi;
import com.jiaoguanyi.appstore.network.api.newapi.DevicesLockedStateApi;
import com.jiaoguanyi.appstore.network.api.newapi.GetBatchApi;
import com.jiaoguanyi.appstore.network.api.newapi.GetDesktopApi;
import com.jiaoguanyi.appstore.network.api.newapi.GetLockStateApi;
import com.jiaoguanyi.appstore.network.api.newapi.JpushTagsApi;
import com.jiaoguanyi.appstore.network.api.newapi.LogoImgApi;
import com.jiaoguanyi.appstore.network.api.newapi.MACAddressApi;
import com.jiaoguanyi.appstore.network.api.newapi.NewAppinsideWebApi;
import com.jiaoguanyi.appstore.network.api.newapi.ScreenLockStateApi;
import com.jiaoguanyi.appstore.network.api.newapi.SnTimeControl;
import com.jiaoguanyi.appstore.network.api.newapi.StudentsInfosApi;
import com.jiaoguanyi.appstore.network.api.newapi.TopAppControlApi;
import com.jiaoguanyi.appstore.network.api.newapi.UpdateDeviceInfoApi;
import com.jiaoguanyi.appstore.utils.Utils;
import com.mjsheng.myappstore.BuildConfig;
import com.mjsheng.myappstore.bean.Appground;
import com.mjsheng.myappstore.bean.BaseResponse;
import com.mjsheng.myappstore.bean.BrowserBookmarks;
import com.mjsheng.myappstore.bean.BrowserData;
import com.mjsheng.myappstore.bean.ForceDownloadBean;
import com.mjsheng.myappstore.bean.LogoImg;
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
import com.mjsheng.myappstore.bean.NewAppground;
import com.mjsheng.myappstore.bean.StudentsInfo;
import com.mjsheng.myappstore.network.api.AppLimitApi;
import com.mjsheng.myappstore.network.api.BrankPicApi;
import com.mjsheng.myappstore.network.api.CategoryPicApi;
import com.mjsheng.myappstore.network.api.DeselectBrowserIDApi;
import com.mjsheng.myappstore.network.api.DeselectIDApi;
import com.mjsheng.myappstore.network.api.ForceDownloadApi;
import com.mjsheng.myappstore.network.api.NetAndLaunchApi;
import com.mjsheng.myappstore.network.api.ProjectPicApi;
import com.mjsheng.myappstore.network.api.RankAppApi;
import com.mjsheng.myappstore.network.api.SystemSettingApi;
import com.mjsheng.myappstore.network.api.UploadAppInfoApi;
import com.mjsheng.myappstore.network.api.newapi.AppinsideWebApi;
import com.mjsheng.myappstore.network.api.newapi.BrowserBookmarksApi;
import com.mjsheng.myappstore.network.api.newapi.BrowserListApi;
import com.mjsheng.myappstore.network.api.newapi.CheckTestUpdateApi;
import com.mjsheng.myappstore.network.api.newapi.CheckUpdateApi;
import com.mjsheng.myappstore.network.api.newapi.DesktopIconApi;
import com.mjsheng.myappstore.network.api.newapi.DevicesLockedStateApi;
import com.mjsheng.myappstore.network.api.newapi.GetBatchApi;
import com.mjsheng.myappstore.network.api.newapi.GetDesktopApi;
import com.mjsheng.myappstore.network.api.newapi.GetDeveloper;
import com.mjsheng.myappstore.network.api.newapi.GetLockStateApi;
import com.mjsheng.myappstore.network.api.newapi.JpushTagsApi;
import com.mjsheng.myappstore.network.api.newapi.LogoImgApi;
import com.mjsheng.myappstore.network.api.newapi.MACAddressApi;
import com.mjsheng.myappstore.network.api.newapi.NewAppinsideWebApi;
import com.mjsheng.myappstore.network.api.newapi.ScreenLockStateApi;
import com.mjsheng.myappstore.network.api.newapi.SnTimeControl;
import com.mjsheng.myappstore.network.api.newapi.StudentsInfosApi;
import com.mjsheng.myappstore.network.api.newapi.TopAppControlApi;
import com.mjsheng.myappstore.network.api.newapi.UpdateDeviceInfoApi;
import com.mjsheng.myappstore.utils.Utils;
import java.io.File;
import java.util.List;
@@ -72,7 +72,6 @@ public class NetInterfaceManager {
public static final String WEBSOCKET_URL = BuildConfig.WebsocketURL;
public static final String HTTP_KEY = "YTM3YTAxNTJmMmZmNzkyM2E2YzIwZjlhZTc0NzNmMGI=";
private NetInterfaceManager(Context context) {
this.mContext = context;
if (null == mRetrofit) {
@@ -307,6 +306,20 @@ public class NetInterfaceManager {
.observeOn(AndroidSchedulers.mainThread());
}
public Observable<BaseResponse> getTopAppControl() {
return mRetrofit.create(TopAppControlApi.class)
.getSnAppControl(Utils.getSerial())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
public Observable<BaseResponse> getDeveloperControl() {
return mRetrofit.create(GetDeveloper.class)
.getDeveloperState(Utils.getSerial())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
/*
*

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.network;
package com.mjsheng.myappstore.network;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -16,25 +16,28 @@ import android.util.Log;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.mjsheng.myappstore.bean.BrowserData;
import com.mjsheng.myappstore.utils.JGYUtils;
import com.mjsheng.myappstore.utils.URLUtils;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.jiaoguanyi.appstore.base.BaseApplication;
import com.jiaoguanyi.appstore.bean.Appground;
import com.jiaoguanyi.appstore.bean.BaseResponse;
import com.jiaoguanyi.appstore.bean.NetAndLaunchBean;
import com.jiaoguanyi.appstore.bean.NetAndLaunchData;
import com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper;
import com.jiaoguanyi.appstore.manager.NetInterfaceManager;
import com.jiaoguanyi.appstore.network.api.newapi.SnTimeControl;
import com.jiaoguanyi.appstore.network.api.newapi.TopAppControlApi;
import com.jiaoguanyi.appstore.network.api.newapi.UpdateDeviceInfoApi;
import com.jiaoguanyi.appstore.server.MainService;
import com.jiaoguanyi.appstore.utils.ApkUtils;
import com.jiaoguanyi.appstore.utils.ForegroundAppUtil;
import com.jiaoguanyi.appstore.utils.Logger;
import com.jiaoguanyi.appstore.utils.SPUtils;
import com.jiaoguanyi.appstore.utils.TimeUtils;
import com.jiaoguanyi.appstore.utils.Utils;
import com.mjsheng.myappstore.base.BaseApplication;
import com.mjsheng.myappstore.bean.Appground;
import com.mjsheng.myappstore.bean.BaseResponse;
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
import com.mjsheng.myappstore.bean.NetAndLaunchData;
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
import com.mjsheng.myappstore.manager.NetInterfaceManager;
import com.mjsheng.myappstore.network.api.newapi.SnTimeControl;
import com.mjsheng.myappstore.network.api.newapi.TopAppControlApi;
import com.mjsheng.myappstore.network.api.newapi.UpdateDeviceInfoApi;
import com.mjsheng.myappstore.server.MainService;
import com.mjsheng.myappstore.utils.ApkUtils;
import com.mjsheng.myappstore.utils.ForegroundAppUtil;
import com.mjsheng.myappstore.utils.Logger;
import com.mjsheng.myappstore.utils.SPUtils;
import com.mjsheng.myappstore.utils.TimeUtils;
import com.mjsheng.myappstore.utils.Utils;
import java.io.IOException;
import java.util.Arrays;
@@ -44,14 +47,15 @@ import java.util.Set;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import okhttp3.Call;
import okhttp3.Response;
import okhttp3.ResponseBody;
import static com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.ACTION_SET;
import static com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.sequence;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_SET;
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
public class HTTPInterface {
// //获取我的设备接口
@@ -486,48 +490,126 @@ public class HTTPInterface {
}
//设置浏览器黑白名单
synchronized public static void setBrowserList(final Context context) {
OkGo.post(URLAddress.SET_BROWSER_LIST)
.params("key", NetInterfaceManager.HTTP_KEY)
.params("sn", Utils.getSerial())
.execute(new StringCallback() {
synchronized public static void setBrowserBlackList(final Context context) {
// if (JGYUtils.isOfficialVersion()) {
oldSetBrowserList(context);
// } else {
// setBrowserList(context);
// }
}
private static void setBrowserList(Context context) {
NetInterfaceManager.getInstance()
.getBrowserListSettingObservable()
.observeOn(Schedulers.io())
.subscribe(new Observer<BaseResponse<BrowserData>>() {
@Override
public void onSuccess(String s, Call call, Response response) {
try {
JSONObject jsonObject = JSON.parseObject(s);
int code = jsonObject.getInteger("code");
String msg = jsonObject.getString("msg");
if (code == 200) {
JSONObject data = JSON.parseObject(jsonObject.getString("data"));
String white = data.getString("white");
String homePage = Settings.System.getString(context.getContentResolver(), "homepagURL");
if (!TextUtils.isEmpty(white)) {
if (!white.contains(homePage) && !TextUtils.isEmpty(homePage)) {
white += "," + homePage;
}
boolean whiteList = Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", white);
Log.e("SystemSetting", "setBrowserList----white-----" + whiteList + ":" + white);
} else {
Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", " ");
}
String black = data.getString("black");
if (!TextUtils.isEmpty(black)) {
boolean blackList = Settings.System.putString(context.getContentResolver(), "qch_webblack_url", black);
Log.e("SystemSetting", "setBrowserList----black-----" + blackList + ":" + black);
} else {
Settings.System.putString(context.getContentResolver(), "qch_webblack_url", " ");
}
} else {
Log.e("fht", "setBrowserList" + msg);
public void onSubscribe(@NonNull Disposable d) {
Log.e("getBrowserList", "onSubscribe: ");
}
@Override
public void onNext(@NonNull BaseResponse<BrowserData> browserDataBaseResponse) {
Log.e("getBrowserList", "onNext: ");
if (browserDataBaseResponse.code == 200) {
String white = browserDataBaseResponse.data.getWhite();
String black = browserDataBaseResponse.data.getBlack();
if (!TextUtils.isEmpty(white) && !TextUtils.isEmpty(black)) {
Settings.System.putInt(context.getContentResolver(), "qch_website_isBlackWebUrl", 0);
Settings.System.putString(context.getContentResolver(), "BlackBrowserArray", " ");
//黑白名单同时存在时由以前的逻辑管控
boolean whiteList = Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", white);
Log.e("setBrowserList", "setBrowserList white: " + white + ":" + whiteList);
boolean blackList = Settings.System.putString(context.getContentResolver(), "qch_webblack_url", black);
Log.e("setBrowserList", "setBrowserList black: " + black + ":" + blackList);
} else if (TextUtils.isEmpty(white)) {
//设置黑名单
Settings.System.putInt(context.getContentResolver(), "qch_website_isBlackWebUrl", 1);
Settings.System.putString(context.getContentResolver(), "BlackBrowserArray", black);
//白名单为空由新的管控执行
Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", " ");
Settings.System.putString(context.getContentResolver(), "qch_webblack_url", " ");
} else if (TextUtils.isEmpty(black)) {
Settings.System.putInt(context.getContentResolver(), "qch_website_isBlackWebUrl", 0);
Settings.System.putString(context.getContentResolver(), "BlackBrowserArray", " ");
//黑名单为空由旧的管控执行
Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", white);
Settings.System.putString(context.getContentResolver(), "qch_webblack_url", " ");
}
} catch (JSONException e) {
Log.e("fht", "setBrowserList" + e.getMessage());
} else {
//所有置空
Settings.System.putInt(context.getContentResolver(), "qch_website_isBlackWebUrl", 0);
Settings.System.putString(context.getContentResolver(), "BlackBrowserArray", " ");
Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", " ");
Settings.System.putString(context.getContentResolver(), "qch_webblack_url", " ");
}
}
@Override
public void onError(Call call, Response response, Exception e) {
super.onError(call, response, e);
public void onError(@NonNull Throwable e) {
Log.e("getBrowserList", "onError: " + e.getMessage());
onComplete();
}
@Override
public void onComplete() {
Log.e("getBrowserList", "onComplete: ");
new URLUtils(context).setBrowserList();
}
});
}
private static void oldSetBrowserList(Context context) {
NetInterfaceManager.getInstance()
.getBrowserListSettingObservable()
.observeOn(Schedulers.io())
.subscribe(new Observer<BaseResponse<BrowserData>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
Log.e("oldSetBrowserList", "onSubscribe: ");
}
@Override
public void onNext(@NonNull BaseResponse<BrowserData> browserDataBaseResponse) {
Settings.System.putInt(context.getContentResolver(), "qch_website_isBlackWebUrl", 0);
Log.e("oldSetBrowserList", "onNext: ");
if (browserDataBaseResponse.code == 200) {
//白名单
String white = browserDataBaseResponse.data.getWhite();
if (!TextUtils.isEmpty(white)) {
String homePage = Settings.System.getString(context.getContentResolver(), "homepagURL");
if (!TextUtils.isEmpty(homePage) && !white.contains(homePage)) {
white += "," + homePage;
}
boolean whiteList = Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", white);
Log.e("oldSetBrowserList", "setBrowserList white: " + white + ":" + whiteList);
} else {
Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", " ");
}
//黑名单
String black = browserDataBaseResponse.data.getBlack();
if (!TextUtils.isEmpty(black)) {
boolean blackList = Settings.System.putString(context.getContentResolver(), "qch_webblack_url", black);
Log.e("oldSetBrowserList", "setBrowserList black: " + black + ":" + blackList);
} else {
Settings.System.putString(context.getContentResolver(), "qch_webblack_url", " ");
}
} else {
Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", " ");
Settings.System.putString(context.getContentResolver(), "qch_webblack_url", " ");
}
}
@Override
public void onError(@NonNull Throwable e) {
Log.e("oldSetBrowserList", "onError: " + e.getMessage());
onComplete();
}
@Override
public void onComplete() {
new URLUtils(context).setBrowserList();
Log.e("oldSetBrowserList", "onComplete: ");
}
});
}

View File

@@ -1,6 +1,6 @@
package com.jiaoguanyi.appstore.network;
package com.mjsheng.myappstore.network;
import com.jiaoguanyi.appstore.manager.NetInterfaceManager;
import com.mjsheng.myappstore.manager.NetInterfaceManager;
/**
* @author Administrator
@@ -53,5 +53,7 @@ public class URLAddress {
public final static String GET_SN_APP_TEST = HTTP_TAG_HEAD_NEW + "Sn/getSnAppTest";
//获取测试app
public final static String GET_LOGO_IMG = HTTP_TAG_HEAD_NEW + "Sn/getLogoImg";
//开机动画
public final static String GET_DEVELOPER = HTTP_TAG_HEAD_NEW + "Sn/getDeveloper";
}

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.network.api;
package com.mjsheng.myappstore.network.api;
import io.reactivex.Observable;
import okhttp3.ResponseBody;

View File

@@ -1,6 +1,6 @@
package com.jiaoguanyi.appstore.network.api;
package com.mjsheng.myappstore.network.api;
import com.jiaoguanyi.appstore.bean.CommonPicBean;
import com.mjsheng.myappstore.bean.CommonPicBean;
import io.reactivex.Observable;
import retrofit2.http.Field;

View File

@@ -1,6 +1,6 @@
package com.jiaoguanyi.appstore.network.api;
package com.mjsheng.myappstore.network.api;
import com.jiaoguanyi.appstore.bean.CategoryPicBean;
import com.mjsheng.myappstore.bean.CategoryPicBean;
import io.reactivex.Observable;
import retrofit2.http.Field;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.network.api;
package com.mjsheng.myappstore.network.api;
import io.reactivex.Observable;
import okhttp3.ResponseBody;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.network.api;
package com.mjsheng.myappstore.network.api;
import io.reactivex.Observable;
import okhttp3.ResponseBody;

View File

@@ -1,6 +1,6 @@
package com.jiaoguanyi.appstore.network.api;
package com.mjsheng.myappstore.network.api;
import com.jiaoguanyi.appstore.bean.ForceDownloadBean;
import com.mjsheng.myappstore.bean.ForceDownloadBean;
import io.reactivex.Observable;
import retrofit2.http.Field;

View File

@@ -1,6 +1,6 @@
package com.jiaoguanyi.appstore.network.api;
package com.mjsheng.myappstore.network.api;
import com.jiaoguanyi.appstore.bean.NetAndLaunchBean;
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
import io.reactivex.Observable;
import retrofit2.http.Field;

View File

@@ -1,6 +1,6 @@
package com.jiaoguanyi.appstore.network.api;
package com.mjsheng.myappstore.network.api;
import com.jiaoguanyi.appstore.bean.CommonPicBean;
import com.mjsheng.myappstore.bean.CommonPicBean;
import io.reactivex.Observable;
import retrofit2.http.Field;

View File

@@ -1,6 +1,6 @@
package com.jiaoguanyi.appstore.network.api;
package com.mjsheng.myappstore.network.api;
import com.jiaoguanyi.appstore.bean.AppInfoBean;
import com.mjsheng.myappstore.bean.AppInfoBean;
import io.reactivex.Observable;
import retrofit2.http.Field;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.network.api;
package com.mjsheng.myappstore.network.api;
import io.reactivex.Observable;
import okhttp3.ResponseBody;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.network.api;
package com.mjsheng.myappstore.network.api;
import io.reactivex.Observable;
import okhttp3.ResponseBody;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.network.api;
package com.mjsheng.myappstore.network.api;
import io.reactivex.Observable;
import okhttp3.ResponseBody;

View File

@@ -1,9 +1,9 @@
package com.jiaoguanyi.appstore.network.api.newapi;
package com.mjsheng.myappstore.network.api.newapi;
import com.jiaoguanyi.appstore.bean.Appground;
import com.jiaoguanyi.appstore.bean.BaseResponse;
import com.jiaoguanyi.appstore.network.URLAddress;
import com.mjsheng.myappstore.bean.Appground;
import com.mjsheng.myappstore.bean.BaseResponse;
import com.mjsheng.myappstore.network.URLAddress;
import java.util.List;

View File

@@ -1,8 +1,8 @@
package com.jiaoguanyi.appstore.network.api.newapi;
package com.mjsheng.myappstore.network.api.newapi;
import com.jiaoguanyi.appstore.bean.BaseResponse;
import com.jiaoguanyi.appstore.bean.BrowserBookmarks;
import com.jiaoguanyi.appstore.network.URLAddress;
import com.mjsheng.myappstore.bean.BaseResponse;
import com.mjsheng.myappstore.bean.BrowserBookmarks;
import com.mjsheng.myappstore.network.URLAddress;
import io.reactivex.Observable;
import retrofit2.http.Field;

View File

@@ -1,8 +1,8 @@
package com.jiaoguanyi.appstore.network.api.newapi;
package com.mjsheng.myappstore.network.api.newapi;
import com.jiaoguanyi.appstore.bean.BaseResponse;
import com.jiaoguanyi.appstore.bean.BrowserData;
import com.jiaoguanyi.appstore.network.URLAddress;
import com.mjsheng.myappstore.bean.BaseResponse;
import com.mjsheng.myappstore.bean.BrowserData;
import com.mjsheng.myappstore.network.URLAddress;
import io.reactivex.Observable;
import retrofit2.http.Field;

View File

@@ -1,7 +1,7 @@
package com.jiaoguanyi.appstore.network.api.newapi;
package com.mjsheng.myappstore.network.api.newapi;
import com.jiaoguanyi.appstore.bean.BaseResponse;
import com.jiaoguanyi.appstore.network.URLAddress;
import com.mjsheng.myappstore.bean.BaseResponse;
import com.mjsheng.myappstore.network.URLAddress;
import io.reactivex.Observable;
import retrofit2.http.GET;

View File

@@ -1,7 +1,7 @@
package com.jiaoguanyi.appstore.network.api.newapi;
package com.mjsheng.myappstore.network.api.newapi;
import com.jiaoguanyi.appstore.bean.BaseResponse;
import com.jiaoguanyi.appstore.network.URLAddress;
import com.mjsheng.myappstore.bean.BaseResponse;
import com.mjsheng.myappstore.network.URLAddress;
import io.reactivex.Observable;
import retrofit2.http.Field;

View File

@@ -1,7 +1,7 @@
package com.jiaoguanyi.appstore.network.api.newapi;
package com.mjsheng.myappstore.network.api.newapi;
import com.jiaoguanyi.appstore.bean.BaseResponse;
import com.jiaoguanyi.appstore.network.URLAddress;
import com.mjsheng.myappstore.bean.BaseResponse;
import com.mjsheng.myappstore.network.URLAddress;
import io.reactivex.Observable;
import retrofit2.http.Field;

View File

@@ -1,7 +1,7 @@
package com.jiaoguanyi.appstore.network.api.newapi;
package com.mjsheng.myappstore.network.api.newapi;
import com.jiaoguanyi.appstore.bean.BaseResponse;
import com.jiaoguanyi.appstore.network.URLAddress;
import com.mjsheng.myappstore.bean.BaseResponse;
import com.mjsheng.myappstore.network.URLAddress;
import io.reactivex.Observable;
import retrofit2.http.Field;

View File

@@ -1,4 +1,4 @@
package com.jiaoguanyi.appstore.network.api.newapi;
package com.mjsheng.myappstore.network.api.newapi;
import io.reactivex.Observable;
import okhttp3.ResponseBody;

View File

@@ -1,6 +1,6 @@
package com.jiaoguanyi.appstore.network.api.newapi;
package com.mjsheng.myappstore.network.api.newapi;
import com.jiaoguanyi.appstore.network.URLAddress;
import com.mjsheng.myappstore.network.URLAddress;
import io.reactivex.Observable;
import okhttp3.ResponseBody;

View File

@@ -0,0 +1,15 @@
package com.mjsheng.myappstore.network.api.newapi;
import com.mjsheng.myappstore.bean.BaseResponse;
import com.mjsheng.myappstore.network.URLAddress;
import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Query;
public interface GetDeveloper {
@GET(URLAddress.GET_DEVELOPER)
Observable<BaseResponse> getDeveloperState(
@Query("sn") String sn
);
}

Some files were not shown because too many files have changed in this diff Show More