1.4.0320 修复yxpd1 不删除默认桌面,默认写入sn为激活码,默认启动九学王服务
This commit is contained in:
@@ -29,8 +29,8 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.aoleyun.sn"
|
applicationId "com.aoleyun.sn"
|
||||||
versionCode 114
|
versionCode 116
|
||||||
versionName "1.4.0318"
|
versionName "1.4.0320"
|
||||||
|
|
||||||
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
|
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ public class MainAContact {
|
|||||||
void checkTestUpdate();
|
void checkTestUpdate();
|
||||||
/*获取桌面*/
|
/*获取桌面*/
|
||||||
void getDefaultDesktop();
|
void getDefaultDesktop();
|
||||||
|
/*获取系统默认程序设置*/
|
||||||
|
void getDefaultApp();
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface MainView extends BaseView {
|
public interface MainView extends BaseView {
|
||||||
@@ -53,5 +55,7 @@ public class MainAContact {
|
|||||||
void checkTestUpdateFinish();
|
void checkTestUpdateFinish();
|
||||||
/*获取桌面结束*/
|
/*获取桌面结束*/
|
||||||
void getDefaultDesktopFinish();
|
void getDefaultDesktopFinish();
|
||||||
|
/*获取系统默认程序设置*/
|
||||||
|
void setDefaultAppFinish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -220,6 +220,17 @@ public class MainAPresenter implements MainAContact.Presenter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getDefaultApp() {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getDefaultApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
mView.setDefaultAppFinish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void checkUpdateInfo() {
|
private void checkUpdateInfo() {
|
||||||
NetInterfaceManager.getInstance()
|
NetInterfaceManager.getInstance()
|
||||||
.getUpdateApi()
|
.getUpdateApi()
|
||||||
|
|||||||
@@ -175,11 +175,13 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
|||||||
public void initView() {
|
public void initView() {
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
if (BuildConfig.DEBUG) {
|
|
||||||
String defaultDesktop = mMMKV.decodeString(CommonConfig.DEFAULT_DESKTOP_PACKAGE_NAME, "");
|
String defaultDesktop = mMMKV.decodeString(CommonConfig.DEFAULT_DESKTOP_PACKAGE_NAME, "");
|
||||||
Log.e(TAG, "initView: defaultDesktop = " + defaultDesktop);
|
Log.e(TAG, "initView: defaultDesktop = " + defaultDesktop);
|
||||||
String defaultLauncher = mMMKV.decodeString(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
|
String defaultLauncher = mMMKV.decodeString(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
|
||||||
Log.e(TAG, "initView: defaultLauncher = " + defaultLauncher);
|
Log.e(TAG, "initView: defaultLauncher = " + defaultLauncher);
|
||||||
|
|
||||||
|
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform) {
|
||||||
|
Settings.System.putString(getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, Utils.getSerial(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
mMainAPresenter = new MainAPresenter(this);
|
mMainAPresenter = new MainAPresenter(this);
|
||||||
@@ -519,12 +521,19 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkTestUpdateFinish() {
|
public void checkTestUpdateFinish() {
|
||||||
|
Log.e(TAG, "checkTestUpdateFinish: ");
|
||||||
mMainAPresenter.getDefaultDesktop();
|
mMainAPresenter.getDefaultDesktop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getDefaultDesktopFinish() {
|
public void getDefaultDesktopFinish() {
|
||||||
Log.e(TAG, "getDefaultDesktopFinish: ");
|
Log.e(TAG, "getDefaultDesktopFinish: ");
|
||||||
|
mMainAPresenter.getDefaultApp();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDefaultAppFinish() {
|
||||||
|
Log.e(TAG, "setDefaultAppFinish: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showUpdateDialog(JsonObject jsonObject) {
|
private void showUpdateDialog(JsonObject jsonObject) {
|
||||||
|
|||||||
@@ -1305,6 +1305,12 @@ public class NetInterfaceManager {
|
|||||||
if ("com.aoleyunos.dop3".equals(s)) {
|
if ("com.aoleyunos.dop3".equals(s)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ("com.aoleyunos.dop7".equals(s)) {
|
||||||
|
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform) {
|
||||||
|
Log.e(TAG, "onNext: YXPD1 no need to uninstall");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!BuildConfig.DEBUG) {
|
if (!BuildConfig.DEBUG) {
|
||||||
ApkUtils.UninstallAPP(mContext, s);
|
ApkUtils.UninstallAPP(mContext, s);
|
||||||
}
|
}
|
||||||
@@ -1990,7 +1996,9 @@ public class NetInterfaceManager {
|
|||||||
Log.e("getEBagCode", "onNext: " + baseResponse);
|
Log.e("getEBagCode", "onNext: " + baseResponse);
|
||||||
if (baseResponse.code == OK) {
|
if (baseResponse.code == OK) {
|
||||||
EBagCode eBagCode = baseResponse.data;
|
EBagCode eBagCode = baseResponse.data;
|
||||||
|
if (JGYUtils.getInstance().checkAppPlatform()!=JGYUtils.YXPD1Platform) {
|
||||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, eBagCode.getEbagCode());
|
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, eBagCode.getEbagCode());
|
||||||
|
}
|
||||||
cacheHelper.put(UrlAddress.GET_EBAG_CODE, GsonUtils.toJSONString(eBagCode));
|
cacheHelper.put(UrlAddress.GET_EBAG_CODE, GsonUtils.toJSONString(eBagCode));
|
||||||
String ebagCode = eBagCode.getEbagCode();
|
String ebagCode = eBagCode.getEbagCode();
|
||||||
SPUtils.put(mContext, "ebagCode", ebagCode);
|
SPUtils.put(mContext, "ebagCode", ebagCode);
|
||||||
@@ -2098,12 +2106,19 @@ public class NetInterfaceManager {
|
|||||||
String default_launcher = defaultApp.getDefault_launcher();
|
String default_launcher = defaultApp.getDefault_launcher();
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(default_launcher)) {
|
if (!TextUtils.isEmpty(default_launcher)) {
|
||||||
|
Log.e(TAG, "setDefaultApp: default_launcher = " + default_launcher);
|
||||||
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, default_launcher);
|
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, default_launcher);
|
||||||
JGYUtils.getInstance().setDefaultDesktop(default_launcher);
|
JGYUtils.getInstance().setDefaultDesktop(default_launcher);
|
||||||
} else {
|
} else {
|
||||||
|
Log.e(TAG, "setDefaultApp: default_launcher is empty");
|
||||||
|
String desktop = mMMKV.decodeString(CommonConfig.DEFAULT_DESKTOP_PACKAGE_NAME);
|
||||||
|
if (TextUtils.isEmpty(desktop)) {
|
||||||
|
Log.e(TAG, "setDefaultApp: default_desktop is empty");
|
||||||
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "com.aoleyun.os");
|
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "com.aoleyun.os");
|
||||||
JGYUtils.getInstance().setDefaultDesktop("com.aoleyun.os");
|
JGYUtils.getInstance().setDefaultDesktop("com.aoleyun.os");
|
||||||
Log.e(TAG, "setDefaultApp: default_launcher is empty");
|
} else {
|
||||||
|
JGYUtils.getInstance().setDefaultDesktop(desktop);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class UrlAddress {
|
|||||||
public static final String SEND_BATTERY_INFO = "And/sn/updateBatteryInfo";
|
public static final String SEND_BATTERY_INFO = "And/sn/updateBatteryInfo";
|
||||||
/*上传联网时间*/
|
/*上传联网时间*/
|
||||||
public static final String NETWORK_CONNECT = "And/network";
|
public static final String NETWORK_CONNECT = "And/network";
|
||||||
/*获取设备时间管控*/
|
/*小程序的管控设置*/
|
||||||
public static final String GET_SN_SETTING = "And/control/getSnSetting";
|
public static final String GET_SN_SETTING = "And/control/getSnSetting";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1248,14 +1248,18 @@ public class PushManager {
|
|||||||
if (TextUtils.isEmpty(ebagCode)) {
|
if (TextUtils.isEmpty(ebagCode)) {
|
||||||
Log.e(TAG, "setEbagCode: " + "ebagCode is empty");
|
Log.e(TAG, "setEbagCode: " + "ebagCode is empty");
|
||||||
SPUtils.put(mContext, "ebagCode", "");
|
SPUtils.put(mContext, "ebagCode", "");
|
||||||
|
if (JGYUtils.getInstance().checkAppPlatform() != JGYUtils.YXPD1Platform) {
|
||||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, "");
|
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, "");
|
||||||
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
SPUtils.put(mContext, "ebagCode", ebagCode);
|
SPUtils.put(mContext, "ebagCode", ebagCode);
|
||||||
|
if (JGYUtils.getInstance().checkAppPlatform() != JGYUtils.YXPD1Platform) {
|
||||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, ebagCode);
|
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, ebagCode);
|
||||||
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 1);
|
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void recordLog(String jsonString) {
|
private void recordLog(String jsonString) {
|
||||||
NetInterfaceManager.getInstance().getRunLog();
|
NetInterfaceManager.getInstance().getRunLog();
|
||||||
|
|||||||
@@ -378,6 +378,19 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
if ("YX-T01".equalsIgnoreCase(Build.MODEL)) {
|
if ("YX-T01".equalsIgnoreCase(Build.MODEL)) {
|
||||||
JGYUtils.getInstance().setTongyiAppTop();
|
JGYUtils.getInstance().setTongyiAppTop();
|
||||||
}
|
}
|
||||||
|
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform) {
|
||||||
|
Settings.System.putString(getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, Utils.getSerial(this));
|
||||||
|
if (ApkUtils.isAvailable(this, JGYUtils.JXW_LAUNCHER_PACKAGE_NAME)) {
|
||||||
|
Intent intent2 = new Intent(Intent.ACTION_VIEW);
|
||||||
|
intent2.setPackage(JGYUtils.JXW_LAUNCHER_PACKAGE_NAME);
|
||||||
|
intent2.setClassName(JGYUtils.JXW_LAUNCHER_PACKAGE_NAME, JGYUtils.JXW_LAUNCHER_CLASS_NAME);
|
||||||
|
try {
|
||||||
|
startService(intent2);//或者bindService(intent, mConnection, Context.BIND_AUTO_CREATE); 都能启动
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "onCreate: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String launcherPkg = JGYUtils.getInstance().getDefaultDesktop();
|
String launcherPkg = JGYUtils.getInstance().getDefaultDesktop();
|
||||||
Log.e(TAG, "onCreate: " + launcherPkg);
|
Log.e(TAG, "onCreate: " + launcherPkg);
|
||||||
|
|||||||
@@ -1024,7 +1024,7 @@ public class ApkUtils {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(String s) {
|
public void onNext(String s) {
|
||||||
Log.e("UninstallAPP", "onNext: " + Thread.currentThread().getName());
|
Log.e("UninstallAPP", "onNext:" + Thread.currentThread().getName());
|
||||||
Log.e("UninstallAPP", "onNext: " + s);
|
Log.e("UninstallAPP", "onNext: " + s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,6 +117,13 @@ import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
|
|||||||
public class JGYUtils {
|
public class JGYUtils {
|
||||||
private static final String TAG = JGYUtils.class.getSimpleName();
|
private static final String TAG = JGYUtils.class.getSimpleName();
|
||||||
|
|
||||||
|
/*九学王*/
|
||||||
|
public static final String JXW_LAUNCHER_PACKAGE_NAME = "com.jxw.launcher";
|
||||||
|
/*注册服务*/
|
||||||
|
public static final String JXW_LAUNCHER_CLASS_NAME = "com.jht.engine.platsign.PlatformService";
|
||||||
|
/*学习资源*/
|
||||||
|
public static final String JXW_LAUNCHER_UPDATE_CLASS_NAME = "com.jxw.engine.platsign.UpdateActivity";
|
||||||
|
|
||||||
@SuppressLint("StaticFieldLeak")
|
@SuppressLint("StaticFieldLeak")
|
||||||
private static JGYUtils sInstance;
|
private static JGYUtils sInstance;
|
||||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||||
@@ -1242,13 +1249,18 @@ public class JGYUtils {
|
|||||||
pkgSet.addAll(ApkUtils.desktopAPP);
|
pkgSet.addAll(ApkUtils.desktopAPP);
|
||||||
pkgSet.addAll(ApkUtils.aoleyunAPP);
|
pkgSet.addAll(ApkUtils.aoleyunAPP);
|
||||||
pkgSet.addAll(ApkUtils.jxwApp);
|
pkgSet.addAll(ApkUtils.jxwApp);
|
||||||
if ("AS001".equals(Build.MODEL))
|
if ("AS001".equals(Build.MODEL)) {
|
||||||
pkgSet.addAll(ApkUtils.aihuaApp);
|
pkgSet.addAll(ApkUtils.aihuaApp);
|
||||||
if ("D1".equals(Build.MODEL))
|
}
|
||||||
|
if ("D1".equals(Build.MODEL)) {
|
||||||
pkgSet.addAll(ApkUtils.dongwa);
|
pkgSet.addAll(ApkUtils.dongwa);
|
||||||
if ("G23".equals(Build.MODEL))
|
}
|
||||||
|
if ("G23".equals(Build.MODEL)) {
|
||||||
pkgSet.addAll(ApkUtils.zhengwu);
|
pkgSet.addAll(ApkUtils.zhengwu);
|
||||||
|
}
|
||||||
|
if (JGYUtils.getInstance().checkAppPlatform()==JGYUtils.YXPD1Platform){
|
||||||
|
pkgSet.add("com.tencent.wemeet.app");
|
||||||
|
}
|
||||||
pkgSet.removeIf(TextUtils::isEmpty);
|
pkgSet.removeIf(TextUtils::isEmpty);
|
||||||
if (JGYUtils.C2Tag.equalsIgnoreCase(JGYUtils.getInstance().getAppPlatform())) {
|
if (JGYUtils.C2Tag.equalsIgnoreCase(JGYUtils.getInstance().getAppPlatform())) {
|
||||||
pkgSet.remove("com.tencent.mm");
|
pkgSet.remove("com.tencent.mm");
|
||||||
@@ -1271,12 +1283,18 @@ public class JGYUtils {
|
|||||||
pkgSet.addAll(ApkUtils.desktopAPP);
|
pkgSet.addAll(ApkUtils.desktopAPP);
|
||||||
pkgSet.addAll(ApkUtils.aoleyunAPP);
|
pkgSet.addAll(ApkUtils.aoleyunAPP);
|
||||||
pkgSet.addAll(ApkUtils.jxwApp);
|
pkgSet.addAll(ApkUtils.jxwApp);
|
||||||
if ("AS001".equals(Build.MODEL))
|
if ("AS001".equals(Build.MODEL)) {
|
||||||
pkgSet.addAll(ApkUtils.aihuaApp);
|
pkgSet.addAll(ApkUtils.aihuaApp);
|
||||||
if ("D1".equals(Build.MODEL))
|
}
|
||||||
|
if ("D1".equals(Build.MODEL)) {
|
||||||
pkgSet.addAll(ApkUtils.dongwa);
|
pkgSet.addAll(ApkUtils.dongwa);
|
||||||
if ("G23".equals(Build.MODEL))
|
}
|
||||||
|
if ("G23".equals(Build.MODEL)) {
|
||||||
pkgSet.addAll(ApkUtils.zhengwu);
|
pkgSet.addAll(ApkUtils.zhengwu);
|
||||||
|
}
|
||||||
|
if (JGYUtils.getInstance().checkAppPlatform()==JGYUtils.YXPD1Platform){
|
||||||
|
pkgSet.add("com.tencent.wemeet.app");
|
||||||
|
}
|
||||||
if (JGYUtils.C2Tag.equalsIgnoreCase(JGYUtils.getInstance().getAppPlatform())) {
|
if (JGYUtils.C2Tag.equalsIgnoreCase(JGYUtils.getInstance().getAppPlatform())) {
|
||||||
pkgSet.remove("com.tencent.mm");
|
pkgSet.remove("com.tencent.mm");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -899,7 +899,10 @@ public class SysSettingUtils {
|
|||||||
Settings.Global.putInt(context.getContentResolver(), CommonConfig.AOLEYUN_APPSTORE_INSTALL, 1);
|
Settings.Global.putInt(context.getContentResolver(), CommonConfig.AOLEYUN_APPSTORE_INSTALL, 1);
|
||||||
setUsb(context, 0);
|
setUsb(context, 0);
|
||||||
setBluetooth(context, 0);
|
setBluetooth(context, 0);
|
||||||
|
int status = Settings.System.getInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, 1);
|
||||||
|
if (status != 0) {
|
||||||
JGYUtils.getInstance().setDeveloperOptions(1);
|
JGYUtils.getInstance().setDeveloperOptions(1);
|
||||||
|
}
|
||||||
setCanReset(context, 0);
|
setCanReset(context, 0);
|
||||||
setActionBar(context, 0);
|
setActionBar(context, 0);
|
||||||
setNavigationBar(context, 0);
|
setNavigationBar(context, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user