Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
czy1121 committed Dec 26, 2016
1 parent 601dbba commit 44d27f9
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 24 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ API 23+ 本来去系统设置面板就好了,但有些Rom会用自带的权限
|魅族 MX4|5.1|5.1.5|默认禁用|ok|
|魅族 魅蓝Note2|5.1|5.1.5|默认禁用|ok|
|魅族 M1|4.4.4|4.2.1|默认可用|ok<br>悬浮窗不能覆盖到其它应用上<br>详情页有悬浮窗权限设置,禁用后无影响|
|锤子 坚果|5.1.1|2.5.3|默认禁用|fail,到达悬浮窗管理页,但随后奔溃|
|锤子 坚果|5.1.1|2.5.3|默认禁用|ok|
|锤子 坚果|4.4.4|2.1.2|默认禁用|ok|
|OPPO A53|5.1.1|2.1|默认可用|ok|
|OPPO R7s|4.4.4|2.1|默认可用|ok|
Expand Down Expand Up @@ -95,7 +95,7 @@ repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.czy1121:settingscompat:1.1.2'
compile 'com.github.czy1121:settingscompat:1.1.3'
}
```

Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ allprojects {
mavenCentral()
mavenLocal()
}

}


Expand Down
4 changes: 3 additions & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

group='com.github.czy1121'
version='1.1.2'
version='1.1.3'
archivesBaseName='settingscompat'

android {
Expand All @@ -29,6 +29,8 @@ android {
}




dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.0.0'
Expand Down
19 changes: 11 additions & 8 deletions library/library.iml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
Expand All @@ -83,6 +75,15 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/docs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotations" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
Expand All @@ -103,6 +104,8 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/typedefs.txt" />
<excludeFolder url="file://$MODULE_DIR$/build/ivy.xml" />
<excludeFolder url="file://$MODULE_DIR$/build/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
Expand Down
4 changes: 3 additions & 1 deletion library/src/main/java/ezy/assist/compat/RomUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class RomUtil {
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";
private static final String KEY_VERSION_GIONEE = "ro.gn.sv.version";
private static final String KEY_VERSION_LENOVO = "ro.lenovo.lvp.version";
private static final String KEY_VERSION_FLYME = "ro.build.display.id";


Expand Down Expand Up @@ -134,7 +136,7 @@ public static String getProp(String name) {
try {
input.close();
} catch (IOException e) {
Log.e(TAG, "Exception while closing InputStream", e);
e.printStackTrace();
}
}
}
Expand Down
27 changes: 15 additions & 12 deletions library/src/main/java/ezy/assist/compat/SettingsCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,18 +251,21 @@ private static boolean manageDrawOverlaysForSmartisan(Context context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
return false;
}
// 锤子 坚果|4.4.4|2.1.2
Intent intent = new Intent("com.smartisanos.security.action.SWITCHED_PERMISSIONS");
intent.setClassName("com.smartisanos.security", "com.smartisanos.security.SwitchedPermissions");
intent.putExtra("permission", new String[]{Manifest.permission.SYSTEM_ALERT_WINDOW});

// 锤子 坚果|5.1.1|2.5.3
// Intent intent = new Intent("com.smartisanos.security.action.SWITCHED_PERMISSIONS_NEW");
// intent.setClassName("com.smartisanos.security", "com.smartisanos.security.SwitchedPermissions");
// intent.putExtra("index", 17);// 不同版本会不一样
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// 锤子 坚果|5.1.1|2.5.3
Intent intent = new Intent("com.smartisanos.security.action.SWITCHED_PERMISSIONS_NEW");
intent.setClassName("com.smartisanos.security", "com.smartisanos.security.SwitchedPermissions");
intent.putExtra("index", 17); // 不同版本会不一样
return startSafely(context, intent);
} else {
// 锤子 坚果|4.4.4|2.1.2
Intent intent = new Intent("com.smartisanos.security.action.SWITCHED_PERMISSIONS");
intent.setClassName("com.smartisanos.security", "com.smartisanos.security.SwitchedPermissions");
intent.putExtra("permission", new String[]{Manifest.permission.SYSTEM_ALERT_WINDOW});

// Intent intent = new Intent("com.smartisanos.security.action.MAIN");
// intent.setClassName("com.smartisanos.security", "com.smartisanos.security.MainActivity");
return startSafely(context, intent);
// Intent intent = new Intent("com.smartisanos.security.action.MAIN");
// intent.setClassName("com.smartisanos.security", "com.smartisanos.security.MainActivity");
return startSafely(context, intent);
}
}
}

0 comments on commit 44d27f9

Please sign in to comment.