Fábio Filho
Fábio Filho

Reputation: 121

Toggle gps on root android devices

There is an old question about it (Toggle gps on root devices on Android)....

I really need enable GPS using a su command without any notification ... My code is above:

public static void turnOnGPS(){

    try {
        String mCommand = "adb shell settings put secure location_providers_allowed gps,network,wifi ";
        Shell.runAsRoot(mCommand);
        Utilities.log("GPS Actioned.");

    }catch (Exception o){
        Utilities.log(o.toString());
    }
}

Upvotes: 0

Views: 1021

Answers (2)

Dayvon
Dayvon

Reputation: 97

Uncheck show notifications from su Settings tab

Upvotes: 1

Fábio Filho
Fábio Filho

Reputation: 121

I found the solution..... I did the following:

  1. I rooted my device
  2. I installed my app as system app, it's simple, just copy your apk into /system/priv-app/myApk.apk and set chmod 644 permissions. If you have a doubt, check this post (If i set my android app to a system app, after a factory reset, will it be removed from the phone?).
  3. I just removed the /system/app/SuperSU folder
  4. I did a factory reset on device, and that is it ..... =D

Upvotes: 0

Related Questions