Skip to content

Commit

Permalink
Merge branch 'vpn_ttl_fixer'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gedsh committed Feb 18, 2020
2 parents df29ca2 + 4350037 commit bf7cf94
Show file tree
Hide file tree
Showing 15 changed files with 371 additions and 166 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,6 @@
**InviZible Pro beta 0.6.3**
* Implemented Fix TTL option based on the local VPN (root is still required).
* Fixes.

**InviZible Pro beta 0.6.4**
* Bug fixes and stability improvements.
2 changes: 2 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/100064.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**InviZible Pro beta 0.6.4**
* Bug fixes and stability improvements.
4 changes: 2 additions & 2 deletions tordnscrypt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {

fdroid{
applicationId "pan.alexander.tordnscrypt"
versionName "0.6.3-beta"
versionName "0.6.4-beta"
dimension = 'version'
resValue 'string', 'package_name', applicationId
}
Expand Down Expand Up @@ -40,7 +40,7 @@ android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 29
versionCode 63
versionCode 64

resConfigs "en", "ru-rRU" , "ru-rUA", "pl"

Expand Down
4 changes: 2 additions & 2 deletions tordnscrypt/owner.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {

beta {
applicationId "pan.alexander.tordnscrypt"
versionName "0.6.3"
versionName "0.6.4"
dimension = 'version'
signingConfig signingConfigs.betasign
resValue 'string', 'package_name', applicationId
Expand Down Expand Up @@ -86,7 +86,7 @@ android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 29
versionCode 63
versionCode 64

resConfigs "en", "ru-rRU", "ru-rUA", "pl"

Expand Down
3 changes: 0 additions & 3 deletions tordnscrypt/src/google_play/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,8 @@
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="android.intent.action.REBOOT" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>

Expand Down
3 changes: 0 additions & 3 deletions tordnscrypt/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,8 @@
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="android.intent.action.REBOOT" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public class BootCompleteReceiver extends BroadcastReceiver {
@Override
public void onReceive(final Context context, Intent intent) {

Log.i(LOG_TAG, "Receive Boot Completed");

final String BOOT_COMPLETE = "android.intent.action.BOOT_COMPLETED";
this.context = context.getApplicationContext();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ public void startButtonOnClick(Context context) {

view.setDNSCryptStartButtonEnabled(false);

cleanLogFileNoRootMethod(context);
//cleanLogFileNoRootMethod(context);


if (new PrefManager(context).getBoolPref("Tor Running")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public void startButtonOnClick(Context context) {

view.setITPDStartButtonEnabled(false);

cleanLogFileNoRootMethod();
//cleanLogFileNoRootMethod();

if (!new PrefManager(Objects.requireNonNull(context)).getBoolPref("I2PD Running")
&& new PrefManager(Objects.requireNonNull(context)).getBoolPref("Tor Running")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,30 +62,36 @@ public class ModulesBroadcastReceiver extends BroadcastReceiver {
private int currentNetworkHash = 0;
private static final String apStateFilterAction = "android.net.wifi.WIFI_AP_STATE_CHANGED";
private static final String tetherStateFilterAction = "android.net.conn.TETHER_STATE_CHANGED";
private static final String shutdownFilterAction = "android.intent.action.ACTION_SHUTDOWN";
private static final String powerOFFFilterAction = "android.intent.action.QUICKBOOT_POWEROFF";

public ModulesBroadcastReceiver(Context context) {
this.context = context;
}

@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction() == null) {
String action = intent.getAction();

if (action == null) {
return;
}

if (intent.getAction().equals(PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED)
if (action.equalsIgnoreCase(PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED)
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {

Log.i(LOG_TAG, "ModulesBroadcastReceiver Received " + intent);

idleStateChanged(context);

} else if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
} else if (action.equalsIgnoreCase(ConnectivityManager.CONNECTIVITY_ACTION)) {
connectivityStateChanged(intent);
} else if (intent.getAction().equals(apStateFilterAction)) {
} else if (action.equalsIgnoreCase(apStateFilterAction)) {
apStateChanged();
} else if (intent.getAction().equals(tetherStateFilterAction)) {
} else if (action.equalsIgnoreCase(tetherStateFilterAction)) {
tetherStateChanged();
} else if (action.equalsIgnoreCase(powerOFFFilterAction) || action.equalsIgnoreCase(shutdownFilterAction)) {
powerOFFDetected();
}
}

Expand All @@ -94,6 +100,7 @@ void registerReceivers() {
registerConnectivityChanges();
registerAPisOn();
registerUSBModemIsOn();
registerPowerOFF();
}

void unregisterReceivers() {
Expand Down Expand Up @@ -148,6 +155,14 @@ private void registerUSBModemIsOn() {
receiverRegistered = true;
}

private void registerPowerOFF() {
IntentFilter powerOFF = new IntentFilter();
powerOFF.addAction(shutdownFilterAction);
powerOFF.addAction(powerOFFFilterAction);
context.registerReceiver(this, powerOFF);
receiverRegistered = true;
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void listenNetworkChanges() {
// Listen for network changes
Expand Down Expand Up @@ -281,6 +296,14 @@ private void tetherStateChanged() {
Log.i(LOG_TAG, "ModulesBroadcastReceiver USB modem state is " + (Tethering.usbTetherOn ? "ON" : "OFF"));
}

private void powerOFFDetected() {
new PrefManager(context).setBoolPref("DNSCrypt Running", false);
new PrefManager(context).setBoolPref("Tor Running", false);
new PrefManager(context).setBoolPref("I2PD Running", false);

ModulesAux.stopModulesIfRunning(context);
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void unlistenNetworkChanges() {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
Expand Down
Loading

0 comments on commit bf7cf94

Please sign in to comment.