mirror of
https://github.com/YTVanced/VancedMicroG
synced 2024-11-18 09:15:11 +00:00
Remove all permissions
This commit is contained in:
parent
4f2ac3224e
commit
0818eebfcb
5 changed files with 10 additions and 36 deletions
|
@ -46,16 +46,10 @@
|
|||
android:label="@string/perm_extended_access_label"
|
||||
android:protectionLevel="dangerous" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
|
||||
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package org.microg.gms.auth;
|
||||
|
||||
import android.Manifest;
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.content.ContentProvider;
|
||||
|
@ -63,8 +62,6 @@ public class AccountContentProvider extends ContentProvider {
|
|||
if (packagesForUid != null && packagesForUid.length != 0)
|
||||
Log.w(TAG, "Not granting extended access to " + Arrays.toString(packagesForUid)
|
||||
+ ", signature: " + PackageUtils.firstSignatureDigest(getContext(), packagesForUid[0]));
|
||||
if (getContext().checkCallingPermission(Manifest.permission.GET_ACCOUNTS) != PackageManager.PERMISSION_GRANTED)
|
||||
throw new SecurityException("Access denied, missing GET_ACCOUNTS or EXTENDED_ACCESS permission");
|
||||
}
|
||||
if (PROVIDER_METHOD_GET_ACCOUNTS.equals(method)) {
|
||||
Bundle result = new Bundle();
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package org.microg.gms.location;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.location.Location;
|
||||
|
@ -35,10 +34,7 @@ import org.microg.gms.common.Utils;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
|
||||
import static android.Manifest.permission.ACCESS_FINE_LOCATION;
|
||||
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
||||
import static android.location.LocationManager.GPS_PROVIDER;
|
||||
import static com.google.android.gms.location.LocationRequest.PRIORITY_HIGH_ACCURACY;
|
||||
|
||||
public class GoogleLocationManager implements LocationChangeListener {
|
||||
|
@ -52,12 +48,7 @@ public class GoogleLocationManager implements LocationChangeListener {
|
|||
|
||||
public GoogleLocationManager(Context context) {
|
||||
this.context = context;
|
||||
LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||
if (Utils.hasSelfPermissionOrNotify(context, Manifest.permission.ACCESS_FINE_LOCATION)) {
|
||||
this.gpsProvider = new RealLocationProvider(locationManager, GPS_PROVIDER, this);
|
||||
} else {
|
||||
this.gpsProvider = null;
|
||||
}
|
||||
this.gpsProvider = null;
|
||||
mockProvider = new MockLocationProvider(this);
|
||||
}
|
||||
|
||||
|
@ -89,11 +80,11 @@ public class GoogleLocationManager implements LocationChangeListener {
|
|||
}
|
||||
|
||||
private boolean hasCoarseLocationPermission() {
|
||||
return context.checkCallingPermission(ACCESS_COARSE_LOCATION) == PERMISSION_GRANTED || hasFineLocationPermission();
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean hasFineLocationPermission() {
|
||||
return context.checkCallingPermission(ACCESS_FINE_LOCATION) == PERMISSION_GRANTED;
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean hasMockLocationPermission() {
|
||||
|
@ -190,7 +181,7 @@ public class GoogleLocationManager implements LocationChangeListener {
|
|||
public void onLocationChanged() {
|
||||
for (int i = 0; i < currentRequests.size(); i++) {
|
||||
LocationRequestHelper request = currentRequests.get(i);
|
||||
if (!request.report(getLocation(request.initialHasFinePermission, request.initialHasCoarsePermission))) {
|
||||
if (!request.report(getLocation(false, false))) {
|
||||
removeLocationUpdates(request);
|
||||
i--;
|
||||
}
|
||||
|
|
|
@ -36,15 +36,10 @@ import com.google.android.gms.location.internal.LocationRequestUpdateData;
|
|||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
|
||||
import static android.Manifest.permission.ACCESS_FINE_LOCATION;
|
||||
|
||||
public class LocationRequestHelper {
|
||||
public static final String TAG = "GmsLocRequestHelper";
|
||||
private final Context context;
|
||||
public final LocationRequest locationRequest;
|
||||
public final boolean initialHasFinePermission;
|
||||
public final boolean initialHasCoarsePermission;
|
||||
public final String packageName;
|
||||
public final int uid;
|
||||
private final boolean selfHasAppOpsRights;
|
||||
|
@ -61,9 +56,6 @@ public class LocationRequestHelper {
|
|||
this.packageName = packageName;
|
||||
this.uid = uid;
|
||||
|
||||
this.initialHasFinePermission = context.getPackageManager().checkPermission(ACCESS_FINE_LOCATION, packageName) == PackageManager.PERMISSION_GRANTED;
|
||||
this.initialHasCoarsePermission = context.getPackageManager().checkPermission(ACCESS_COARSE_LOCATION, packageName) == PackageManager.PERMISSION_GRANTED;
|
||||
|
||||
this.selfHasAppOpsRights = context.getPackageManager().checkPermission("android.permission.UPDATE_APP_OPS_STATS", context.getPackageName()) == PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
|
@ -168,17 +160,17 @@ public class LocationRequestHelper {
|
|||
|
||||
public boolean hasFinePermission() {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
return isAppOpsAllowed(AppOpsManager.OPSTR_FINE_LOCATION, initialHasFinePermission);
|
||||
return isAppOpsAllowed(AppOpsManager.OPSTR_FINE_LOCATION, false);
|
||||
} else {
|
||||
return initialHasFinePermission;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasCoarsePermission() {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
return isAppOpsAllowed(AppOpsManager.OPSTR_COARSE_LOCATION, initialHasCoarsePermission);
|
||||
return isAppOpsAllowed(AppOpsManager.OPSTR_COARSE_LOCATION, false);
|
||||
} else {
|
||||
return initialHasCoarsePermission;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -62,8 +62,8 @@ import java.util.Arrays;
|
|||
* may fuse the results from several sources into a single Location object.
|
||||
* <p/>
|
||||
* Location requests from applications with
|
||||
* {@link android.Manifest.permission#ACCESS_COARSE_LOCATION} and not
|
||||
* {@link android.Manifest.permission#ACCESS_FINE_LOCATION} will be automatically throttled to a
|
||||
* ACCESS_COARSE_LOCATION and not
|
||||
* ACCESS_FINE_LOCATION will be automatically throttled to a
|
||||
* slower interval, and the location object will be obfuscated to only show a coarse level of
|
||||
* accuracy.
|
||||
* <p/>
|
||||
|
|
Loading…
Reference in a new issue