0
0
mirror of https://github.com/schwabe/ics-openvpn.git synced 2024-09-20 03:52:27 +02:00

Add Strictmode to remoteExample

This commit is contained in:
Arne Schwabe 2021-10-04 16:54:02 +02:00
parent bcb6673af6
commit 609fd8e292
2 changed files with 31 additions and 1 deletions

View File

@ -11,7 +11,8 @@
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:name=".RemoteExampleApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >

View File

@ -0,0 +1,29 @@
/*
* Copyright (c) 2012-2021 Arne Schwabe
* Distributed under the GNU GPL v2 with additional terms. For full terms see the file doc/LICENSE.txt
*/
package de.blinkt.openvpn.remote;
import android.app.Application;
import android.os.Build;
import android.os.StrictMode;
public class RemoteExampleApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
if (BuildConfig.BUILD_TYPE.equals("debug"))
enableStrictModes();
}
private void enableStrictModes() {
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder()
.detectAll()
.penaltyLog();
//builder.penaltyDeath();
StrictMode.VmPolicy policy = builder.build();
StrictMode.setVmPolicy(policy);
}
}