diff --git a/build.gradle b/build.gradle index 5d9346a..b121546 100644 --- a/build.gradle +++ b/build.gradle @@ -163,6 +163,20 @@ android { } buildTypes { + YXPD1Debug.initWith(debug) + YXPD1Debug { + versionNameSuffix "-debug" + debuggable true + signingConfig signingConfigs.G10P + buildConfigField "String", "platform", '"YXPD1"' + } + + YXPD1Release.initWith(release) + YXPD1Release { + signingConfig signingConfigs.G10P + buildConfigField "String", "platform", '"YXPD1"' + } + c2Debug.initWith(debug) c2Debug { versionNameSuffix "-debug" diff --git a/iconloaderlib/build.gradle b/iconloaderlib/build.gradle index 1b4b389..9717864 100644 --- a/iconloaderlib/build.gradle +++ b/iconloaderlib/build.gradle @@ -13,6 +13,8 @@ android { } buildTypes { + YXPD1Debug {} + YXPD1Release {} c2Debug {} c2Release {} G104Debug {} diff --git a/src/com/aoleyun/os/Launcher.java b/src/com/aoleyun/os/Launcher.java index 4c7f74b..2ec56bc 100644 --- a/src/com/aoleyun/os/Launcher.java +++ b/src/com/aoleyun/os/Launcher.java @@ -75,8 +75,6 @@ import com.alibaba.sdk.android.push.CloudPushService; import com.alibaba.sdk.android.push.CommonCallback; import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory; import com.aoleyun.os.DropTarget.DragObject; -import com.aoleyun.os.uiuiutils.ApkUtils; -import com.aoleyun.os.uiuiutils.Utils; import com.aoleyun.os.accessibility.LauncherAccessibilityDelegate; import com.aoleyun.os.allapps.AllAppsContainerView; import com.aoleyun.os.allapps.AllAppsStore; @@ -103,10 +101,10 @@ import com.aoleyun.os.logging.UserEventDispatcher; import com.aoleyun.os.logging.UserEventDispatcher.UserEventDelegate; import com.aoleyun.os.model.AppLaunchTracker; import com.aoleyun.os.model.ModelWriter; -import com.aoleyun.os.network.bean.AppPasswdBean; -import com.aoleyun.os.network.bean.BaseResponse; import com.aoleyun.os.network.HTTPInterface; import com.aoleyun.os.network.NetInterfaceManager; +import com.aoleyun.os.network.bean.AppPasswdBean; +import com.aoleyun.os.network.bean.BaseResponse; import com.aoleyun.os.network.bean.NewestAppUpdateResult; import com.aoleyun.os.notification.NotificationListener; import com.aoleyun.os.pageindicators.PageIndicatorDots; @@ -119,8 +117,10 @@ import com.aoleyun.os.states.RotationHelper; import com.aoleyun.os.testing.TestProtocol; import com.aoleyun.os.touch.ItemClickHandler; import com.aoleyun.os.uioverrides.UiFactory; +import com.aoleyun.os.uiuiutils.ApkUtils; import com.aoleyun.os.uiuiutils.JGYUtils; import com.aoleyun.os.uiuiutils.TimeUtils; +import com.aoleyun.os.uiuiutils.Utils; import com.aoleyun.os.userevent.nano.LauncherLogProto; import com.aoleyun.os.userevent.nano.LauncherLogProto.Action; import com.aoleyun.os.userevent.nano.LauncherLogProto.ContainerType; @@ -1281,7 +1281,11 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, /*打开霸屏应用*/ String always_top_packagename = Settings.System.getString(getContentResolver(), "always_top_packagename"); if (!TextUtils.isEmpty(always_top_packagename)) { - ApkUtils.openPackage(Launcher.this, always_top_packagename); + if ("com.tongyi.aistudent".equalsIgnoreCase(always_top_packagename)) { + ApkUtils.openPackage(Launcher.this, "com.tongyi.aistudent", "com.tongyi.aistudent.activity.login.SplashActivity"); + } else { + ApkUtils.openPackage(Launcher.this, always_top_packagename); + } } mUpdate.checkUpdate(System.currentTimeMillis()); mPasswd.getPassword(System.currentTimeMillis()); diff --git a/src/com/aoleyun/os/uiuiutils/ApkUtils.java b/src/com/aoleyun/os/uiuiutils/ApkUtils.java index 04591e1..472420e 100644 --- a/src/com/aoleyun/os/uiuiutils/ApkUtils.java +++ b/src/com/aoleyun/os/uiuiutils/ApkUtils.java @@ -27,6 +27,31 @@ import java.io.OutputStream; import java.util.List; public class ApkUtils { + + private static final String TAG = ApkUtils.class.getSimpleName(); + + public static boolean openPackage(Context context, String packageName, String className) { + if (TextUtils.isEmpty(className)) { + return openPackage(context, packageName); + } + ComponentName cn = new ComponentName(packageName, className); + Intent intent = new Intent(); + intent.setComponent(cn); + intent.addCategory(Intent.CATEGORY_LAUNCHER); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + if (context != null) { + try { + context.startActivity(intent); + return true; + } catch (Exception e) { + Log.e(TAG, "openPackage: " + e.getMessage()); + ToastUtil.show("打开失败"); + return false; + } + } + return false; + } + public static boolean openPackage(Context context, String packageName) { Context pkgContext = getPackageContext(context, packageName); Intent intent = getAppOpenIntentByPackageName(context, packageName);