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

@@ -585,6 +585,9 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
// }
public void setRoleHolderAsUser(Context context, String packageName) {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {
return;
}
String roleName = "android.app.role.HOME";
boolean add = true;
int flags = 0;
@@ -593,21 +596,24 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
Log.i("settingssssssstemf", (add ? "Adding" : "Removing") + " package as role holder, role: "
+ roleName + ", package: " + packageName);
RoleManager roleManager = context.getSystemService(RoleManager.class);
Executor executor = context.getMainExecutor();
Consumer<Boolean> callback = successful -> {
if (successful) {
Log.d("settingssssssstemf", "Package " + (add ? "added" : "removed")
+ " as role holder, role: " + roleName + ", package: " + packageName);
} else {
Log.d("settingssssssstemf", "Failed to " + (add ? "add" : "remove")
+ " package as role holder, role: " + roleName + ", package: "
+ packageName);
}
};
if (JGYUtils.getInstance().checkAppPlatform() != JGYUtils.MTKPlatform) {
RoleManager roleManager = context.getSystemService(RoleManager.class);
Executor executor = context.getMainExecutor();
Consumer<Boolean> callback = successful -> {
if (successful) {
Log.d("settingssssssstemf", "Package " + (add ? "added" : "removed")
+ " as role holder, role: " + roleName + ", package: " + packageName);
} else {
Log.d("settingssssssstemf", "Failed to " + (add ? "add" : "remove")
+ " package as role holder, role: " + roleName + ", package: "
+ packageName);
}
};
roleManager.addRoleHolderAsUser(roleName, packageName, flags, user, executor, callback);
Log.i("settingssssssstemf", "addRoleHolderAsUser done");
}
roleManager.addRoleHolderAsUser(roleName, packageName, flags, user, executor, callback);
Log.i("settingssssssstemf", "addRoleHolderAsUser done");
}
private TimeChangedReceiver mTimeChangedReceiver;
@@ -1403,7 +1409,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
}
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 url = result.getUrl();
PackageInfo info = null;
@@ -1412,7 +1418,13 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
} catch (PackageManager.NameNotFoundException e) {
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)
.load(url)
.setExtendField(result.toString())

View File

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

View File

@@ -28,10 +28,19 @@ public class JGYUtils {
private static JGYUtils sInstance;
private Context mContext;
private ContentResolver mResolver;
public static int MTKPlatform = 1;
public static int ZhanruiPlatform = 2;
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";
// TODO: 2022/4/23 标签替换未完成
public static String CubeTag = "展锐cube";
public static String ZhanruiTag = "展锐";
@@ -56,6 +65,74 @@ public class JGYUtils {
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() {
String channelValue = JGYUtils.getInstance().getStringMetaData();
return "official".equals(channelValue);
@@ -88,56 +165,6 @@ public class JGYUtils {
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() {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) {
return getProperty("ro.build.display.id", "获取失败");

BIN
src/doc/xueshibaoos.jks Normal file

Binary file not shown.