1.4.0320 修复yxpd1 不删除默认桌面,默认写入sn为激活码,默认启动九学王服务
This commit is contained in:
@@ -29,8 +29,8 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.aoleyun.sn"
|
||||
versionCode 114
|
||||
versionName "1.4.0318"
|
||||
versionCode 116
|
||||
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.
|
||||
minSdkVersion 24
|
||||
|
||||
@@ -30,6 +30,8 @@ public class MainAContact {
|
||||
void checkTestUpdate();
|
||||
/*获取桌面*/
|
||||
void getDefaultDesktop();
|
||||
/*获取系统默认程序设置*/
|
||||
void getDefaultApp();
|
||||
}
|
||||
|
||||
public interface MainView extends BaseView {
|
||||
@@ -53,5 +55,7 @@ public class MainAContact {
|
||||
void checkTestUpdateFinish();
|
||||
/*获取桌面结束*/
|
||||
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() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getUpdateApi()
|
||||
|
||||
@@ -175,11 +175,13 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
public void initView() {
|
||||
ButterKnife.bind(this);
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
String defaultDesktop = mMMKV.decodeString(CommonConfig.DEFAULT_DESKTOP_PACKAGE_NAME, "");
|
||||
Log.e(TAG, "initView: defaultDesktop = " + defaultDesktop);
|
||||
String defaultLauncher = mMMKV.decodeString(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
|
||||
Log.e(TAG, "initView: defaultLauncher = " + defaultLauncher);
|
||||
String defaultDesktop = mMMKV.decodeString(CommonConfig.DEFAULT_DESKTOP_PACKAGE_NAME, "");
|
||||
Log.e(TAG, "initView: defaultDesktop = " + defaultDesktop);
|
||||
String defaultLauncher = mMMKV.decodeString(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
|
||||
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);
|
||||
@@ -519,12 +521,19 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
|
||||
@Override
|
||||
public void checkTestUpdateFinish() {
|
||||
Log.e(TAG, "checkTestUpdateFinish: ");
|
||||
mMainAPresenter.getDefaultDesktop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDefaultDesktopFinish() {
|
||||
Log.e(TAG, "getDefaultDesktopFinish: ");
|
||||
mMainAPresenter.getDefaultApp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultAppFinish() {
|
||||
Log.e(TAG, "setDefaultAppFinish: ");
|
||||
}
|
||||
|
||||
private void showUpdateDialog(JsonObject jsonObject) {
|
||||
|
||||
@@ -1305,6 +1305,12 @@ public class NetInterfaceManager {
|
||||
if ("com.aoleyunos.dop3".equals(s)) {
|
||||
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) {
|
||||
ApkUtils.UninstallAPP(mContext, s);
|
||||
}
|
||||
@@ -1990,7 +1996,9 @@ public class NetInterfaceManager {
|
||||
Log.e("getEBagCode", "onNext: " + baseResponse);
|
||||
if (baseResponse.code == OK) {
|
||||
EBagCode eBagCode = baseResponse.data;
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, eBagCode.getEbagCode());
|
||||
if (JGYUtils.getInstance().checkAppPlatform()!=JGYUtils.YXPD1Platform) {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, eBagCode.getEbagCode());
|
||||
}
|
||||
cacheHelper.put(UrlAddress.GET_EBAG_CODE, GsonUtils.toJSONString(eBagCode));
|
||||
String ebagCode = eBagCode.getEbagCode();
|
||||
SPUtils.put(mContext, "ebagCode", ebagCode);
|
||||
@@ -2098,12 +2106,19 @@ public class NetInterfaceManager {
|
||||
String default_launcher = defaultApp.getDefault_launcher();
|
||||
|
||||
if (!TextUtils.isEmpty(default_launcher)) {
|
||||
Log.e(TAG, "setDefaultApp: default_launcher = " + default_launcher);
|
||||
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, default_launcher);
|
||||
JGYUtils.getInstance().setDefaultDesktop(default_launcher);
|
||||
} else {
|
||||
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "com.aoleyun.os");
|
||||
JGYUtils.getInstance().setDefaultDesktop("com.aoleyun.os");
|
||||
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");
|
||||
JGYUtils.getInstance().setDefaultDesktop("com.aoleyun.os");
|
||||
} 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 NETWORK_CONNECT = "And/network";
|
||||
/*获取设备时间管控*/
|
||||
/*小程序的管控设置*/
|
||||
public static final String GET_SN_SETTING = "And/control/getSnSetting";
|
||||
|
||||
|
||||
|
||||
@@ -1248,12 +1248,16 @@ public class PushManager {
|
||||
if (TextUtils.isEmpty(ebagCode)) {
|
||||
Log.e(TAG, "setEbagCode: " + "ebagCode is empty");
|
||||
SPUtils.put(mContext, "ebagCode", "");
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, "");
|
||||
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||
if (JGYUtils.getInstance().checkAppPlatform() != JGYUtils.YXPD1Platform) {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, "");
|
||||
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||
}
|
||||
} else {
|
||||
SPUtils.put(mContext, "ebagCode", ebagCode);
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, ebagCode);
|
||||
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 1);
|
||||
if (JGYUtils.getInstance().checkAppPlatform() != JGYUtils.YXPD1Platform) {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, ebagCode);
|
||||
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -378,6 +378,19 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
if ("YX-T01".equalsIgnoreCase(Build.MODEL)) {
|
||||
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();
|
||||
Log.e(TAG, "onCreate: " + launcherPkg);
|
||||
|
||||
@@ -1024,7 +1024,7 @@ public class ApkUtils {
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
Log.e("UninstallAPP", "onNext: " + Thread.currentThread().getName());
|
||||
Log.e("UninstallAPP", "onNext:" + Thread.currentThread().getName());
|
||||
Log.e("UninstallAPP", "onNext: " + s);
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +117,13 @@ import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
|
||||
public class JGYUtils {
|
||||
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")
|
||||
private static JGYUtils sInstance;
|
||||
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.aoleyunAPP);
|
||||
pkgSet.addAll(ApkUtils.jxwApp);
|
||||
if ("AS001".equals(Build.MODEL))
|
||||
if ("AS001".equals(Build.MODEL)) {
|
||||
pkgSet.addAll(ApkUtils.aihuaApp);
|
||||
if ("D1".equals(Build.MODEL))
|
||||
}
|
||||
if ("D1".equals(Build.MODEL)) {
|
||||
pkgSet.addAll(ApkUtils.dongwa);
|
||||
if ("G23".equals(Build.MODEL))
|
||||
}
|
||||
if ("G23".equals(Build.MODEL)) {
|
||||
pkgSet.addAll(ApkUtils.zhengwu);
|
||||
|
||||
}
|
||||
if (JGYUtils.getInstance().checkAppPlatform()==JGYUtils.YXPD1Platform){
|
||||
pkgSet.add("com.tencent.wemeet.app");
|
||||
}
|
||||
pkgSet.removeIf(TextUtils::isEmpty);
|
||||
if (JGYUtils.C2Tag.equalsIgnoreCase(JGYUtils.getInstance().getAppPlatform())) {
|
||||
pkgSet.remove("com.tencent.mm");
|
||||
@@ -1271,12 +1283,18 @@ public class JGYUtils {
|
||||
pkgSet.addAll(ApkUtils.desktopAPP);
|
||||
pkgSet.addAll(ApkUtils.aoleyunAPP);
|
||||
pkgSet.addAll(ApkUtils.jxwApp);
|
||||
if ("AS001".equals(Build.MODEL))
|
||||
if ("AS001".equals(Build.MODEL)) {
|
||||
pkgSet.addAll(ApkUtils.aihuaApp);
|
||||
if ("D1".equals(Build.MODEL))
|
||||
}
|
||||
if ("D1".equals(Build.MODEL)) {
|
||||
pkgSet.addAll(ApkUtils.dongwa);
|
||||
if ("G23".equals(Build.MODEL))
|
||||
}
|
||||
if ("G23".equals(Build.MODEL)) {
|
||||
pkgSet.addAll(ApkUtils.zhengwu);
|
||||
}
|
||||
if (JGYUtils.getInstance().checkAppPlatform()==JGYUtils.YXPD1Platform){
|
||||
pkgSet.add("com.tencent.wemeet.app");
|
||||
}
|
||||
if (JGYUtils.C2Tag.equalsIgnoreCase(JGYUtils.getInstance().getAppPlatform())) {
|
||||
pkgSet.remove("com.tencent.mm");
|
||||
}
|
||||
|
||||
@@ -899,7 +899,10 @@ public class SysSettingUtils {
|
||||
Settings.Global.putInt(context.getContentResolver(), CommonConfig.AOLEYUN_APPSTORE_INSTALL, 1);
|
||||
setUsb(context, 0);
|
||||
setBluetooth(context, 0);
|
||||
JGYUtils.getInstance().setDeveloperOptions(1);
|
||||
int status = Settings.System.getInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, 1);
|
||||
if (status != 0) {
|
||||
JGYUtils.getInstance().setDeveloperOptions(1);
|
||||
}
|
||||
setCanReset(context, 0);
|
||||
setActionBar(context, 0);
|
||||
setNavigationBar(context, 0);
|
||||
|
||||
Reference in New Issue
Block a user