version:4.5

fix:
update:优化aihua版本
This commit is contained in:
2022-04-25 21:10:34 +08:00
parent 7903e3c21b
commit 6bd36a3afb
7 changed files with 196 additions and 118 deletions

View File

@@ -2,7 +2,7 @@ buildscript {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
maven {url 'http://developer.huawei.com/repo/'} maven { url 'http://developer.huawei.com/repo/' }
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' } maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
@@ -65,19 +65,17 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 26 minSdkVersion 26
targetSdkVersion 28 targetSdkVersion 28
versionCode 35 versionCode 36
versionName "4.4" versionName "4.5"
ndk { ndk {
//选择要添加的对应 cpu 类型的 .so 库。 //选择要添加的对应 cpu 类型的 .so 库。
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
// 还可以添加 'x86', 'x86_64', 'mips', 'mips64' // 还可以添加 'x86', 'x86_64', 'mips', 'mips64'
} }
manifestPlaceholders = [ manifestPlaceholders = [
XG_ACCESS_ID : "1500026378", XG_ACCESS_ID : "1500026378",
XG_ACCESS_KEY: "AH5QD9ZMBJ6R", XG_ACCESS_KEY: "AH5QD9ZMBJ6R",
// JPUSH_PKGNAME: "com.aoleyun.os",
// JPUSH_APPKEY : "0c7ba5a1622dba78d5bd00cc", //JPush 上注册的包名对应的 Appkey.
// JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
] ]
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -86,16 +84,16 @@ android {
//签名 //签名
signingConfigs { signingConfigs {
alldocube { zhanRui {
storeFile file("src/doc/zhanxun.keystore") storeFile file("src/doc/zhanxun.keystore")
storePassword "123456" storePassword "123456"
keyAlias "zhanxun" keyAlias "zhanxun"
keyPassword "123456" keyPassword "123456"
v1SigningEnabled true v1SigningEnabled true
v2SigningEnabled false v2SigningEnabled true
} }
alldocubeDebug { zhanRuiUserdebug {
storeFile file("src/doc/zhanxunUserdebug.keystore") storeFile file("src/doc/zhanxunUserdebug.keystore")
storePassword "123456" storePassword "123456"
keyAlias "zhanxunUserdebug" keyAlias "zhanxunUserdebug"
@@ -103,32 +101,55 @@ android {
v1SigningEnabled true v1SigningEnabled true
v2SigningEnabled false v2SigningEnabled false
} }
mtk {
storeFile file("src/doc/xueshibaoos.jks")
storePassword "123456"
keyAlias "xueshibaoos"
keyPassword "123456"
v1SigningEnabled true
v2SigningEnabled true
}
} }
buildTypes { buildTypes {
alldocubeDebug.initWith(debug) zhanRuiDebug.initWith(debug)
alldocubeDebug { zhanRuiDebug {
versionNameSuffix "-debug"
buildConfigField "String", "platform", '"ZhanRui"' buildConfigField "String", "platform", '"ZhanRui"'
debuggable true debuggable true
signingConfig signingConfigs.zhanRui
}
zhanRuiRelease.initWith(release)
zhanRuiRelease {
buildConfigField "String", "platform", '"ZhanRui"'
signingConfig signingConfigs.zhanRui
}
alldocubeDebug.initWith(debug)
alldocubeDebug {
buildConfigField "String", "platform", '"ZhanRuiCube"'
debuggable true
versionNameSuffix "-debug" versionNameSuffix "-debug"
signingConfig signingConfigs.alldocubeDebug signingConfig signingConfigs.zhanRuiUserdebug
} }
alldocubeDebugReleas.initWith(release) alldocubeDebugReleas.initWith(release)
alldocubeDebugReleas { alldocubeDebugReleas {
buildConfigField "String", "platform", '"ZhanRui"' buildConfigField "String", "platform", '"ZhanRuiCube"'
signingConfig signingConfigs.alldocubeDebug signingConfig signingConfigs.zhanRuiUserdebug
} }
debug { debug {
buildConfigField "String", "platform", '"ZhanRui"' buildConfigField "String", "platform", '"MTK"'
debuggable true debuggable true
versionNameSuffix "-debug" versionNameSuffix "-debug"
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//Zipalign优化 //Zipalign优化
zipAlignEnabled true zipAlignEnabled true
signingConfig signingConfigs.alldocube signingConfig signingConfigs.mtk
applicationVariants.all { variant -> applicationVariants.all { variant ->
variant.outputs.each { output -> variant.outputs.each { output ->
def outputFile = output.outputFile def outputFile = output.outputFile
@@ -141,7 +162,7 @@ android {
} }
release { release {
buildConfigField "String", "platform", '"ZhanRui"' buildConfigField "String", "platform", '"MTK"'
//混淆 //混淆
minifyEnabled false minifyEnabled false
//前一部分代表系统默认的android程序的混淆文件该文件已经包含了基本的混淆声明后一个文件是自己的定义混淆文件 //前一部分代表系统默认的android程序的混淆文件该文件已经包含了基本的混淆声明后一个文件是自己的定义混淆文件
@@ -149,7 +170,7 @@ android {
//Zipalign优化 //Zipalign优化
zipAlignEnabled true zipAlignEnabled true
//签名 //签名
signingConfig signingConfigs.alldocube signingConfig signingConfigs.mtk
//将release版本的包名重命名加上版本及日期 //将release版本的包名重命名加上版本及日期
applicationVariants.all { variant -> applicationVariants.all { variant ->
variant.outputs.each { output -> variant.outputs.each { output ->

View File

@@ -13,6 +13,14 @@ android {
} }
buildTypes { buildTypes {
zhanRuiDebug {
minifyEnabled false
}
zhanRuiRelease {
minifyEnabled false
}
alldocubeDebug { alldocubeDebug {
minifyEnabled false minifyEnabled false
} }
@@ -20,6 +28,7 @@ android {
alldocubeDebugReleas { alldocubeDebugReleas {
minifyEnabled false minifyEnabled false
} }
debug { debug {
minifyEnabled false minifyEnabled false
} }

View File

@@ -585,6 +585,9 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
// } // }
public void setRoleHolderAsUser(Context context, String packageName) { public void setRoleHolderAsUser(Context context, String packageName) {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {
return;
}
String roleName = "android.app.role.HOME"; String roleName = "android.app.role.HOME";
boolean add = true; boolean add = true;
int flags = 0; int flags = 0;
@@ -593,6 +596,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
Log.i("settingssssssstemf", (add ? "Adding" : "Removing") + " package as role holder, role: " Log.i("settingssssssstemf", (add ? "Adding" : "Removing") + " package as role holder, role: "
+ roleName + ", package: " + packageName); + roleName + ", package: " + packageName);
if (JGYUtils.getInstance().checkAppPlatform() != JGYUtils.MTKPlatform) {
RoleManager roleManager = context.getSystemService(RoleManager.class); RoleManager roleManager = context.getSystemService(RoleManager.class);
Executor executor = context.getMainExecutor(); Executor executor = context.getMainExecutor();
Consumer<Boolean> callback = successful -> { Consumer<Boolean> callback = successful -> {
@@ -610,6 +614,8 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
Log.i("settingssssssstemf", "addRoleHolderAsUser done"); Log.i("settingssssssstemf", "addRoleHolderAsUser done");
} }
}
private TimeChangedReceiver mTimeChangedReceiver; private TimeChangedReceiver mTimeChangedReceiver;
//监听时间和日期变化 //监听时间和日期变化
@@ -1403,7 +1409,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
} }
private void checkAppUpdate(NewestAppUpdateResult result) { private void checkAppUpdate(NewestAppUpdateResult result) {
int app_version_code = result.getVersion_code(); int version_code = result.getVersion_code();
String app_package = result.getApp_package(); String app_package = result.getApp_package();
String url = result.getUrl(); String url = result.getUrl();
PackageInfo info = null; PackageInfo info = null;
@@ -1412,7 +1418,13 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} }
if (info == null || info.versionCode < app_version_code || info.getLongVersionCode() < app_version_code) { long appVersionCode;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
appVersionCode = info.getLongVersionCode();
} else {
appVersionCode = info.versionCode;
}
if (info != null && appVersionCode < version_code) {
Aria.download(this) Aria.download(this)
.load(url) .load(url)
.setExtendField(result.toString()) .setExtendField(result.toString())

View File

@@ -231,8 +231,7 @@ public class IconCache extends BaseIconCache {
info.applyFrom((entry.icon == null) ? getDefaultIcon(info.user) : entry); info.applyFrom((entry.icon == null) ? getDefaultIcon(info.user) : entry);
} }
private List<String> appClassNameList = new ArrayList<String>() { private List<String> appClassNameList = new ArrayList<String>() {{
{
this.add("com.aoleyun.appstore.activity.SplashActivity");//应用市场 this.add("com.aoleyun.appstore.activity.SplashActivity");//应用市场
this.add("com.aoleyun.browser.BrowserActivity");//浏览器 this.add("com.aoleyun.browser.BrowserActivity");//浏览器
this.add("com.aoleyun.sn.activity.SplashActivity");// this.add("com.aoleyun.sn.activity.SplashActivity");//
@@ -244,14 +243,17 @@ public class IconCache extends BaseIconCache {
this.add("com.android.contacts.activities.PeopleActivity");//通讯录 this.add("com.android.contacts.activities.PeopleActivity");//通讯录
this.add("com.android.deskclock.DeskClock");//时钟 this.add("com.android.deskclock.DeskClock");//时钟
this.add("com.android.dialer.DialtactsActivity");//电话 this.add("com.android.dialer.DialtactsActivity");//电话
this.add("com.android.dialer.app.DialtactsActivity");//电话
this.add("com.android.dialer.main.impl.MainActivity");//电话 this.add("com.android.dialer.main.impl.MainActivity");//电话
this.add("com.android.gallery3d.v2.app.GalleryActivity2");//图库 this.add("com.android.gallery3d.v2.app.GalleryActivity2");//图库
this.add("com.android.gallery3d.app.GalleryActivity");//图库
this.add("com.android.messaging.ui.conversationlist.ConversationListActivity");//信息 this.add("com.android.messaging.ui.conversationlist.ConversationListActivity");//信息
this.add("com.android.music.MusicBrowserActivity");//音乐 this.add("com.android.music.MusicBrowserActivity");//音乐
this.add("com.android.providers.downloads.ui.DownloadList");//下载 this.add("com.android.providers.downloads.ui.DownloadList");//下载
this.add("com.android.quicksearchbox.SearchActivity");//搜索 this.add("com.android.quicksearchbox.SearchActivity");//搜索
this.add("com.android.settings.Settings");//设置 this.add("com.android.settings.Settings");//设置
this.add("com.sprd.soundrecorder.RecorderActivity");//录音机 this.add("com.sprd.soundrecorder.RecorderActivity");//录音机
this.add("com.android.soundrecorder.SoundRecorder");//录音机
this.add("com.android.stk.StkMain");//sim卡 this.add("com.android.stk.StkMain");//sim卡
this.add("com.sprd.gallery3d.app.NewVideoActivity");//视频 this.add("com.sprd.gallery3d.app.NewVideoActivity");//视频
this.add("com.mediatek.filemanager.FileManagerOperationActivity");//文件管理 this.add("com.mediatek.filemanager.FileManagerOperationActivity");//文件管理
@@ -259,8 +261,7 @@ public class IconCache extends BaseIconCache {
this.add("com.mediatek.fmradio.FmRadioActivity");//收音机 this.add("com.mediatek.fmradio.FmRadioActivity");//收音机
this.add("com.android.fmradio.FmMainActivity");//收音机 this.add("com.android.fmradio.FmMainActivity");//收音机
this.add("com.android.email.activity.Welcome");//电子邮件 this.add("com.android.email.activity.Welcome");//电子邮件
} }};
};
private List<String> appIconList = new ArrayList<String>() {{ private List<String> appIconList = new ArrayList<String>() {{
this.add("com_android_appstore"); this.add("com_android_appstore");
this.add("com_android_browser"); this.add("com_android_browser");
@@ -274,6 +275,8 @@ public class IconCache extends BaseIconCache {
this.add("com_android_deskclock"); this.add("com_android_deskclock");
this.add("com_android_dialer"); this.add("com_android_dialer");
this.add("com_android_dialer"); this.add("com_android_dialer");
this.add("com_android_dialer");
this.add("com_android_gallery3d_app");
this.add("com_android_gallery3d_app"); this.add("com_android_gallery3d_app");
this.add("com_android_mms_ui"); this.add("com_android_mms_ui");
this.add("com_android_music"); this.add("com_android_music");
@@ -281,6 +284,7 @@ public class IconCache extends BaseIconCache {
this.add("com_android_quicksearchbox"); this.add("com_android_quicksearchbox");
this.add("com_android_settings"); this.add("com_android_settings");
this.add("com_android_soundrecorder"); this.add("com_android_soundrecorder");
this.add("com_android_soundrecorder");
this.add("com_android_stk_stkmain"); this.add("com_android_stk_stkmain");
this.add("com_android_vdieo"); this.add("com_android_vdieo");
this.add("com_mediatek_filemanager"); this.add("com_mediatek_filemanager");

View File

@@ -28,10 +28,19 @@ public class JGYUtils {
private static JGYUtils sInstance; private static JGYUtils sInstance;
private Context mContext; private Context mContext;
private ContentResolver mResolver; private ContentResolver mResolver;
public static int MTKPlatform = 1;
public static int ZhanruiPlatform = 2;
public static int UnknowPlatform = 0; public static int UnknowPlatform = 0;
public static int MTKPlatform = 1;
// TODO: 2022/4/23 标签替换未完成
public static int CubePlatform = 2;
public static int ZhanruiPlatform = 3;
public static String Other = "其他";
public static String MTKTag = "MTK"; public static String MTKTag = "MTK";
// TODO: 2022/4/23 标签替换未完成
public static String CubeTag = "展锐cube";
public static String ZhanruiTag = "展锐"; public static String ZhanruiTag = "展锐";
@@ -56,6 +65,74 @@ public class JGYUtils {
return sInstance; return sInstance;
} }
public int checkSNPlatform(String sn) {
String secondChars = sn.substring(1, 2);
if ("N".equalsIgnoreCase(secondChars)) {//MTK平台
return MTKPlatform;
} else if ("R".equalsIgnoreCase(secondChars)) {//展锐平台
return ZhanruiPlatform;
} else {
Log.e(TAG, "checkSNPlatform: " + "sn: " + sn + "没有对应平台");
return UnknowPlatform;
}
}
public int checkAppPlatform() {
String platform = BuildConfig.platform;
if ("MTK".equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "MTK平台");
return MTKPlatform;
} else if ("ZhanRui".equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "展锐平台");
return ZhanruiPlatform;
} else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "酷比平台");
return CubePlatform;
} else {
Log.i(TAG, "checkAppPlatform: " + "没有数据");
return UnknowPlatform;
}
}
public boolean isSamePlatform(String platform) {
String AppPlatform = BuildConfig.platform;
if ("ZhanRui".equals(AppPlatform)) {
return ZhanruiTag.equals(platform);
} else {
return AppPlatform.equals(platform);
}
}
public interface GetAppPlatformCallback {
void AppPlatform(int platform);
}
public void getAppPlatform(GetAppPlatformCallback getAppPlatformCallback) {
String platform = BuildConfig.platform;
if ("MTK".equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(MTKPlatform);
} else if ("ZhanRui".equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(ZhanruiPlatform);
} else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(CubePlatform);
} else {
getAppPlatformCallback.AppPlatform(UnknowPlatform);
}
}
public String getAppPlatform() {
String platform = BuildConfig.platform;
if ("MTK".equalsIgnoreCase(platform)) {
return MTKTag;
} else if ("ZhanRui".equalsIgnoreCase(platform)) {
return ZhanruiTag;
} else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
return CubeTag;
} else {
return Other;
}
}
public static boolean isOfficialVersion() { public static boolean isOfficialVersion() {
String channelValue = JGYUtils.getInstance().getStringMetaData(); String channelValue = JGYUtils.getInstance().getStringMetaData();
return "official".equals(channelValue); return "official".equals(channelValue);
@@ -88,56 +165,6 @@ public class JGYUtils {
return value; return value;
} }
public int checkSNPlatform(String sn) {
String secondChars = sn.substring(1, 2);
if ("N".equalsIgnoreCase(secondChars)) {//MTK平台
return MTKPlatform;
} else if ("R".equalsIgnoreCase(secondChars)) {//展锐平台
return ZhanruiPlatform;
} else {
Log.e(TAG, "checkSNPlatform: " + "sn: " + sn + "没有对应平台");
return UnknowPlatform;
}
}
public int checkAppPlatform() {
String platform = BuildConfig.platform;
if ("MTK".equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "MTK平台");
return MTKPlatform;
} else if ("ZhanRui".equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "展锐平台");
return ZhanruiPlatform;
} else {
Log.i(TAG, "checkAppPlatform: " + "没有数据");
return UnknowPlatform;
}
}
public boolean isSamePlatform(String platform) {
String AppPlatform = BuildConfig.platform;
if ("ZhanRui".equals(AppPlatform)) {
return ZhanruiTag.equals(platform);
} else {
return AppPlatform.equals(platform);
}
}
public interface GetAppPlatformCallback {
void AppPlatform(int platform);
}
public void getAppPlatform(GetAppPlatformCallback getAppPlatformCallback) {
String platform = BuildConfig.platform;
if ("MTK".equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(MTKPlatform);
} else if ("ZhanRui".equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(ZhanruiPlatform);
} else {
getAppPlatformCallback.AppPlatform(UnknowPlatform);
}
}
public static String getCustomVersion() { public static String getCustomVersion() {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) { if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) {
return getProperty("ro.build.display.id", "获取失败"); return getProperty("ro.build.display.id", "获取失败");

BIN
src/doc/xueshibaoos.jks Normal file

Binary file not shown.

View File

@@ -23,6 +23,7 @@ import android.content.pm.LauncherApps.ShortcutQuery;
import android.content.pm.ShortcutInfo; import android.content.pm.ShortcutInfo;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.UserHandle; import android.os.UserHandle;
import android.util.Log; import android.util.Log;
@@ -30,6 +31,7 @@ import android.util.Log;
import com.aoleyun.os.ItemInfo; import com.aoleyun.os.ItemInfo;
import com.aoleyun.os.LauncherSettings; import com.aoleyun.os.LauncherSettings;
import com.aoleyun.os.WorkspaceItemInfo; import com.aoleyun.os.WorkspaceItemInfo;
import com.aoleyun.os.uiuiutils.JGYUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@@ -199,6 +201,9 @@ public class DeepShortcutManager {
q.setShortcutIds(shortcutIds); q.setShortcutIds(shortcutIds);
} }
List<ShortcutInfo> shortcutInfos = null; List<ShortcutInfo> shortcutInfos = null;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
return Collections.EMPTY_LIST;
}
try { try {
shortcutInfos = mLauncherApps.getShortcuts(q, user); shortcutInfos = mLauncherApps.getShortcuts(q, user);
mWasLastCallSuccess = true; mWasLastCallSuccess = true;