Skip to content

Commit

Permalink
Version v053d release
Browse files Browse the repository at this point in the history
Updated build.gradle with the version code and name.

final string literals modifications for version v53d.

Bottom sheet theme issue fix - Navigation bar background color
was not aligned with the application theme, new property added
in the styles(windowIsFloating) to the bottomsheet stlyes.


Former-commit-id: cc233bb
  • Loading branch information
hussainmohd-a committed Apr 2, 2021
1 parent 5f0e8e2 commit 92df105
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 26 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ android {
applicationId "com.celzero.bravedns"
minSdkVersion 23
targetSdkVersion 30
versionCode 14 // For version name 053c
versionName "0.5.3c"
versionCode 15 // For version name 053d
versionName "0.5.3d"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down Expand Up @@ -74,16 +74,16 @@ android {
}

dependencies {
androidTestImplementation 'androidx.test:rules:1.4.0-alpha04'
androidTestImplementation 'androidx.test:rules:1.4.0-alpha05'
def koin_version = '2.2.2'
def room_version = "2.2.6"
def paging_version = "2.1.2"

implementation "com.google.guava:guava:30.1-android"

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.3.0-beta01'
implementation 'androidx.core:core-ktx:1.5.0-beta03'
implementation 'androidx.appcompat:appcompat:1.3.0-rc01'
implementation 'androidx.core:core-ktx:1.6.0-alpha01'
implementation("androidx.preference:preference-ktx:1.1.1")
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation "com.mikepenz:fastadapter:5.0.0-a04"
Expand Down Expand Up @@ -145,7 +145,7 @@ dependencies {
implementation 'com.kirich1409.viewbindingpropertydelegate:viewbindingpropertydelegate:1.4.0'

//Tun2socks
implementation 'com.github.celzero:firestack:405d7ca5d7'
implementation 'com.github.celzero:firestack:e62f1dd5e9'

//Work manager
implementation 'android.arch.work:work-runtime-ktx:1.0.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,15 @@ class DNSProxyEndpointAdapter(private val context: Context,
b.dnsProxyListUrlExplanation.text = context.getString(R.string.settings_socks_forwarding_desc, dnsProxyEndpoint.proxyIP, dnsProxyEndpoint.proxyPort.toString(), context.getString(R.string.cd_custom_dns_proxy_default_app))
} else {
Log.i(LOG_TAG, "Proxy : ${dnsProxyEndpoint.proxyAppName}")
val appNameInfo = appList[dnsProxyEndpoint.proxyAppName]
b.dnsProxyListUrlExplanation.text = context.getString(R.string.settings_socks_forwarding_desc, dnsProxyEndpoint.proxyIP, dnsProxyEndpoint.proxyPort.toString(), appNameInfo?.appName)
b.dnsProxyListUrlExplanation.text = context.getString(R.string.settings_socks_forwarding_desc, dnsProxyEndpoint.proxyIP, dnsProxyEndpoint.proxyPort.toString(), dnsProxyEndpoint.proxyAppName)

}
} else {
if (dnsProxyEndpoint.proxyAppName == context.getString(R.string.cd_custom_dns_proxy_default_app)) {
b.dnsProxyListUrlExplanation.text = context.getString(R.string.dns_proxy_desc, dnsProxyEndpoint.proxyIP, dnsProxyEndpoint.proxyPort.toString(), context.getString(R.string.cd_custom_dns_proxy_default_app))
} else {
Log.i(LOG_TAG, "Proxy : ${dnsProxyEndpoint.proxyAppName}")
val appNameInfo = appList[dnsProxyEndpoint.proxyAppName]
b.dnsProxyListUrlExplanation.text = context.getString(R.string.dns_proxy_desc, dnsProxyEndpoint.proxyIP, dnsProxyEndpoint.proxyPort.toString(), appNameInfo?.appName)
b.dnsProxyListUrlExplanation.text = context.getString(R.string.dns_proxy_desc, dnsProxyEndpoint.proxyIP, dnsProxyEndpoint.proxyPort.toString(), dnsProxyEndpoint.proxyAppName)
}
}

Expand Down
13 changes: 10 additions & 3 deletions app/src/main/java/com/celzero/bravedns/service/PersistentState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.celzero.bravedns.ui.HomeScreenActivity
import com.celzero.bravedns.ui.HomeScreenActivity.GlobalVariable.appMode
import com.celzero.bravedns.ui.HomeScreenActivity.GlobalVariable.braveMode
import com.celzero.bravedns.ui.HomeScreenActivity.GlobalVariable.connectedDNS
import com.celzero.bravedns.ui.HomeScreenActivity.GlobalVariable.lifeTimeQueries
import com.celzero.bravedns.util.Constants
import com.celzero.bravedns.util.Constants.Companion.ORBAT_MODE_NONE
import hu.autsoft.krate.*
Expand Down Expand Up @@ -186,8 +187,11 @@ class PersistentState(context: Context):SimpleKrate(context) {
}

fun getNumOfReq(): Int {
if (HomeScreenActivity.GlobalVariable.lifeTimeQueries >= 0)
if (HomeScreenActivity.GlobalVariable.lifeTimeQueries >= 0) {
HomeScreenActivity.GlobalVariable.lifeTimeQ.postValue(lifeTimeQueries)
return HomeScreenActivity.GlobalVariable.lifeTimeQueries
}
HomeScreenActivity.GlobalVariable.lifeTimeQ.postValue(_numberOfRequests)
return _numberOfRequests
}

Expand Down Expand Up @@ -228,8 +232,11 @@ class PersistentState(context: Context):SimpleKrate(context) {
connectedDNSName
}
}else if(dnsType == 2){
val cryptDetails = appMode?.getDNSCryptServerCount()
"DNSCrypt: $cryptDetails resolvers"
if(appMode?.getDNSCryptServerCount() != null) {
val cryptDetails = appMode?.getDNSCryptServerCount()
"DNSCrypt: $cryptDetails resolvers"
}
"DNSCrypt: 0 resolvers"
}else{
val proxyDetails = appMode?.getDNSProxyServerDetails()
proxyDetails?.proxyAppName!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,16 @@ class ConnTrackerBottomSheetFragment(private var contextVal: Context, private va

override fun getTheme(): Int = if (persistentState.theme == 0) {
if (isDarkThemeOn()) {
R.style.BottomSheetDialogTheme
R.style.BottomSheetDialogThemeTrueBlack
} else {
R.style.BottomSheetDialogThemeWhite
}
} else if (persistentState.theme == 1) {
R.style.BottomSheetDialogThemeWhite
} else {
} else if (persistentState.theme == 2) {
R.style.BottomSheetDialogTheme
} else {
R.style.BottomSheetDialogThemeTrueBlack
}

private fun isDarkThemeOn(): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@ class DNSBlockListBottomSheetFragment(private var contextVal: Context, private v

override fun getTheme(): Int = if (persistentState.theme == 0) {
if (isDarkThemeOn()) {
R.style.BottomSheetDialogTheme
R.style.BottomSheetDialogThemeTrueBlack
} else {
R.style.BottomSheetDialogThemeWhite
}
} else if (persistentState.theme == 1) {
R.style.BottomSheetDialogThemeWhite
} else {
} else if (persistentState.theme == 2) {
R.style.BottomSheetDialogTheme
} else {
R.style.BottomSheetDialogThemeTrueBlack
}

private fun isDarkThemeOn(): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class DNSLogFragment : Fragment(R.layout.activity_query_detail), SearchView.OnQu
showDialogForDelete()
}

persistentState.getNumOfReq()
registerForObservers()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class HomeScreenActivity : AppCompatActivity(R.layout.activity_home_screen) {
var appStartTime: Long = System.currentTimeMillis()
var isBackgroundEnabled: Boolean = false
var firewallRules: HashMultimap<Int, String> = HashMultimap.create()
var DEBUG = true
var DEBUG = false

//Screen off - whether the screen preference is set 0-off, 1- on. -1 not initialized
var isScreenLockedSetting: Int = -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,16 @@ class HomeScreenSettingBottomSheet() : BottomSheetDialogFragment() {

override fun getTheme(): Int = if (persistentState.theme == 0) {
if (isDarkThemeOn()) {
R.style.BottomSheetDialogTheme
R.style.BottomSheetDialogThemeTrueBlack
} else {
R.style.BottomSheetDialogThemeWhite
}
} else if (persistentState.theme == 1) {
R.style.BottomSheetDialogThemeWhite
} else {
} else if (persistentState.theme == 2) {
R.style.BottomSheetDialogTheme
} else {
R.style.BottomSheetDialogThemeTrueBlack
}

private fun isDarkThemeOn(): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class OrbotBottomSheetFragment : BottomSheetDialogFragment() {
}
} else if (persistentState.theme == 1) {
R.style.BottomSheetDialogThemeWhite
} else if (persistentState.theme == 2) {
R.style.BottomSheetDialogThemeTrueBlack
} else {
R.style.BottomSheetDialogTheme
}
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
<string name="configure_dns_connected_dns_crypt_status">dnscrypt</string>
<string name="configure_dns_connected_dns_proxy_status">dns proxy</string>
<string name="configure_dns_connection_name">Connected to %1$s</string>
<string name="configure_dns_crypt_name">DNSCrypt resolvers: </string>
<string name="configure_dns_crypt_name">DNSCrypt resolvers: %1$s</string>
<string name="configure_dns_crypt">DNSCrypt: %1$s resolvers</string>

<string name="firewall_app_added_in_whitelist">whitelisted app</string>
Expand Down Expand Up @@ -824,7 +824,7 @@

<!-- Excluded app dialog -->
<string name="ex_dialog_count">%1$s/%2$s apps excluded.</string>
<string name="ex_dialog_header">Exclude app from DNS and Firewall</string>
<string name="ex_dialog_header">Exclude apps from DNS and Firewall</string>
<string name="ex_dialog_button">Go back</string>
<string name="ex_select_all">select all</string>

Expand Down Expand Up @@ -913,7 +913,7 @@
<string name="whitelist_add_positive">Add %1$s apps</string>
<string name="whitelist_add_negative">Remove %1$s apps</string>

<string name="whitelist_heading">Whitelist Applications</string>
<string name="whitelist_heading">Whitelist Apps</string>
<string name="whitelist_select_all">select all</string>
<string name="whitelist_button">Go back</string>

Expand Down
19 changes: 16 additions & 3 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@
<item name="colorSwitchThumbNormal">@color/neutral</item>
<!-- Inactive track color(30% transparency) -->
<item name="android:colorForeground">@color/primaryText</item>
<item name="android:navigationBarColor">@color/colorPrimary</item>
<item name="android:windowIsFloating">false</item>
<item name="android:navigationBarColor">@color/childListColor</item>
</style>

<style name="BottomSheetDialogThemeWhite" parent="BaseBottomSheetDialog">
Expand All @@ -168,8 +169,20 @@
<item name="colorSwitchThumbNormal">@color/neutral</item>
<!-- Inactive track color(30% transparency) -->
<item name="android:colorForeground">@color/primaryText</item>
<item name="android:navigationBarColor">@color/background_dark_white</item>
</style>
<item name="android:windowIsFloating">false</item>
<item name="android:navigationBarColor">@color/colorPrimary_white</item>
</style>

<style name="BottomSheetDialogThemeTrueBlack" parent="BaseBottomSheetDialog">
<!-- Active thumb color & Active track color(30% transparency) -->
<item name="colorControlActivated">?attr/accentBad</item>
<!-- Inactive thumb color -->
<item name="colorSwitchThumbNormal">@color/neutral</item>
<!-- Inactive track color(30% transparency) -->
<item name="android:colorForeground">@color/primaryText</item>
<item name="android:windowIsFloating">false</item>
<item name="android:navigationBarColor">@color/colorBackgroundBlack</item>
</style>

<style name="SearchView_custom" parent="Widget.AppCompat.SearchView">
<item name="searchViewStyle">@style/Widget.AppCompat.Light.SearchView</item>
Expand Down

0 comments on commit 92df105

Please sign in to comment.