-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from lianglixin/functional
修复快捷方式的问题
- Loading branch information
Showing
9 changed files
with
279 additions
and
14 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":24,"versionName":"1.2.5","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] | ||
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":24,"versionName":"1.2.5","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,4 +51,5 @@ | |
<string name="about_info">"特别感谢甘!##SandVXP是一个应用程序,可以让用户在非Root和非引导加载程序解锁设备上使用Xposed模块。##将应用程序和模块添加或克隆到这个应用程序中,然后在菜单的“Xposed管理器”中启用它,应用和模块就可以工作了。##QQ 384550791##邮箱: [email protected]##网址https://www.fou.ink/ "</string> | ||
<string name="launch_failed">抱歉,启动失败。</string> | ||
<string name="sys_crash">应用程序发生异常,已被捕捉,请留意。</string> | ||
<string name="rom_shortcut_tips">检测到您的机型必须手动允许快捷方式的创建,请到系统设置->应用->权限管理,找到本应用,开启快捷方式权限。</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,4 +51,5 @@ | |
<string name="about_info">"特别感谢甘!##SandVXP是一个应用程序,可以让用户在非Root和非引导加载程序解锁设备上使用Xposed模块。##将应用程序和模块添加或克隆到这个应用程序中,然后在菜单的“Xposed管理器”中启用它,应用和模块就可以工作了。##QQ 384550791##邮箱: [email protected]##网址https://www.fou.ink/ "</string> | ||
<string name="launch_failed">Sorry,App无法启动。</string> | ||
<string name="sys_crash">应用程序异常,已经捕捉。</string> | ||
<string name="rom_shortcut_tips">检测到您的机型必须手动允许快捷方式的创建,请到系统设置->应用->权限管理,找到本应用,开启快捷方式权限。</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,4 +109,5 @@ | |
<string name="about_info">Special thanks for Gan!##SandVXP is a application that can let user use Xposed module on non-root and non-bootloader-unlock devices. Clone application into this app and xposed modules, then validate it in menu\'s xposed manager, and they will work.##QQ 384550791##E-Mail [email protected]##Website https://www.fou.ink/</string> | ||
<string name="launch_failed">Launch app failed...</string> | ||
<string name="sys_crash">Application may crash but catch by SKActivity.</string> | ||
<string name="rom_shortcut_tips">We detected your device must accept permission manual. Please allow shortcut ceration permission in system settings. Allow this in Settings -> App Management -> Permission Management -> this application -> allow shortcut permission.</string> | ||
</resources> |
197 changes: 197 additions & 0 deletions
197
lib/src/main/java/com/lody/virtual/client/core/RomChecker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
package com.lody.virtual.client.core; | ||
import android.os.Build; | ||
import android.text.TextUtils; | ||
import android.util.Log; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
|
||
public class RomChecker | ||
{ | ||
private static final String KEY_VERSION_EMUI = "ro.build.version.emui"; | ||
private static final String KEY_VERSION_MIUI = "ro.miui.ui.version.name"; | ||
private static final String KEY_VERSION_OPPO = "ro.build.version.opporom"; | ||
private static final String KEY_VERSION_SMARTISAN = "ro.smartisan.version"; | ||
private static final String KEY_VERSION_VIVO = "ro.vivo.os.version"; | ||
public static final String ROM_EMUI = "EMUI"; | ||
public static final String ROM_FLYME = "FLYME"; | ||
public static final String ROM_MIUI = "MIUI"; | ||
public static final String ROM_OPPO = "OPPO"; | ||
public static final String ROM_QIKU = "QIKU"; | ||
public static final String ROM_SMARTISAN = "SMARTISAN"; | ||
public static final String ROM_VIVO = "VIVO"; | ||
private static final String TAG = "Rom"; | ||
private static String sName; | ||
private static String sVersion; | ||
|
||
public static boolean check(String str) { | ||
if (sName != null) { | ||
return sName.equals(str); | ||
} | ||
CharSequence prop = getProp(KEY_VERSION_MIUI); | ||
sVersion = (String) prop; | ||
if (TextUtils.isEmpty(prop)) { | ||
prop = getProp(KEY_VERSION_EMUI); | ||
sVersion = (String) prop; | ||
if (TextUtils.isEmpty(prop)) { | ||
prop = getProp(KEY_VERSION_OPPO); | ||
sVersion = (String) prop; | ||
if (TextUtils.isEmpty(prop)) { | ||
prop = getProp(KEY_VERSION_VIVO); | ||
sVersion = (String) prop; | ||
if (TextUtils.isEmpty(prop)) { | ||
prop = getProp(KEY_VERSION_SMARTISAN); | ||
sVersion = (String) prop; | ||
if (TextUtils.isEmpty(prop)) { | ||
sVersion = Build.DISPLAY; | ||
if (sVersion.toUpperCase().contains(ROM_FLYME)) { | ||
sName = ROM_FLYME; | ||
} else { | ||
sName = Build.MANUFACTURER.toUpperCase(); | ||
} | ||
} else { | ||
sName = ROM_SMARTISAN; | ||
} | ||
} else { | ||
sName = ROM_VIVO; | ||
} | ||
} else { | ||
sName = ROM_OPPO; | ||
} | ||
} else { | ||
sName = ROM_EMUI; | ||
} | ||
} else { | ||
sName = ROM_MIUI; | ||
} | ||
return sName.equals(str); | ||
} | ||
|
||
public static String getName() { | ||
if (sName == null) { | ||
check(""); | ||
} | ||
return sName; | ||
} | ||
|
||
public static String getProp(String str) { | ||
BufferedReader bufferedReader; | ||
Throwable e; | ||
String str2; | ||
StringBuilder stringBuilder; | ||
Throwable th; | ||
BufferedReader bufferedReader2 = null; | ||
try { | ||
Runtime runtime = Runtime.getRuntime(); | ||
StringBuilder stringBuilder2 = new StringBuilder(); | ||
stringBuilder2.append("getprop "); | ||
stringBuilder2.append(str); | ||
bufferedReader = new BufferedReader(new InputStreamReader(runtime.exec(stringBuilder2.toString()).getInputStream()), 1024); | ||
try { | ||
String readLine = bufferedReader.readLine(); | ||
bufferedReader.close(); | ||
try { | ||
bufferedReader.close(); | ||
} catch (IOException e2) { | ||
e2.printStackTrace(); | ||
} | ||
return readLine; | ||
} catch (IOException e3) { | ||
e = e3; | ||
try { | ||
str2 = TAG; | ||
stringBuilder = new StringBuilder(); | ||
stringBuilder.append("Unable to read prop "); | ||
stringBuilder.append(str); | ||
Log.e(str2, stringBuilder.toString(), e); | ||
if (bufferedReader != null) { | ||
try { | ||
bufferedReader.close(); | ||
} catch (IOException e22) { | ||
e22.printStackTrace(); | ||
} | ||
} | ||
return null; | ||
} catch (Throwable th2) { | ||
th = th2; | ||
bufferedReader2 = bufferedReader; | ||
if (bufferedReader2 != null) { | ||
try { | ||
bufferedReader2.close(); | ||
} catch (IOException e4) { | ||
e4.printStackTrace(); | ||
} | ||
} | ||
throw th; | ||
} | ||
} | ||
} catch (IOException e5) { | ||
e = e5; | ||
bufferedReader = null; | ||
str2 = TAG; | ||
stringBuilder = new StringBuilder(); | ||
stringBuilder.append("Unable to read prop "); | ||
stringBuilder.append(str); | ||
Log.e(str2, stringBuilder.toString(), e); | ||
if (bufferedReader != null) { | ||
try { | ||
bufferedReader.close(); | ||
} catch (IOException e1) { | ||
e1.printStackTrace(); | ||
} | ||
} | ||
return null; | ||
} catch (Throwable th3) { | ||
th = th3; | ||
if (bufferedReader2 != null) { | ||
try { | ||
bufferedReader2.close(); | ||
} catch (IOException e1) { | ||
e1.printStackTrace(); | ||
} | ||
} | ||
return null; | ||
} | ||
} | ||
|
||
public static String getVersion() { | ||
if (sVersion == null) { | ||
check(""); | ||
} | ||
return sVersion; | ||
} | ||
|
||
public static boolean is360() { | ||
if (!check(ROM_QIKU)) { | ||
if (!check("360")) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
public static boolean isEmui() { | ||
return check(ROM_EMUI); | ||
} | ||
|
||
public static boolean isFlyme() { | ||
return check(ROM_FLYME); | ||
} | ||
|
||
public static boolean isMiui() { | ||
return check(ROM_MIUI); | ||
} | ||
|
||
public static boolean isOppo() { | ||
return check(ROM_OPPO); | ||
} | ||
|
||
public static boolean isSmartisan() { | ||
return check(ROM_SMARTISAN); | ||
} | ||
|
||
public static boolean isVivo() { | ||
return check(ROM_VIVO); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters