diff --git a/src/org/lineageos/updater/misc/Utils.java b/src/org/lineageos/updater/misc/Utils.java index 3ed81f42e4c46f07192c2d4d34d3057919ad99f1..497b635fa0584a9e1b06e82a28548a79d45c0097 100644 --- a/src/org/lineageos/updater/misc/Utils.java +++ b/src/org/lineageos/updater/misc/Utils.java @@ -34,6 +34,7 @@ import android.os.Environment; import android.os.StatFs; import android.os.SystemProperties; import android.os.storage.StorageManager; +import android.provider.Settings; import android.util.Log; import android.widget.Toast; @@ -221,7 +222,7 @@ public class Utils { String serverUrl = ""; if (retrieveStatus(context) != null) { - if (retrieveStatus(context).equals("true")) { + if (retrieveStatus(context).equals("true") && isDevModeOn(context)) { serverUrl = context.getString(R.string.ota_staging_server_url); return serverUrl.replace("{device}", device) .replace("{type}", type) @@ -458,6 +459,11 @@ public class Utils { return isAB; } + public static boolean isDevModeOn(Context context) { + return Settings.Secure.getInt(context.getContentResolver(), + Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0) == 1; + } + public static boolean hasTouchscreen(Context context) { return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN); }