diff --git a/build.gradle b/build.gradle index 38bd792..e7ea50b 100644 --- a/build.gradle +++ b/build.gradle @@ -159,6 +159,15 @@ android { v2SigningEnabled true } + iPlay50miniPro { + storeFile file("keystore/iPlay50miniPro.jks") + storePassword "123456" + keyAlias "iplay50minipro" + keyPassword "123456" + v1SigningEnabled true + v2SigningEnabled true + } + G10P { storeFile file("keystore/G10PMTK11.jks") storePassword "123456" @@ -265,6 +274,15 @@ android { v1SigningEnabled true v2SigningEnabled true } + + SM8150 { + storeFile file("keystore/sm8150.jks") + storePassword "logan-123456789" + keyAlias "platformkey" + keyPassword "logan-123456789" + v1SigningEnabled true + v2SigningEnabled true + } } buildTypes { @@ -315,13 +333,13 @@ android { buildConfigField "String", "platform", '"QualcommA"' versionNameSuffix "_debug" debuggable true - signingConfig signingConfigs.zhanRui + signingConfig signingConfigs.SM8150 } QualcommRelease.initWith(release) QualcommRelease { buildConfigField "String", "platform", '"QualcommA"' - signingConfig signingConfigs.zhanRui + signingConfig signingConfigs.SM8150 } G128TDebug.initWith(debug) @@ -492,6 +510,20 @@ android { signingConfig signingConfigs.G10P } + iPlay50miniProDebug.initWith(debug) + iPlay50miniProDebug { + buildConfigField "String", "platform", '"miniG99"' + versionNameSuffix "_debug" + debuggable true + signingConfig signingConfigs.iPlay50miniPro + } + + iPlay50miniProRelease.initWith(release) + iPlay50miniProRelease { + buildConfigField "String", "platform", '"miniG99"' + signingConfig signingConfigs.iPlay50miniPro + } + zhanRuiDebug.initWith(debug) zhanRuiDebug { versionNameSuffix "_debug" diff --git a/iconloaderlib/build.gradle b/iconloaderlib/build.gradle index d7ffc18..74810bb 100644 --- a/iconloaderlib/build.gradle +++ b/iconloaderlib/build.gradle @@ -47,6 +47,8 @@ android { c2Release {} G104Debug {} G104Release {} + iPlay50miniProDebug {} + iPlay50miniProRelease {} G10PDebug {} G10PRelease {} zhanRuiDebug {} diff --git a/keystore/iPlay50miniPro.jks b/keystore/iPlay50miniPro.jks new file mode 100644 index 0000000..e5aeab8 Binary files /dev/null and b/keystore/iPlay50miniPro.jks differ diff --git a/keystore/sm8150.jks b/keystore/sm8150.jks new file mode 100644 index 0000000..ecf3b32 Binary files /dev/null and b/keystore/sm8150.jks differ diff --git a/src/com/aoleyun/os/Launcher.java b/src/com/aoleyun/os/Launcher.java index 09579b8..29b27e0 100644 --- a/src/com/aoleyun/os/Launcher.java +++ b/src/com/aoleyun/os/Launcher.java @@ -485,10 +485,12 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, WallpaperManager wallpaperManager = WallpaperManager.getInstance(this); try { if ("Aiud_A8_ag_1095".equals(Build.MODEL) - ||JgyUtils.getInstance().checkAppPlatform() == JgyUtils.seewoPlatform + || JgyUtils.getInstance().checkAppPlatform() == JgyUtils.seewoPlatform ) { wallpaperManager.setBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.wallpapers_aiudu)); - }else { +// } else if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform) { +// wallpaperManager.clear(); + } else { wallpaperManager.setBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.wallpapers)); } } catch (IOException e) { diff --git a/src/com/aoleyun/os/network/NetInterfaceManager.java b/src/com/aoleyun/os/network/NetInterfaceManager.java index cfafb5d..b57a90d 100644 --- a/src/com/aoleyun/os/network/NetInterfaceManager.java +++ b/src/com/aoleyun/os/network/NetInterfaceManager.java @@ -208,6 +208,8 @@ public class NetInterfaceManager { set.add(JgyUtils.AUDG104Tag); } else if (platform == JgyUtils.seewoPlatform) { set.add(JgyUtils.seewoTag); + } else if (platform == JgyUtils.QualcommPlatform) { + set.add(JgyUtils.Qualcomm_TAG); } else if (platform == JgyUtils.DX11Platform) { set.add(JgyUtils.DX11_TAG); } else if (platform == JgyUtils.G12NLPlatform) { diff --git a/src/com/aoleyun/os/uiuiutils/JgyUtils.java b/src/com/aoleyun/os/uiuiutils/JgyUtils.java index 95564e2..1a9a9a2 100644 --- a/src/com/aoleyun/os/uiuiutils/JgyUtils.java +++ b/src/com/aoleyun/os/uiuiutils/JgyUtils.java @@ -45,6 +45,7 @@ public class JgyUtils { public static final int MT8768Platform = 17; public static final int AUDG104Platform = 18; public static final int seewoPlatform = 25; + public static final int QualcommPlatform = 30; public static final int DX11Platform = 31; public static final int G12NLPlatform = 32; @@ -65,6 +66,7 @@ public class JgyUtils { public static final String MT8768Tag = "MT8768"; public static final String AUDG104Tag = "AUDG104"; public static final String seewoTag = "seewo"; + public static final String Qualcomm_TAG = "QualcommA"; public static final String DX11_TAG = "DX11"; public static final String G12NL_TAG = "G12NL"; @@ -125,7 +127,10 @@ public class JgyUtils { } else if (seewoTag.equalsIgnoreCase(platform)) { Log.i(TAG, "checkAppPlatform: " + "seewo"); return seewoPlatform; - } else if (DX11_TAG.equalsIgnoreCase(platform)) { + }else if (Qualcomm_TAG.equalsIgnoreCase(platform)) { + Log.i(TAG, "checkAppPlatform: " + "QualcommA"); + return QualcommPlatform; + } else if (DX11_TAG.equalsIgnoreCase(platform)) { Log.i(TAG, "checkAppPlatform: " + "DX11"); return DX11Platform; } else if (G12NL_TAG.equalsIgnoreCase(platform)) { @@ -165,6 +170,8 @@ public class JgyUtils { getAppPlatformCallback.AppPlatform(AUDG104Platform); } else if (seewoTag.equalsIgnoreCase(platform)) { getAppPlatformCallback.AppPlatform(seewoPlatform); + } else if (Qualcomm_TAG.equalsIgnoreCase(platform)) { + getAppPlatformCallback.AppPlatform(QualcommPlatform); } else if (DX11_TAG.equalsIgnoreCase(platform)) { getAppPlatformCallback.AppPlatform(DX11Platform); } else if (G12NL_TAG.equalsIgnoreCase(platform)) { diff --git a/src/com/aoleyun/os/uiuiutils/WallpaperUtils.java b/src/com/aoleyun/os/uiuiutils/WallpaperUtils.java new file mode 100644 index 0000000..6f40fbd --- /dev/null +++ b/src/com/aoleyun/os/uiuiutils/WallpaperUtils.java @@ -0,0 +1,120 @@ +package com.aoleyun.os.uiuiutils; + +import android.app.WallpaperManager; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.drawable.BitmapDrawable; +import android.graphics.drawable.Drawable; +import android.os.AsyncTask; +import android.content.Context; +import android.os.ParcelFileDescriptor; +import android.util.Log; + +import java.io.IOException; + +public class WallpaperUtils { + + + /** + * @param lockOnly true=仅锁屏;false=按 flags 控制 + * @param flags 0 使用传统 setBitmap(主屏); + * WallpaperManager.FLAG_SYSTEM 主屏; + * WallpaperManager.FLAG_LOCK 锁屏; + * 可组合 FLAG_SYSTEM|FLAG_LOCK + */ + public static void setBitmapAsWallpaper(final Context context, + final Bitmap bmp, + final boolean lockOnly, + final int flags) { + new AsyncTask() { + @Override + protected Boolean doInBackground(Void... v) { + try { + WallpaperManager wm = WallpaperManager.getInstance(context); + if (lockOnly && android.os.Build.VERSION.SDK_INT >= 24) { + wm.setBitmap(bmp, null, true, WallpaperManager.FLAG_LOCK); + } else if (flags != 0 && android.os.Build.VERSION.SDK_INT >= 24) { + wm.setBitmap(bmp, null, true, flags); + } else { + wm.setBitmap(bmp); // 传统:设置主屏壁纸 + } + return true; + } catch (IOException e) { + Log.e("Wallpaper", "set failed", e); + return false; + } + } + }.execute(); + } + + // 获取当前主屏壁纸并重新设置(相当于“重设当前壁纸”) + public static void reapplyCurrentWallpaper(Context context) { + new AsyncTask() { + @Override + protected Bitmap doInBackground(Void... voids) { + try { + WallpaperManager wm = WallpaperManager.getInstance(context); + Drawable d = wm.getDrawable(); // 当前系统壁纸,无则返回默认 [11](@ref) + if (d instanceof BitmapDrawable) { + return ((BitmapDrawable) d).getBitmap(); + } + return null; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + @Override + protected void onPostExecute(Bitmap bmp) { + if (bmp == null) return; + setBitmapAsWallpaper(context, bmp, false, 0); + } + }.execute(); + } + + public static void reapplyLockWallpaper(Context context) { + if (android.os.Build.VERSION.SDK_INT < 24) return; + new AsyncTask() { + @Override + protected Bitmap doInBackground(Void... v) { + try { + WallpaperManager wm = WallpaperManager.getInstance(context); + ParcelFileDescriptor pfd = wm.getWallpaperFile(WallpaperManager.FLAG_LOCK); + if (pfd == null) { + pfd = wm.getWallpaperFile(WallpaperManager.FLAG_SYSTEM); + } + if (pfd == null) return null; + Bitmap bmp = BitmapFactory.decodeFileDescriptor(pfd.getFileDescriptor()); + pfd.close(); + return bmp; + } catch (Exception e) { + return null; + } + } + @Override + protected void onPostExecute(Bitmap bmp) { + if (bmp != null) setBitmapAsWallpaper(context, bmp, true, 0); + } + }.execute(); + } + + public static void applyBuiltInDefault(Context context) { + new AsyncTask() { + @Override + protected Bitmap doInBackground(Void... v) { + WallpaperManager wm = WallpaperManager.getInstance(context); + Drawable d = wm.getBuiltInDrawable(); // 框架内置默认壁纸 + if (d instanceof BitmapDrawable) { + return ((BitmapDrawable) d).getBitmap(); + } + return null; + } + + @Override + protected void onPostExecute(Bitmap bmp) { + if (bmp != null) setBitmapAsWallpaper(context, bmp, false, 0); + } + }.execute(); + } +} \ No newline at end of file