1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-30 20:05:04 +00:00

Remove speed graph for Play store installs

This commit is contained in:
M66B 2015-12-14 16:13:30 +01:00
parent e1bb6536df
commit 3a87823c8c
3 changed files with 8 additions and 1 deletions

View file

@ -130,6 +130,9 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
pref_stats_base.setTitle(getString(R.string.setting_stats_base, prefs.getString("stats_base", "5")));
pref_stats_frequency.setTitle(getString(R.string.setting_stats_frequency, prefs.getString("stats_frequency", "1000")));
pref_stats_samples.setTitle(getString(R.string.setting_stats_samples, prefs.getString("stats_samples", "90")));
PreferenceCategory stats = (PreferenceCategory) screen.findPreference("category_stats");
if (Util.isPlayStoreInstall(this))
screen.removePreference(stats);
// Handle export
Preference pref_export = screen.findPreference("export");

View file

@ -269,7 +269,7 @@ public class SinkholeService extends VpnService {
private void startStats() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SinkholeService.this);
boolean enabled = (!stats && prefs.getBoolean("show_stats", false));
boolean enabled = (!stats && prefs.getBoolean("show_stats", false) && !Util.isPlayStoreInstall(SinkholeService.this));
Log.i(TAG, "Stats start enabled=" + enabled);
if (enabled) {
t = -1;

View file

@ -281,6 +281,10 @@ public class Util {
return ((context.getApplicationContext().getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0);
}
public static boolean isPlayStoreInstall(Context context) {
return "com.android.vending".equals(context.getPackageManager().getInstallerPackageName(context.getPackageName()));
}
public static boolean hasValidFingerprint(Context context) {
try {
PackageManager pm = context.getPackageManager();