Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e6e89b38a | ||
|
|
cad2e9df9d |
No files matched your search
@@ -260,6 +260,14 @@
|
||||
android:exported="true"
|
||||
/>
|
||||
|
||||
<provider
|
||||
android:name="rikka.shizuku.ShizukuProvider"
|
||||
android:authorities="${applicationId}.shizuku"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:multiprocess="false"
|
||||
android:permission="android.permission.INTERACT_ACROSS_USERS_FULL" />
|
||||
|
||||
<service android:name=".MyAccessibilityService"
|
||||
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
|
||||
<intent-filter>
|
||||
|
||||
@@ -253,13 +253,20 @@
|
||||
android:value="@integer/google_play_services_version" />
|
||||
<service android:name=".location.GeofenceIntentService"/>
|
||||
|
||||
|
||||
<provider
|
||||
android:name=".FileShareProvider"
|
||||
android:authorities="com.jens.automation2"
|
||||
android:exported="true"
|
||||
/>
|
||||
|
||||
<provider
|
||||
android:name="rikka.shizuku.ShizukuProvider"
|
||||
android:authorities="${applicationId}.shizuku"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:multiprocess="false"
|
||||
android:permission="android.permission.INTERACT_ACROSS_USERS_FULL" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -39,6 +39,8 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import rikka.shizuku.Shizuku;
|
||||
|
||||
public class ActivityPermissions extends Activity
|
||||
{
|
||||
static Map<String, String> mapGeneralPermissions = null;
|
||||
@@ -58,6 +60,7 @@ public class ActivityPermissions extends Activity
|
||||
private static final int requestCodeForPermissionsManageOverlay = 12050;
|
||||
private static final int requestCodeForPermissionsAccessibility = 12051;
|
||||
private static final int requestCodeForPermissionsScheduleExactAlarms = 12052;
|
||||
private static final int requestCodeForPermissionsShizuku = 12053;
|
||||
protected String[] specificPermissionsToRequest = null;
|
||||
|
||||
public static String intentExtraName = "permissionsToBeRequested";
|
||||
@@ -70,6 +73,7 @@ public class ActivityPermissions extends Activity
|
||||
public final static String permissionNameGoogleActivityDetection = "com.google.android.gms.permission.ACTIVITY_RECOGNITION";
|
||||
public final static String permissionNameSuperuser = "android.permission.ACCESS_SUPERUSER";
|
||||
public final static String permissionNameProximity = "android.hardware.sensor.proximity";
|
||||
public final static String permissionNameShizuku = "android_permission_shizuku";
|
||||
|
||||
public static ActivityPermissions getInstance()
|
||||
{
|
||||
@@ -273,6 +277,11 @@ public class ActivityPermissions extends Activity
|
||||
if (!havePermission(s, context))
|
||||
return true;
|
||||
}
|
||||
else if(s.equalsIgnoreCase(permissionNameShizuku))
|
||||
{
|
||||
if(!ShizukuAccess.isAuthorized())
|
||||
return true;
|
||||
}
|
||||
else if (!havePermission(s, context))
|
||||
return true;
|
||||
}
|
||||
@@ -529,6 +538,7 @@ public class ActivityPermissions extends Activity
|
||||
|
||||
if (rule.isRuleActive())
|
||||
{
|
||||
addToArrayListUnique(permissionNameShizuku, requiredPermissions);
|
||||
for (Trigger trigger : rule.getTriggerSet())
|
||||
{
|
||||
switch (trigger.getTriggerType())
|
||||
@@ -1390,6 +1400,11 @@ public class ActivityPermissions extends Activity
|
||||
Linkify.addLinks((TextView) diaglog.findViewById(android.R.id.message), Linkify.ALL);
|
||||
// return;
|
||||
}
|
||||
else if(s.equals(permissionNameShizuku))
|
||||
{
|
||||
ShizukuAccess.requestAuthorization();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1909,4 +1924,34 @@ public class ActivityPermissions extends Activity
|
||||
// have all
|
||||
setHaveAllPermissions();
|
||||
}
|
||||
|
||||
public final static class ShizukuAccess
|
||||
{
|
||||
private ShizukuAccess()
|
||||
{
|
||||
}
|
||||
|
||||
public static boolean isAvailable()
|
||||
{
|
||||
return !Shizuku.isPreV11() && Shizuku.pingBinder();
|
||||
}
|
||||
|
||||
public static boolean isAuthorized()
|
||||
{
|
||||
return isAvailable() && Shizuku.checkSelfPermission() == PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
public static void requestAuthorization()
|
||||
{
|
||||
if (!isAvailable())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Shizuku.checkSelfPermission() != PackageManager.PERMISSION_GRANTED)
|
||||
{
|
||||
Shizuku.requestPermission(requestCodeForPermissionsShizuku);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -979,4 +979,5 @@
|
||||
<string name="examplesWriteSecureSettings">I do not keep a list of possible settings. Please find those settings on your own. See <a href="https://developer.android.com/reference/android/provider/Settings.Secure">here</a> for some (incomplete) examples.</string>
|
||||
<string name="httpParametersExplanation">If any parameter name starts with %1$s while method is POST, it will not be transmitted like the other parameters (with key=value), but transferred as main data. If the parameter ends with %2$s, no encoding will be performed.</string>
|
||||
<string name="target">Target</string>
|
||||
<string name="android_permission_shizuku" translatable="false">Shizuku</string>
|
||||
</resources>
|
||||
Reference in new issue
Block a user