Skip to content

Commit

Permalink
Merge branch 'v055' into headless_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
hussainmohd-a authored Aug 2, 2023
2 parents 9899a34 + 3680df6 commit 31a73c9
Show file tree
Hide file tree
Showing 234 changed files with 13,667 additions and 2,442 deletions.
15 changes: 13 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ dependencies {

// Tun2socks (https://jitpack.io/#celzero/firestack)

download 'com.github.celzero:firestack:37b6b37c99'
implementation 'com.github.celzero:firestack:37b6b37c99'
download 'com.github.celzero:firestack:cdba425ef3'
implementation 'com.github.celzero:firestack:cdba425ef3'
// implementation project(":tun2socks")

// Work manager
Expand Down Expand Up @@ -241,6 +241,17 @@ dependencies {
fullImplementation 'androidx.biometric:biometric:1.1.0'

playImplementation 'com.google.android.play:core:1.10.3' // for new version updater

implementation("androidx.security:security-crypto:1.0.0")

// For App Authentication APIs
implementation("androidx.security:security-app-authenticator:1.0.0-alpha02")

// For App Authentication API testing
androidTestImplementation("androidx.security:security-app-authenticator:1.0.0-alpha02")

// barcode scanner for wireguard
fullImplementation 'com.journeyapps:zxing-android-embedded:4.3.0'
}

// github.com/michel-kraemer/gradle-download-task/issues/131#issuecomment-464476903
Expand Down
18 changes: 18 additions & 0 deletions app/src/full/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@
<activity
android:name=".ui.NetworkLogsActivity"
android:finishOnTaskLaunch="true" />
<activity
android:name=".ui.WgMainActivity"
android:finishOnTaskLaunch="true" />
<activity
android:name=".ui.WgConfigEditorActivity"
android:finishOnTaskLaunch="true" />
<activity
android:name=".ui.WgConfigDetailActivity"
android:finishOnTaskLaunch="true" />
<activity
android:name=".ui.CheckoutActivity"
android:finishOnTaskLaunch="true" />
<activity
android:name=".ui.TcpProxyMainActivity"
android:finishOnTaskLaunch="true" />
<activity
android:name=".ui.UniversalFirewallSettingsActivity"
android:finishOnTaskLaunch="true" />
<activity
android:name=".ui.NotificationHandlerDialog"
android:excludeFromRecents="true"
Expand Down
21 changes: 2 additions & 19 deletions app/src/full/java/com/celzero/bravedns/RethinkDnsApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ package com.celzero.bravedns

import android.app.Application
import android.content.pm.ApplicationInfo
import android.net.VpnService
import android.os.StrictMode
import android.util.Log
import com.celzero.bravedns.scheduler.ScheduleManager
import com.celzero.bravedns.scheduler.WorkScheduler
import com.celzero.bravedns.service.VpnController
import com.celzero.bravedns.util.LoggerConstants
import com.celzero.bravedns.util.LoggerConstants.Companion.LOG_TAG_SCHEDULER
import org.koin.android.ext.android.get
import org.koin.android.ext.koin.androidContext
Expand Down Expand Up @@ -37,35 +34,21 @@ class RethinkDnsApplication : Application() {

override fun onCreate() {
super.onCreate()

DEBUG = applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE == ApplicationInfo.FLAG_DEBUGGABLE

turnOnStrictMode()

startKoin {
if (DEBUG) androidLogger()
androidContext(this@RethinkDnsApplication)
koin.loadModules(AppModules)
}

turnOnStrictMode()

if (DEBUG) Log.d(LOG_TAG_SCHEDULER, "Schedule job")
get<WorkScheduler>().scheduleAppExitInfoCollectionJob()
// database refresh is used in both headless and main project
get<ScheduleManager>().scheduleDatabaseRefreshJob()
get<WorkScheduler>().schedulePurgeConnectionsLog()

/**
* Issue fix - https://github.com/celzero/rethink-app/issues/57 When the application
* crashes/updates it goes into red waiting state. This causes confusion to the users also
* requires click of START button twice to start the app. FIX : The check for the controller
* state. If persistence state has vpn enabled and the VPN is not connected then the start
* will be initiated.
*/
val state = VpnController.state()
if (state.activationRequested && !state.on) {
Log.i(LoggerConstants.LOG_TAG_VPN, "start VPN (previous state)")
if (VpnService.prepare(this) == null) VpnController.start(this)
} else VpnController.stop(this)
}

private fun turnOnStrictMode() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import com.celzero.bravedns.databinding.ListItemAppConnDetailsBinding
import com.celzero.bravedns.service.IpRulesManager
import com.celzero.bravedns.ui.AppConnectionBottomSheet
import com.celzero.bravedns.util.LoggerConstants
import com.celzero.bravedns.util.UIUtils.fetchColor
import com.celzero.bravedns.util.UiUtils.fetchColor
import com.celzero.bravedns.util.Utilities.removeBeginningTrailingCommas

class AppConnectionAdapter(val context: Context, val uid: Int) :
Expand Down
Loading

0 comments on commit 31a73c9

Please sign in to comment.