version:1.6.4

fix:修复U807设置默认桌面问题
update:没有安装设备信息可以直接打开应用
This commit is contained in:
2023-10-26 10:04:01 +08:00
parent 7ed3114868
commit a8f1198eef
7 changed files with 74 additions and 44 deletions

View File

@@ -16,8 +16,8 @@ android {
minSdkVersion 24
targetSdkVersion 29
versionCode 55
versionName "1.6.3"
versionCode 56
versionName "1.6.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -76,11 +76,13 @@ android {
versionNameSuffix "-debug"
debuggable true
signingConfig signingConfigs.U807
buildConfigField "String", "platform", '"U807"'
}
U807Release.initWith(release)
U807Release {
signingConfig signingConfigs.U807
buildConfigField "String", "platform", '"U807"'
}
// iPlay50SEDebug.initWith(debug)

View File

@@ -3,7 +3,6 @@ package com.uiui.zyos.activity;
import android.content.Context;
import android.media.AudioAttributes;
import android.media.SoundPool;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.provider.Settings;
@@ -21,8 +20,7 @@ import com.tuo.customview.VerificationCodeView;
import com.uiui.zyos.R;
import com.uiui.zyos.base.BaseActivity;
import com.uiui.zyos.config.CommonConfig;
import com.uiui.zyos.manager.RemoteManager;
import com.uiui.zyos.utils.ApkUtils;
import com.uiui.zyos.utils.Utils;
import butterknife.BindView;
import butterknife.ButterKnife;
@@ -145,13 +143,13 @@ public class ExitActivity extends BaseActivity {
String password = Settings.Global.getString(getContentResolver(), CommonConfig.LOCK_SCREEN_PASSWORD);
if ((!TextUtils.isEmpty(content) && !TextUtils.isEmpty(password))) {
if (password.equals(content)) {
exitDesktop();
Utils.exitDesktop(this);
} else {
setEmpty();
tv_hint.setText("密码错误");
}
} else if (CommonConfig.DEFAULT_PASSWORD.equals(content)) {
exitDesktop();
Utils.exitDesktop(this);
} else {
setEmpty();
tv_hint.setText("密码错误");
@@ -189,19 +187,4 @@ public class ExitActivity extends BaseActivity {
codeView.getEditText().setText(text);
// soundPool.play(soundId, 1, 1, 0, 0, 1);
}
private void exitDesktop() {
RemoteManager.getInstance().setDefaultDesktop(ApkUtils.ANDROID_LAUNCHER3_PACKAGE_NAME);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
if (!ApkUtils.openPackage(this, ApkUtils.ANDROID_LAUNCHER3_PACKAGE_NAME, ApkUtils.ANDROID_LAUNCHER3_Quickstep_CLASS_NAME)) {
ApkUtils.gotoLauncher(this);
}
} else {
if (!ApkUtils.openPackage(this, ApkUtils.ANDROID_LAUNCHER3_PACKAGE_NAME, ApkUtils.ANDROID_LAUNCHER3_CLASS_NAME)) {
ApkUtils.gotoLauncher(this);
}
}
this.finish();
System.exit(0);
}
}

View File

@@ -287,6 +287,21 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
OpenApkUtils.getInstance().openAppWithoutArgs(JxwPackageConfig.JXW_LAUNCHER_PACKAGE_NAME, JxwPackageConfig.JXW_LAUNCHER_UPDATE_CLASS_NAME);
}
});
ComponentName cn = new ComponentName("com.jxw.mskt.video", "com.jxw.mskt.video.VideoDownload");
Intent intent = new Intent();
intent.setComponent(cn);
intent.putExtra("type", "新东方专区");
intent.putExtra("isCourse", false);
intent.putExtra("id", 23151);
intent.putExtra("name", "西游记");
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
try {
startActivity(intent);
} catch (Exception e) {
Log.e(TAG, "openPackageWithArgs: " + e.getMessage());
}
}
@Override

View File

