Skip to content

Commit

Permalink
Merge pull request #15 from Steve2Go/Whitelist-play-store
Browse files Browse the repository at this point in the history
Whitelist play store
  • Loading branch information
x-falcon committed Jan 10, 2018
2 parents 99ea49f + 692ea8d commit d82c1e9
Showing 1 changed file with 13 additions and 0 deletions.
Expand Up @@ -21,9 +21,11 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.net.VpnService;
import android.os.Build;
import android.os.ParcelFileDescriptor;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
Expand Down Expand Up @@ -120,13 +122,24 @@ public void run() {
private void setupVPN() {
if (vpnInterface == null) {
Builder builder = new Builder();

try {
builder.addDisallowedApplication("com.android.vending"); //white list play store
builder.addDisallowedApplication("com.google.android.apps.docs"); //white list google drive
builder.addDisallowedApplication("com.google.android.apps.photos"); //white list google photos
builder.addDisallowedApplication("com.google.android.gm"); //white list gmail
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}

builder.addAddress(VPN_ADDRESS, 32);
builder.addRoute(VPN_ROUTE, 0);
VPN_DNS=getString(R.string.dns_server);
Log.d(TAG,"use dns:"+VPN_DNS);
builder.addRoute(VPN_DNS, 32);
builder.addDnsServer(VPN_DNS);
vpnInterface = builder.setSession(getString(R.string.app_name)).setConfigureIntent(pendingIntent).establish();

}
}

Expand Down

0 comments on commit d82c1e9

Please sign in to comment.