Skip to content

Commit

Permalink
Fix m build issue (#377)
Browse files Browse the repository at this point in the history
tools:context in activity_connection_tracker.xml
was pointing to an incorrect... context.
  • Loading branch information
hussainmohd-a committed Sep 21, 2021
1 parent c1ee8fe commit 63efbf6
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,14 @@ class ExcludedAppListAdapter(private val context: Context) :

val count = packageList.count()
positiveTxt = if (appInfo.isExcluded) {
builderSingle.setTitle(context.getString(R.string.exclude_app_desc, appInfo.appName,
count.toString()))
builderSingle.setTitle(
context.getString(R.string.exclude_app_desc, appInfo.appName, count.toString()))
context.getString(R.string.exclude_app_dialog_positive, count.toString())
} else {
builderSingle.setTitle(
context.getString(R.string.unexclude_app_desc, appInfo.appName,
count.toString()))
context.getString(R.string.unexclude_app_dialog_positive,
count.toString())
context.getString(R.string.unexclude_app_dialog_positive, count.toString())
}
val arrayAdapter = ArrayAdapter<String>(context,
android.R.layout.simple_list_item_activated_1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,12 @@ class FirewallAppListAdapter internal constructor(private val context: Context,
builderSingle.setTitle(
context.getString(R.string.ctbs_block_other_apps, appInfo.appName,
count.toString()))
context.getString(R.string.ctbs_block_other_apps_positive_text,
count.toString())
context.getString(R.string.ctbs_block_other_apps_positive_text, count.toString())
} else {
builderSingle.setTitle(
context.getString(R.string.ctbs_unblock_other_apps, appInfo.appName,
count.toString()))
context.getString(R.string.ctbs_unblock_other_apps_positive_text,
count.toString())
context.getString(R.string.ctbs_unblock_other_apps_positive_text, count.toString())
}
val arrayAdapter = ArrayAdapter<String>(context,
android.R.layout.simple_list_item_activated_1)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/celzero/bravedns/data/AppConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class AppConfig internal constructor(private val context: Context,
enum class ProxyProvider {
NONE, CUSTOM, ORBOT;

fun isProxyProviderCustom():Boolean {
fun isProxyProviderCustom(): Boolean {
return CUSTOM.name == name
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ class GoVpnAdapter(private val context: Context, private val externalScope: Coro
tunnel?.stopDNSCryptProxy()
handleDnscryptFailure()
} else {
tunnel?.setTunMode(Settings.DNSModeCryptPort, tunnelOptions.tunFirewallMode.mode,
tunnel?.setTunMode(Settings.DNSModeCryptPort,
tunnelOptions.tunFirewallMode.mode,
tunnelOptions.tunProxyMode.mode)
setSocks5TunnelModeIfNeeded(tunnelOptions.tunProxyMode)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ class BraveVPNService : VpnService(), ConnectionMonitor.NetworkListener, Protect
}

private fun allowOrbot(uid: Int): Boolean {
return settingUpOrbot.get() && OrbotHelper.ORBOT_PACKAGE_NAME == FirewallManager.getPackageNameByUid(uid)
return settingUpOrbot.get() && OrbotHelper.ORBOT_PACKAGE_NAME == FirewallManager.getPackageNameByUid(
uid)
}

private fun dnsProxied(port: Int): Boolean {
Expand All @@ -296,7 +297,7 @@ class BraveVPNService : VpnService(), ConnectionMonitor.NetworkListener, Protect
}

private fun dnsBypassed(destIp: String): Boolean {
return if (!persistentState.disallowDnsBypass || !appConfig.canEnableDnsBypassFirewallSetting() ) {
return if (!persistentState.disallowDnsBypass || !appConfig.canEnableDnsBypassFirewallSetting()) {
false
} else {
unresolvedIp(destIp)
Expand Down Expand Up @@ -636,8 +637,9 @@ class BraveVPNService : VpnService(), ConnectionMonitor.NetworkListener, Protect
}
}

if (appConfig.isOrbotProxyEnabled() && isExcludePossible(
getString(R.string.orbot), getString(R.string.orbot_toast_parameter))) {
if (appConfig.isOrbotProxyEnabled() && isExcludePossible(getString(R.string.orbot),
getString(
R.string.orbot_toast_parameter))) {
builder = builder.addDisallowedApplication(OrbotHelper.ORBOT_PACKAGE_NAME)
}

Expand Down Expand Up @@ -766,7 +768,8 @@ class BraveVPNService : VpnService(), ConnectionMonitor.NetworkListener, Protect
// 1. Pause / Resume, Stop action button.
// 2. RethinkDNS modes (dns & dns+firewall mode)
// 3. No action button.
if (DEBUG) Log.d(LOG_TAG_VPN, "notification action type: ${persistentState.notificationActionType}")
if (DEBUG) Log.d(LOG_TAG_VPN,
"notification action type: ${persistentState.notificationActionType}")
builder.color = ContextCompat.getColor(this, getThemeAccent(this))
when (NotificationActionType.getNotificationActionType(
persistentState.notificationActionType)) {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/celzero/bravedns/ui/AboutFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import android.content.Intent
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.os.SystemClock
import android.provider.Settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ class ConnTrackerBottomSheetFragment(private var ipDetails: ConnectionTracker) :
if (packageCount >= 1) {
b.bsConnBlockAppCheck.isChecked = FirewallManager.isUidFirewalled(ipDetails.uid)
b.bsConnTrackAppName.text = if (packageCount >= 2) {
getString(R.string.ctbs_app_other_apps, ipDetails.appName, packageCount.minus(1).toString())
getString(R.string.ctbs_app_other_apps, ipDetails.appName,
packageCount.minus(1).toString())
} else if (AndroidUidConfig.isUidAppRange(ipDetails.uid)) {
canNav = true
ipDetails.appName + ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class DNSBlocklistBottomSheetFragment(private var contextVal: Context,
val ips = transaction.response.split(",")
val ipCount = ips.count()
if (ipCount > 1) b.dnsBlockIpsChip.text = getString(R.string.dns_btm_sheet_chip,
(ipCount - 1).toString())
(ipCount - 1).toString())
else b.dnsBlockIpsChip.visibility = View.GONE

b.dnsBlockIpsChip.setOnClickListener {
Expand Down Expand Up @@ -217,7 +217,8 @@ class DNSBlocklistBottomSheetFragment(private var contextVal: Context,
val heading = it.replaceFirstChar { a ->
if (a.isLowerCase()) a.titlecase(Locale.getDefault()) else a.toString()
}
text += getString(R.string.dns_btm_sheet_dialog_message, heading, groupNames.get(it).count().toString(),
text += getString(R.string.dns_btm_sheet_dialog_message, heading,
groupNames.get(it).count().toString(),
TextUtils.join(", ", groupNames.get(it)))
}
text = text.replace(",", ", ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package com.celzero.bravedns.ui

import android.os.Bundle
import android.util.Log
import android.view.View
import android.view.animation.Animation
import android.view.animation.RotateAnimation
Expand All @@ -33,8 +32,6 @@ import com.celzero.bravedns.database.CategoryInfoRepository
import com.celzero.bravedns.database.RefreshDatabase
import com.celzero.bravedns.databinding.FragmentFirewallAllAppsBinding
import com.celzero.bravedns.service.PersistentState
import com.celzero.bravedns.ui.HomeScreenActivity.GlobalVariable.DEBUG
import com.celzero.bravedns.util.LoggerConstants.Companion.LOG_TAG_FIREWALL
import com.celzero.bravedns.util.Utilities
import com.celzero.bravedns.viewmodel.FirewallAppViewModel
import kotlinx.coroutines.Dispatchers
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_connection_tracker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.UniversalFirewallFragment">
tools:context=".ui.ConnectionTrackerFragment">

<include
android:id="@+id/connection_list_scroll_list"
Expand Down

0 comments on commit 63efbf6

Please sign in to comment.