@@ -39,10 +39,10 @@ import com.uiui.zyos.bean.StudyStatBean;
import com.uiui.zyos.config.CommonConfig;
import com.uiui.zyos.dialog.SingleDialog;
import com.uiui.zyos.jxw.JxwPackageConfig;
import com.uiui.zyos.manager.RemoteManager;
import com.uiui.zyos.utils.ApkUtils;
import com.uiui.zyos.utils.OpenApkUtils;
import com.uiui.zyos.utils.TimeUtils;
import com.uiui.zyos.utils.Utils;
import com.uiui.zyos.view.RecyclerViewSpacesItemDecoration;
import java.util.ArrayList;
@@ -235,7 +235,7 @@ public class UserFragment extends BaseFragment implements UserContact.UserView {
if (is_activation == 1) {
showPassword();
} else {
exitDesktop();
Utils.exitDesktop(mContext);
}
}
});
@@ -316,15 +316,6 @@ public class UserFragment extends BaseFragment implements UserContact.UserView {
startActivity(new Intent(mContext, ExitActivity.class));
}
private void exitDesktop() {
RemoteManager.getInstance().setDefaultDesktop(ApkUtils.ANDROID_LAUNCHER3_PACKAGE_NAME);
if (!ApkUtils.openPackage(mContext, ApkUtils.ANDROID_LAUNCHER3_PACKAGE_NAME, ApkUtils.ANDROID_LAUNCHER3_CLASS_NAME)) {
ApkUtils.gotoLauncher(mContext);
}
mContext.finish();
System.exit(0);
}
private void setButtonVisibility() {
int is_activation = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
Log.e(TAG, "setButtonVisibility: " + is_activation);

View File

@@ -606,12 +606,21 @@ public class ApkUtils {
public static void gotoLauncher(Context context) {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
Intent homeIntent = new Intent(Intent.ACTION_MAIN);
homeIntent.setPackage("com.android.launcher3");
homeIntent.addCategory(Intent.CATEGORY_HOME);
homeIntent.addCategory(Intent.CATEGORY_DEFAULT);
homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(homeIntent);
if ("U807".equals(BuildConfig.platform)) {
Intent homeIntent = new Intent(Intent.ACTION_MAIN);
homeIntent.setPackage("com.uiuipad.os");
homeIntent.addCategory(Intent.CATEGORY_HOME);
homeIntent.addCategory(Intent.CATEGORY_DEFAULT);
homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(homeIntent);
} else {
Intent homeIntent = new Intent(Intent.ACTION_MAIN);
homeIntent.setPackage("com.android.launcher3");
homeIntent.addCategory(Intent.CATEGORY_HOME);
homeIntent.addCategory(Intent.CATEGORY_DEFAULT);
homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(homeIntent);
}
} else {
Intent i = new Intent(Intent.ACTION_MAIN);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //android123提示如果是服务里调用必须加入new task标识

View File

@@ -55,6 +55,9 @@ public class OpenApkUtils {
}
private boolean checkActivation() {
if (!ApkUtils.isAvailable(mContext, "com.uiui.zy")) {
return true;
}
int is_activation = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
if (is_activation != 1) {
ApkUtils.openPackage(mContext, "com.uiui.zy", "com.uiui.zy.activity.main.MainActivity");

View File

@@ -1,6 +1,6 @@
package com.uiui.zyos.utils;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
@@ -29,6 +29,7 @@ import com.google.zxing.qrcode.QRCodeWriter;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import com.uiui.zyos.BuildConfig;
import com.uiui.zyos.R;
import com.uiui.zyos.manager.RemoteManager;
import java.io.File;
import java.lang.reflect.Method;
@@ -40,9 +41,10 @@ public class Utils {
/**
* 获取设备序列号
*
// * @return
// */
* <p>
* // * @return
* //
*/
// @SuppressLint("MissingPermission")
// public static String getSerial() {
// String serial = "unknow";
@@ -65,7 +67,6 @@ public class Utils {
// }
// return serial;
// }
public static String getAndroiodScreenProperty(Context context) {
Log.e("getAndroiodScreenProperty", "heightPixels" + context.getResources().getDisplayMetrics().heightPixels);
Log.e("getAndroiodScreenProperty", "widthPixels" + context.getResources().getDisplayMetrics().widthPixels);
@@ -236,4 +237,30 @@ public class Utils {
//true为打开false为关闭
return powerManager.isInteractive();
}
public static void exitDesktop(Activity context) {
if ("U807".equals(BuildConfig.platform)) {
RemoteManager.getInstance().setDefaultDesktop("com.uiuipad.os");
} else {
RemoteManager.getInstance().setDefaultDesktop(ApkUtils.ANDROID_LAUNCHER3_PACKAGE_NAME);
}
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
if ("U807".equals(BuildConfig.platform)) {
if (!ApkUtils.openPackage(context, "com.uiuipad.os", "com.uiuipad.os.Launcher")) {
ApkUtils.gotoLauncher(context);
}
} else {
if (!ApkUtils.openPackage(context, ApkUtils.ANDROID_LAUNCHER3_PACKAGE_NAME, ApkUtils.ANDROID_LAUNCHER3_Quickstep_CLASS_NAME)) {
ApkUtils.gotoLauncher(context);
}
}
} else {
if (!ApkUtils.openPackage(context, ApkUtils.ANDROID_LAUNCHER3_PACKAGE_NAME, ApkUtils.ANDROID_LAUNCHER3_CLASS_NAME)) {
ApkUtils.gotoLauncher(context);
}
}
context.finish();
System.exit(0);
}
}