diff --git a/base/build.gradle b/base/build.gradle index fabb8a99e..84d8daca6 100644 --- a/base/build.gradle +++ b/base/build.gradle @@ -112,6 +112,9 @@ dependencies { //Logging api 'org.slf4j:slf4j-api:1.7.36' api 'com.github.tony19:logback-android:2.0.0' + implementation ('net.logstash.logback:logstash-logback-encoder:5.0') { + exclude group: 'ch.qos.logback', module: 'logback-core' + } //Room api "androidx.room:room-rxjava2:$room" api "androidx.room:room-runtime:$room" diff --git a/base/schemas/com.windscribe.vpn.localdatabase.WindscribeDatabase/34.json b/base/schemas/com.windscribe.vpn.localdatabase.WindscribeDatabase/34.json index 3699b7563..967bfbeda 100644 --- a/base/schemas/com.windscribe.vpn.localdatabase.WindscribeDatabase/34.json +++ b/base/schemas/com.windscribe.vpn.localdatabase.WindscribeDatabase/34.json @@ -2,7 +2,7 @@ "formatVersion": 1, "database": { "version": 34, - "identityHash": "3a598c80b4a2b71fa6d9d85c139ccf19", + "identityHash": "5e159935e39a27894dd80222509ad820", "entities": [ { "tableName": "ping_results", @@ -411,7 +411,7 @@ }, { "tableName": "StaticRegion", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`cityName` TEXT, `countryCode` TEXT, `deviceName` TEXT, `id` INTEGER, `ipId` INTEGER, `name` TEXT, `ovpnX509` TEXT, `serverId` INTEGER, `shortName` TEXT, `staticIp` TEXT, `type` TEXT, `wgIp` TEXT, `wgPubKey` TEXT, `pingHost` TEXT, `passwordEncoded` TEXT, `userNameEncoded` TEXT, `nodecityName` TEXT, `nodednsHostname` TEXT, `nodehostname` TEXT, `nodeip` TEXT, `nodeip2` TEXT, `nodeip3` TEXT, PRIMARY KEY(`id`))", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`cityName` TEXT, `countryCode` TEXT, `deviceName` TEXT, `id` INTEGER, `ipId` INTEGER, `name` TEXT, `ovpnX509` TEXT, `serverId` INTEGER, `shortName` TEXT, `staticIp` TEXT, `type` TEXT, `wgIp` TEXT, `wgPubKey` TEXT, `pingHost` TEXT, `status` INTEGER, `passwordEncoded` TEXT, `userNameEncoded` TEXT, `nodecityName` TEXT, `nodednsHostname` TEXT, `nodehostname` TEXT, `nodeip` TEXT, `nodeip2` TEXT, `nodeip3` TEXT, PRIMARY KEY(`id`))", "fields": [ { "fieldPath": "cityName", @@ -497,6 +497,12 @@ "affinity": "TEXT", "notNull": false }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": false + }, { "fieldPath": "credentials.passwordEncoded", "columnName": "passwordEncoded", @@ -739,7 +745,7 @@ "views": [], "setupQueries": [ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", - "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '3a598c80b4a2b71fa6d9d85c139ccf19')" + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '5e159935e39a27894dd80222509ad820')" ] } } \ No newline at end of file diff --git a/base/schemas/com.windscribe.vpn.localdatabase.WindscribeDatabase/35.json b/base/schemas/com.windscribe.vpn.localdatabase.WindscribeDatabase/35.json index da9c9e727..377e5d784 100644 --- a/base/schemas/com.windscribe.vpn.localdatabase.WindscribeDatabase/35.json +++ b/base/schemas/com.windscribe.vpn.localdatabase.WindscribeDatabase/35.json @@ -2,7 +2,7 @@ "formatVersion": 1, "database": { "version": 35, - "identityHash": "f84f9d3820d9fab9e07c87398d9e2596", + "identityHash": "5e159935e39a27894dd80222509ad820", "entities": [ { "tableName": "ping_results", @@ -28,10 +28,10 @@ } ], "primaryKey": { + "autoGenerate": false, "columnNames": [ "node_name" - ], - "autoGenerate": false + ] }, "indices": [], "foreignKeys": [] @@ -60,10 +60,10 @@ } ], "primaryKey": { + "autoGenerate": false, "columnNames": [ "user_name" - ], - "autoGenerate": false + ] }, "indices": [], "foreignKeys": [] @@ -86,10 +86,10 @@ } ], "primaryKey": { + "autoGenerate": false, "columnNames": [ "user_name" - ], - "autoGenerate": false + ] }, "indices": [], "foreignKeys": [] @@ -118,10 +118,10 @@ } ], "primaryKey": { + "autoGenerate": false, "columnNames": [ "notification_id" - ], - "autoGenerate": false + ] }, "indices": [], "foreignKeys": [] @@ -210,10 +210,10 @@ } ], "primaryKey": { + "autoGenerate": true, "columnNames": [ "primaryKey" - ], - "autoGenerate": true + ] }, "indices": [ { @@ -222,6 +222,7 @@ "columnNames": [ "region_id" ], + "orders": [], "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_Region_region_id` ON `${TABLE_NAME}` (`region_id`)" } ], @@ -229,7 +230,7 @@ }, { "tableName": "City", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`city_id` INTEGER NOT NULL, `nodes` TEXT, `primaryKey` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `region_id` INTEGER NOT NULL, `gps` TEXT, `nick` TEXT, `city` TEXT, `ping_ip` TEXT DEFAULT '', `pro` INTEGER NOT NULL, `wg_pubkey` TEXT, `tz` TEXT, `ovpn_x509` TEXT, `link_speed` TEXT, `health` INTEGER NOT NULL)", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`city_id` INTEGER NOT NULL, `nodes` TEXT, `primaryKey` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `region_id` INTEGER NOT NULL, `gps` TEXT, `health` INTEGER NOT NULL, `link_speed` TEXT, `nick` TEXT, `city` TEXT, `ovpn_x509` TEXT, `ping_ip` TEXT DEFAULT '', `pro` INTEGER NOT NULL, `wg_pubkey` TEXT, `tz` TEXT, `ping_host` TEXT)", "fields": [ { "fieldPath": "id", @@ -261,6 +262,18 @@ "affinity": "TEXT", "notNull": false }, + { + "fieldPath": "health", + "columnName": "health", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "linkSpeed", + "columnName": "link_speed", + "affinity": "TEXT", + "notNull": false + }, { "fieldPath": "nickName", "columnName": "nick", @@ -273,6 +286,12 @@ "affinity": "TEXT", "notNull": false }, + { + "fieldPath": "ovpnX509", + "columnName": "ovpn_x509", + "affinity": "TEXT", + "notNull": false + }, { "fieldPath": "pingIp", "columnName": "ping_ip", @@ -299,29 +318,17 @@ "notNull": false }, { - "fieldPath": "ovpnX509", - "columnName": "ovpn_x509", + "fieldPath": "pingHost", + "columnName": "ping_host", "affinity": "TEXT", "notNull": false - }, - { - "fieldPath": "linkSpeed", - "columnName": "link_speed", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "health", - "columnName": "health", - "affinity": "INTEGER", - "notNull": true } ], "primaryKey": { + "autoGenerate": true, "columnNames": [ "primaryKey" - ], - "autoGenerate": true + ] }, "indices": [], "foreignKeys": [] @@ -338,17 +345,17 @@ } ], "primaryKey": { + "autoGenerate": false, "columnNames": [ "favourite_id" - ], - "autoGenerate": false + ] }, "indices": [], "foreignKeys": [] }, { "tableName": "PingTime", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`static` INTEGER NOT NULL, `ping_time` INTEGER NOT NULL, `ping_id` INTEGER NOT NULL, `isPro` INTEGER NOT NULL, `region_id` INTEGER NOT NULL, PRIMARY KEY(`ping_id`))", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`static` INTEGER NOT NULL, `ping_time` INTEGER NOT NULL, `ping_id` INTEGER NOT NULL, `isPro` INTEGER NOT NULL, `region_id` INTEGER NOT NULL, `updated_at` INTEGER NOT NULL, `ip` TEXT, PRIMARY KEY(`ping_id`))", "fields": [ { "fieldPath": "isStatic", @@ -379,20 +386,32 @@ "columnName": "region_id", "affinity": "INTEGER", "notNull": true + }, + { + "fieldPath": "updatedAt", + "columnName": "updated_at", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "ip", + "columnName": "ip", + "affinity": "TEXT", + "notNull": false } ], "primaryKey": { + "autoGenerate": false, "columnNames": [ "ping_id" - ], - "autoGenerate": false + ] }, "indices": [], "foreignKeys": [] }, { "tableName": "StaticRegion", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`cityName` TEXT, `countryCode` TEXT, `deviceName` TEXT, `id` INTEGER, `ipId` INTEGER, `name` TEXT, `serverId` INTEGER, `shortName` TEXT, `staticIp` TEXT, `type` TEXT, `wgIp` TEXT, `wgPubKey` TEXT, `ovpnX509` TEXT, `passwordEncoded` TEXT, `userNameEncoded` TEXT, `nodecityName` TEXT, `nodednsHostname` TEXT, `nodehostname` TEXT, `nodeip` TEXT, `nodeip2` TEXT, `nodeip3` TEXT, PRIMARY KEY(`id`))", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`cityName` TEXT, `countryCode` TEXT, `deviceName` TEXT, `id` INTEGER, `ipId` INTEGER, `name` TEXT, `ovpnX509` TEXT, `serverId` INTEGER, `shortName` TEXT, `staticIp` TEXT, `type` TEXT, `wgIp` TEXT, `wgPubKey` TEXT, `pingHost` TEXT, `status` INTEGER, `passwordEncoded` TEXT, `userNameEncoded` TEXT, `nodecityName` TEXT, `nodednsHostname` TEXT, `nodehostname` TEXT, `nodeip` TEXT, `nodeip2` TEXT, `nodeip3` TEXT, PRIMARY KEY(`id`))", "fields": [ { "fieldPath": "cityName", @@ -430,6 +449,12 @@ "affinity": "TEXT", "notNull": false }, + { + "fieldPath": "ovpnX509", + "columnName": "ovpnX509", + "affinity": "TEXT", + "notNull": false + }, { "fieldPath": "serverId", "columnName": "serverId", @@ -467,11 +492,17 @@ "notNull": false }, { - "fieldPath": "ovpnX509", - "columnName": "ovpnX509", + "fieldPath": "pingHost", + "columnName": "pingHost", "affinity": "TEXT", "notNull": false }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "INTEGER", + "notNull": false + }, { "fieldPath": "credentials.passwordEncoded", "columnName": "passwordEncoded", @@ -522,10 +553,10 @@ } ], "primaryKey": { + "autoGenerate": false, "columnNames": [ "id" - ], - "autoGenerate": false + ] }, "indices": [], "foreignKeys": [] @@ -566,10 +597,10 @@ } ], "primaryKey": { + "autoGenerate": false, "columnNames": [ "networkName" - ], - "autoGenerate": false + ] }, "indices": [], "foreignKeys": [] @@ -616,10 +647,10 @@ } ], "primaryKey": { + "autoGenerate": false, "columnNames": [ "primary_key" - ], - "autoGenerate": false + ] }, "indices": [], "foreignKeys": [] @@ -702,10 +733,10 @@ } ], "primaryKey": { + "autoGenerate": false, "columnNames": [ "id" - ], - "autoGenerate": false + ] }, "indices": [], "foreignKeys": [] @@ -714,7 +745,7 @@ "views": [], "setupQueries": [ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", - "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'f84f9d3820d9fab9e07c87398d9e2596')" + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '5e159935e39a27894dd80222509ad820')" ] } } \ No newline at end of file diff --git a/base/src/google/java/com.windscribe.vpn/billing/AmazonBillingManager.java b/base/src/google/java/com.windscribe.vpn/billing/AmazonBillingManager.java index 287d20f62..4ba2e0dae 100644 --- a/base/src/google/java/com.windscribe.vpn/billing/AmazonBillingManager.java +++ b/base/src/google/java/com.windscribe.vpn/billing/AmazonBillingManager.java @@ -51,7 +51,7 @@ public class AmazonBillingManager implements PurchasingListener, LifecycleObserv private final Application app; - private final Logger logger = LoggerFactory.getLogger("Amazon:Billing_m"); + private final Logger logger = LoggerFactory.getLogger("billing"); public AmazonBillingManager(Application app) { this.app = app; diff --git a/base/src/google/java/com.windscribe.vpn/billing/GoogleBillingManager.java b/base/src/google/java/com.windscribe.vpn/billing/GoogleBillingManager.java index 2e55d2b6e..14c8cdd3b 100644 --- a/base/src/google/java/com.windscribe.vpn/billing/GoogleBillingManager.java +++ b/base/src/google/java/com.windscribe.vpn/billing/GoogleBillingManager.java @@ -58,7 +58,7 @@ public class GoogleBillingManager implements PurchasesUpdatedListener, Lifecycle private final Application app; - private final Logger logger = LoggerFactory.getLogger("Billing manager"); + private final Logger logger = LoggerFactory.getLogger("billing"); // private BillingManagerResponseListener mListener; private BillingClient mBillingClient; diff --git a/base/src/google/java/com.windscribe.vpn/billing/Plans.kt b/base/src/google/java/com.windscribe.vpn/billing/Plans.kt index 054c47475..6bda6a266 100644 --- a/base/src/google/java/com.windscribe.vpn/billing/Plans.kt +++ b/base/src/google/java/com.windscribe.vpn/billing/Plans.kt @@ -26,6 +26,30 @@ open class WindscribeInAppProduct( }.planPrice } + open fun getOriginalPrice(sku: String): String? { + return billingPlans.first { + it.extId == sku + }.originalPrice + } + + + fun getMonthlyPlan(): String? { + return billingPlans.firstOrNull { + it.duration == 1 + }?.extId + } + + fun getYearlyPlan(): String? { + return billingPlans.firstOrNull { + it.duration == 12 + }?.extId + } + + fun getPromoPlan(): String? { + return billingPlans.firstOrNull { + it.discount > 0 + }?.extId + } fun getPlanDuration(sku: String): String { val numberOfMonths = billingPlans.first { it.extId == sku @@ -40,7 +64,7 @@ open class WindscribeInAppProduct( } fun isPromo(): Boolean { - return pushNotificationAction != null && pushNotificationAction.promoCode.isNotEmpty() + return billingPlans.firstOrNull { it.discount > 0 } != null } fun getDiscountLabel(sku: String): String { @@ -50,6 +74,12 @@ open class WindscribeInAppProduct( return "Save $discount%" } + fun getUsdPrice(sku: String): String { + return billingPlans.first { + it.extId == sku + }.planPrice + } + fun getPromoStickerLabel(sku: String): String { val plan = billingPlans.first { it.extId == sku diff --git a/base/src/google/java/com.windscribe.vpn/services/firebasecloud/FireBaseManagerImpl.kt b/base/src/google/java/com.windscribe.vpn/services/firebasecloud/FireBaseManagerImpl.kt index 14352435e..fdd912d69 100644 --- a/base/src/google/java/com.windscribe.vpn/services/firebasecloud/FireBaseManagerImpl.kt +++ b/base/src/google/java/com.windscribe.vpn/services/firebasecloud/FireBaseManagerImpl.kt @@ -11,7 +11,7 @@ import com.windscribe.vpn.services.FirebaseManager import org.slf4j.LoggerFactory class FireBaseManagerImpl(private val context: Windscribe): FirebaseManager { - private val logger = LoggerFactory.getLogger("firebase_m") + private val logger = LoggerFactory.getLogger("fcm") override fun getFirebaseToken(callback: (String?) -> Unit) { var token: String? = null if (BuildConfig.API_KEY.isEmpty()) { diff --git a/base/src/google/java/com.windscribe.vpn/services/review/WindscribeReviewManagerImpl.kt b/base/src/google/java/com.windscribe.vpn/services/review/WindscribeReviewManagerImpl.kt index e09c40c89..c4d443f58 100644 --- a/base/src/google/java/com.windscribe.vpn/services/review/WindscribeReviewManagerImpl.kt +++ b/base/src/google/java/com.windscribe.vpn/services/review/WindscribeReviewManagerImpl.kt @@ -22,7 +22,7 @@ class WindscribeReviewManagerImpl( val userRepository: UserRepository ) : WindscribeReviewManager { private val reviewManager = ReviewManagerFactory.create(context) - private val logger = LoggerFactory.getLogger("review_m") + private val logger = LoggerFactory.getLogger("state") override fun handleAppReview() { // TV does not not In build review popup. if (appContext.applicationInterface.isTV) { diff --git a/base/src/google/java/com.windscribe.vpn/workers/worker/AmazonPendingReceiptValidator.kt b/base/src/google/java/com.windscribe.vpn/workers/worker/AmazonPendingReceiptValidator.kt index 87e814128..3e006717a 100644 --- a/base/src/google/java/com.windscribe.vpn/workers/worker/AmazonPendingReceiptValidator.kt +++ b/base/src/google/java/com.windscribe.vpn/workers/worker/AmazonPendingReceiptValidator.kt @@ -18,7 +18,7 @@ import org.slf4j.LoggerFactory import javax.inject.Inject class AmazonPendingReceiptValidator(appContext: Context, params: WorkerParameters) : CoroutineWorker(appContext, params) { - private val logger = LoggerFactory.getLogger("amazon_receipt_w") + private val logger = LoggerFactory.getLogger("billing") @Inject lateinit var interactor: ServiceInteractor diff --git a/base/src/google/java/com.windscribe.vpn/workers/worker/GooglePendingReceiptValidator.kt b/base/src/google/java/com.windscribe.vpn/workers/worker/GooglePendingReceiptValidator.kt index 9d0952ffb..11e2d7e11 100644 --- a/base/src/google/java/com.windscribe.vpn/workers/worker/GooglePendingReceiptValidator.kt +++ b/base/src/google/java/com.windscribe.vpn/workers/worker/GooglePendingReceiptValidator.kt @@ -18,7 +18,7 @@ import javax.inject.Inject import kotlin.coroutines.suspendCoroutine class GooglePendingReceiptValidator(appContext: Context, params: WorkerParameters) : CoroutineWorker(appContext, params) { - private val logger = LoggerFactory.getLogger("google_receipt_w") + private val logger = LoggerFactory.getLogger("billing") @Inject lateinit var interactor: ServiceInteractor diff --git a/base/src/main/assets/logback.xml b/base/src/main/assets/logback.xml index 93aa71f67..6c07cffc5 100644 --- a/base/src/main/assets/logback.xml +++ b/base/src/main/assets/logback.xml @@ -3,6 +3,7 @@ --> + false @@ -14,10 +15,11 @@ 1 - 10KB + 100KB - - %date{dd MMM;HH:mm:ss.SSS} [%12.12thread] [%5.5level] [%15.-15logger] - %msg%n + + + {"tm":"%d{yyyy-MM-dd HH:mm:ss.SSS}","lvl":"%lowerLevel","mod":"%logger{36}","msg":"%msg"}%n @@ -25,8 +27,10 @@ - - %-5level %logger{36} - %msg%n + + + {"tm":"%d{yyyy-MM-dd HH:mm:ss.SSS}","lvl":"%lowerLevel","mod":"%logger{36}","msg":"%msg"}%n + diff --git a/base/src/main/java/com/windscribe/vpn/ActivityInteractorImpl.kt b/base/src/main/java/com/windscribe/vpn/ActivityInteractorImpl.kt index 5f1f432dd..ecb8f5a44 100644 --- a/base/src/main/java/com/windscribe/vpn/ActivityInteractorImpl.kt +++ b/base/src/main/java/com/windscribe/vpn/ActivityInteractorImpl.kt @@ -93,7 +93,7 @@ class ActivityInteractorImpl( private var compositeDisposable = CompositeDisposable() - private val logger = LoggerFactory.getLogger("activity_i") + private val logger = LoggerFactory.getLogger("basic") private var mapResponse: PortMapResponse? = null diff --git a/base/src/main/java/com/windscribe/vpn/Windscribe.kt b/base/src/main/java/com/windscribe/vpn/Windscribe.kt index dd7d04a6e..b17021e87 100644 --- a/base/src/main/java/com/windscribe/vpn/Windscribe.kt +++ b/base/src/main/java/com/windscribe/vpn/Windscribe.kt @@ -76,7 +76,7 @@ open class Windscribe : MultiDexApplication() { ): Boolean } - private val logger = LoggerFactory.getLogger("Windscribe") + private val logger = LoggerFactory.getLogger("app") var activeActivity: AppCompatActivity? = null lateinit var applicationInterface: ApplicationInterface diff --git a/base/src/main/java/com/windscribe/vpn/api/ApiCallManager.kt b/base/src/main/java/com/windscribe/vpn/api/ApiCallManager.kt index 17dd960e4..1ff698d0c 100644 --- a/base/src/main/java/com/windscribe/vpn/api/ApiCallManager.kt +++ b/base/src/main/java/com/windscribe/vpn/api/ApiCallManager.kt @@ -46,7 +46,7 @@ import javax.inject.Singleton @Singleton open class ApiCallManager @Inject constructor(private val apiFactory: ProtectedApiFactory, val wsNetServerAPI: WSNetServerAPI, val preferencesHelper: PreferencesHelper) : IApiCallManager { - private val logger = LoggerFactory.getLogger("api_call") + private val logger = LoggerFactory.getLogger("basic") override fun getWebSession(): Single> { return Single.create { sub -> if (checkSession(sub)) return@create @@ -169,7 +169,7 @@ open class ApiCallManager @Inject constructor(private val apiFactory: ProtectedA override fun getStaticIpList(deviceID: String?): Single> { return Single.create { sub -> if (checkSession(sub)) return@create - val callback = wsNetServerAPI.staticIps(preferencesHelper.sessionHash) { code, json -> + val callback = wsNetServerAPI.staticIps(preferencesHelper.sessionHash, 2) { code, json -> buildResponse(sub, code, json, StaticIPResponse::class.java) } sub.setCancellable { callback.cancel() } diff --git a/base/src/main/java/com/windscribe/vpn/api/response/BillingPlanResponse.java b/base/src/main/java/com/windscribe/vpn/api/response/BillingPlanResponse.java index 4b266a043..fe95aabf6 100644 --- a/base/src/main/java/com/windscribe/vpn/api/response/BillingPlanResponse.java +++ b/base/src/main/java/com/windscribe/vpn/api/response/BillingPlanResponse.java @@ -5,6 +5,7 @@ package com.windscribe.vpn.api.response; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @@ -93,6 +94,10 @@ public static class BillingPlans { @Expose private Integer reBill; + @SerializedName("price_original") + @Expose + private String originalPrice; + public String getExtId() { return extId; } @@ -117,6 +122,10 @@ public boolean isReBill() { return reBill != null && reBill == 1; } + public @Nullable String getOriginalPrice() { + return originalPrice; + } + @NonNull @Override public String toString() { diff --git a/base/src/main/java/com/windscribe/vpn/api/response/StaticIPResponse.java b/base/src/main/java/com/windscribe/vpn/api/response/StaticIPResponse.java index 8e73fa53a..534726373 100644 --- a/base/src/main/java/com/windscribe/vpn/api/response/StaticIPResponse.java +++ b/base/src/main/java/com/windscribe/vpn/api/response/StaticIPResponse.java @@ -6,6 +6,7 @@ import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; +import com.windscribe.vpn.serverlist.entity.StaticRegion; import java.util.List; @@ -14,13 +15,13 @@ public class StaticIPResponse { @SerializedName("static_ips") @Expose - private List staticIpList; + private List staticIpList; - public List getStaticIpList() { + public List getStaticIpList() { return staticIpList; } - public void setStaticIpList(List staticIpList) { + public void setStaticIpList(List staticIpList) { this.staticIpList = staticIpList; } } diff --git a/base/src/main/java/com/windscribe/vpn/api/response/StaticIp.java b/base/src/main/java/com/windscribe/vpn/api/response/StaticIp.java deleted file mode 100644 index f62bba978..000000000 --- a/base/src/main/java/com/windscribe/vpn/api/response/StaticIp.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (c) 2021 Windscribe Limited. - */ - -package com.windscribe.vpn.api.response; - -import androidx.annotation.Nullable; -import androidx.room.Entity; -import androidx.room.PrimaryKey; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -@SuppressWarnings("unused") -@Entity -public class StaticIp { - - @SerializedName("city_name") - @Expose - private String cityName; - @SerializedName("country_code") - @Expose - private String countryCode; - @SerializedName("credentials") - @Expose - private ServerCredentialsResponse credentials; - @SerializedName("device_name") - @Expose - private String deviceName; - @PrimaryKey - @SerializedName("id") - @Expose - private Integer id; - @SerializedName("ip_id") - @Expose - private Integer ipId; - @SerializedName("name") - @Expose - private String name; - @SerializedName("ovpn_x509") - @Expose - private String ovpnX509; - @SerializedName("server_id") - @Expose - private Integer serverId; - @SerializedName("short_name") - @Expose - private String shortName; - @SerializedName("static_ip") - @Expose - private String staticIp; - @SerializedName("node") - @Expose - private StaticIpNode staticIpNode; - @SerializedName("type") - @Expose - private String type; - @SerializedName("wg_ip") - @Expose - private String wgIp; - @SerializedName("wg_pubkey") - @Expose - private String wgPubKey; - - @SerializedName("ping_host") - @Expose - private String pingHost; - - @Nullable - public String getPingHost() { - return pingHost; - } - - public void setPingHost(@Nullable String pingHost) { - this.pingHost = pingHost; - } - - public String getCityName() { - return cityName; - } - - public String getCountryCode() { - return countryCode; - } - - public ServerCredentialsResponse getCredentials() { - return credentials; - } - - public String getDeviceName() { - return deviceName; - } - - public void setDeviceName(String deviceName) { - this.deviceName = deviceName; - } - - public Integer getId() { - return id; - } - - public Integer getIpId() { - return ipId; - } - - public String getName() { - return name; - } - - public String getOvpnX509() { - return ovpnX509; - } - - public void setOvpnX509(final String ovpnX509) { - this.ovpnX509 = ovpnX509; - } - - public Integer getServerId() { - return serverId; - } - - public String getShortName() { - return shortName; - } - - public String getStaticIp() { - return staticIp; - } - - public StaticIpNode getStaticIpNode() { - return staticIpNode; - } - - public String getType() { - return type; - } - - public String getWgIp() { - return wgIp; - } - - public String getWgPubKey() { - return wgPubKey; - } - - public static class StaticIpNode { - - @SerializedName("city_name") - @Expose - private String cityName; - - @SerializedName("dns_hostname") - @Expose - private String dnsHostname; - - @SerializedName("hostname") - @Expose - private String hostname; - - @SerializedName("ip") - @Expose - private String ip; - - @SerializedName("ip2") - @Expose - private String ip2; - - @SerializedName("ip3") - @Expose - private String ip3; - - public String getCityName() { - return cityName; - } - - public String getDnsHostname() { - return dnsHostname; - } - - public String getHostname() { - return hostname; - } - - public String getIp() { - return ip; - } - - public String getIp2() { - return ip2; - } - - public String getIp3() { - return ip3; - } - } -} diff --git a/base/src/main/java/com/windscribe/vpn/apppreference/AppPreferenceHelper.kt b/base/src/main/java/com/windscribe/vpn/apppreference/AppPreferenceHelper.kt index b2477e82a..3acf9d850 100644 --- a/base/src/main/java/com/windscribe/vpn/apppreference/AppPreferenceHelper.kt +++ b/base/src/main/java/com/windscribe/vpn/apppreference/AppPreferenceHelper.kt @@ -201,19 +201,6 @@ class AppPreferenceHelper( set(show) { preference.put(PreferencesKeyConstants.NOTIFICATION_STAT, show) } - override val notifications: Single - get() = Single.fromCallable { - val jsonResponseString = preference - .getString(PreferencesKeyConstants.NEWS_FEED_RESPONSE, null) - if (jsonResponseString != null) { - return@fromCallable Gson().fromJson( - jsonResponseString, - NewsFeedNotification::class.java - ) - } else { - throw PreferenceException() - } - } override val oldSessionAuth: String? get() = preference.getString(PreferencesKeyConstants.SESSION_HASH, null) override var packetSize: Int diff --git a/base/src/main/java/com/windscribe/vpn/apppreference/PreferencesHelper.kt b/base/src/main/java/com/windscribe/vpn/apppreference/PreferencesHelper.kt index b92315b8a..be3f66c81 100644 --- a/base/src/main/java/com/windscribe/vpn/apppreference/PreferencesHelper.kt +++ b/base/src/main/java/com/windscribe/vpn/apppreference/PreferencesHelper.kt @@ -45,7 +45,6 @@ interface PreferencesHelper { var migrationRequired: Boolean val multipleTunnel: Boolean var notificationStat: Boolean - val notifications: Single val oldSessionAuth: String? var packetSize: Int var pingTestRequired: Boolean diff --git a/base/src/main/java/com/windscribe/vpn/apppreference/SecurePreferences.kt b/base/src/main/java/com/windscribe/vpn/apppreference/SecurePreferences.kt index ad6c933b2..cb2147c94 100644 --- a/base/src/main/java/com/windscribe/vpn/apppreference/SecurePreferences.kt +++ b/base/src/main/java/com/windscribe/vpn/apppreference/SecurePreferences.kt @@ -10,7 +10,7 @@ import com.windscribe.vpn.Windscribe import org.slf4j.LoggerFactory class SecurePreferences(app: Windscribe) { - private val logger = LoggerFactory.getLogger("secure_p") + private val logger = LoggerFactory.getLogger("basic") private val secureSharedPrefsFile = "windscribe_secure_prefs" private var sharedPreferences: SharedPreferences? = null fun clear() { diff --git a/base/src/main/java/com/windscribe/vpn/autoconnection/AutoConnectionManager.kt b/base/src/main/java/com/windscribe/vpn/autoconnection/AutoConnectionManager.kt index 153c861ab..bce794249 100644 --- a/base/src/main/java/com/windscribe/vpn/autoconnection/AutoConnectionManager.kt +++ b/base/src/main/java/com/windscribe/vpn/autoconnection/AutoConnectionManager.kt @@ -40,7 +40,7 @@ class AutoConnectionManager( ) : NetworkInfoListener { private var continuation: CancellableContinuation? = null - private val logger = LoggerFactory.getLogger("auto_connection_manager") + private val logger = LoggerFactory.getLogger("vpn") var listOfProtocols = ThreadSafeList() private var manualProtocol: ProtocolInformation? = null private var lastKnownProtocolInformation: Pair? = null @@ -91,13 +91,12 @@ class AutoConnectionManager( listOfProtocols.clear() listOfProtocols = reloadProtocols() updateNextInLineProtocol() - logger.debug("$listOfProtocols") + logger.debug("{}", listOfProtocols) } fun stop() { isEnabled = false continuation?.let { - logger.debug("Cancelling auto connect.") it.cancel() continuation = null dismissDialog() diff --git a/base/src/main/java/com/windscribe/vpn/backend/ProxyDNSManager.kt b/base/src/main/java/com/windscribe/vpn/backend/ProxyDNSManager.kt index 630a5da32..baaaddb74 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/ProxyDNSManager.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/ProxyDNSManager.kt @@ -29,7 +29,7 @@ class ProxyDNSManager( var dnsDetails: DNSDetails? = null var invalidConfig = false private var isRunning = AtomicBoolean(false) - private val logger = LoggerFactory.getLogger("proxy_dns") + private val logger = LoggerFactory.getLogger("vpn") private fun updateControlDConfig() { @@ -108,7 +108,6 @@ class ProxyDNSManager( } suspend fun stopControlD() { - logger.debug("Stopping ControlD.") cdLib.stopCd(true, 0) controlDJob?.join() invalidConfig = false diff --git a/base/src/main/java/com/windscribe/vpn/backend/TrafficCounter.kt b/base/src/main/java/com/windscribe/vpn/backend/TrafficCounter.kt index 469f1569e..6dd826319 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/TrafficCounter.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/TrafficCounter.kt @@ -29,7 +29,7 @@ class TrafficCounter( val preferencesHelper: PreferencesHelper, val deviceStateManager: DeviceStateManager, ) { - private val logger = LoggerFactory.getLogger("traffic_counter") + private val logger = LoggerFactory.getLogger("vpn") var trafficStats = MutableSharedFlow() private var _stats = trafficStats private var trafficCounterJob: Job? = null diff --git a/base/src/main/java/com/windscribe/vpn/backend/VpnBackend.kt b/base/src/main/java/com/windscribe/vpn/backend/VpnBackend.kt index 907edc559..4ae6a1fb4 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/VpnBackend.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/VpnBackend.kt @@ -36,7 +36,7 @@ abstract class VpnBackend( private val advanceParameterRepository: AdvanceParameterRepository ) { - val vpnLogger: Logger = LoggerFactory.getLogger("vpn_backend") + val vpnLogger: Logger = LoggerFactory.getLogger("vpn") var connectionJob: Job? = null var reconnecting = false var protocolInformation: ProtocolInformation? = null @@ -65,14 +65,13 @@ abstract class VpnBackend( return } connectionJob = mainScope.launch { - vpnLogger.debug("Connection timer started.") delay(CONNECTING_WAIT) connectionTimeout() } } private suspend fun connectionTimeout() { - vpnLogger.debug("Connection timeout.") + vpnLogger.error("Connection timeout.") disconnect( error = VPNState.Error( error = VPNState.ErrorType.TimeoutError, diff --git a/base/src/main/java/com/windscribe/vpn/backend/VpnBackendHolder.kt b/base/src/main/java/com/windscribe/vpn/backend/VpnBackendHolder.kt index 637131824..817eed5f5 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/VpnBackendHolder.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/VpnBackendHolder.kt @@ -34,7 +34,7 @@ class VpnBackendHolder( ) { var activeBackend: VpnBackend? = null - private val vpnLogger = LoggerFactory.getLogger("vpn_backend") + private val vpnLogger = LoggerFactory.getLogger("vpn") /** @return VpnBackend Based on selected protocol and existing vpn profile. diff --git a/base/src/main/java/com/windscribe/vpn/backend/ikev2/CharonVpnServiceWrapper.kt b/base/src/main/java/com/windscribe/vpn/backend/ikev2/CharonVpnServiceWrapper.kt index 914b6382a..653d41d4b 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/ikev2/CharonVpnServiceWrapper.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/ikev2/CharonVpnServiceWrapper.kt @@ -44,7 +44,7 @@ class CharonVpnServiceWrapper : CharonVpnService() { @Inject lateinit var scope: CoroutineScope - private var logger = LoggerFactory.getLogger("vpn_backend") + private var logger = LoggerFactory.getLogger("vpn") override fun onCreate() { appContext.serviceComponent.inject(this) diff --git a/base/src/main/java/com/windscribe/vpn/backend/openvpn/OpenVPNBackend.kt b/base/src/main/java/com/windscribe/vpn/backend/openvpn/OpenVPNBackend.kt index 48b58a6c4..fcceb84cf 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/openvpn/OpenVPNBackend.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/openvpn/OpenVPNBackend.kt @@ -22,6 +22,7 @@ import de.blinkt.openvpn.core.VpnStatus import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import org.slf4j.LoggerFactory import java.util.* import javax.inject.Singleton @@ -39,13 +40,16 @@ class OpenVPNBackend( override var active = false private var stickyDisconnectEvent = false + private val openVPNLogger = LoggerFactory.getLogger("openvpn") var service: OpenVPNWrapperService? = null override fun activate() { vpnLogger.debug("Activating OpenVPN backend.") stickyDisconnectEvent = true VpnStatus.addStateListener(this) VpnStatus.addLogListener { - vpnLogger.debug(it.toString()) + if(it.logLevel == VpnStatus.LogLevel.INFO || it.logLevel == VpnStatus.LogLevel.ERROR) { + openVPNLogger.debug(it.toString()) + } } VpnStatus.addByteCountListener(this) active = true diff --git a/base/src/main/java/com/windscribe/vpn/backend/openvpn/OpenVPNWrapperService.kt b/base/src/main/java/com/windscribe/vpn/backend/openvpn/OpenVPNWrapperService.kt index d6f0ef541..873058f59 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/openvpn/OpenVPNWrapperService.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/openvpn/OpenVPNWrapperService.kt @@ -42,7 +42,7 @@ class OpenVPNWrapperService : OpenVPNService(), StateListener { @Inject lateinit var shortcutStateManager: ShortcutStateManager - private var logger = LoggerFactory.getLogger("vpn_backend") + private var logger = LoggerFactory.getLogger("vpn") override fun onCreate() { Windscribe.appContext.serviceComponent.inject(this) diff --git a/base/src/main/java/com/windscribe/vpn/backend/openvpn/ProxyTunnelManager.kt b/base/src/main/java/com/windscribe/vpn/backend/openvpn/ProxyTunnelManager.kt index bc605b84a..bbac197cb 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/openvpn/ProxyTunnelManager.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/openvpn/ProxyTunnelManager.kt @@ -11,7 +11,7 @@ import org.slf4j.LoggerFactory import java.io.File class ProxyTunnelManager(val scope: CoroutineScope, val vpnBackend: OpenVPNBackend) { - var logger: Logger = LoggerFactory.getLogger("proxy") + var logger: Logger = LoggerFactory.getLogger("vpn") val running: Boolean get() = proxyJob?.isActive == true private var proxyJob: Job? = null diff --git a/base/src/main/java/com/windscribe/vpn/backend/openvpn/WindStunnelUtility.kt b/base/src/main/java/com/windscribe/vpn/backend/openvpn/WindStunnelUtility.kt index 2d79a41e1..c84e222b9 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/openvpn/WindStunnelUtility.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/openvpn/WindStunnelUtility.kt @@ -18,7 +18,7 @@ import org.slf4j.Logger import org.slf4j.LoggerFactory object WindStunnelUtility { - var logger: Logger = LoggerFactory.getLogger("wind_stunnel_util") + var logger: Logger = LoggerFactory.getLogger("vpn") val isStunnelRunning: Boolean get() = File(appContext.filesDir.path + "/" + VpnPreferenceConstants.STUNNEL_PID) .exists() diff --git a/base/src/main/java/com/windscribe/vpn/backend/utils/VPNPermissionActivity.kt b/base/src/main/java/com/windscribe/vpn/backend/utils/VPNPermissionActivity.kt index d8f8bce4f..70849f026 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/utils/VPNPermissionActivity.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/utils/VPNPermissionActivity.kt @@ -34,7 +34,7 @@ import javax.inject.Inject class VPNPermissionActivity : Activity() { private var cmFixed = false - private val logger = LoggerFactory.getLogger("vpn_backend") + private val logger = LoggerFactory.getLogger("vpn") @Inject lateinit var vpnConnectionStateManager: VPNConnectionStateManager @@ -69,15 +69,18 @@ class VPNPermissionActivity : Activity() { val action = intent.getStringExtra(QUICK_CONNECT_ACTION_KEY) when (action) { DynamicShortcutManager.QUICK_CONNECT_ACTION -> { + appContext.preference.globalUserConnectionPreference = true vpnController.connectAsync() } DynamicShortcutManager.RECENT_CONNECT_ACTION -> { val connectId = intent.getIntExtra(DynamicShortcutManager.RECENT_CONNECT_ID, -1) locationRepository.setSelectedCity(connectId) setupLocationTypeInt() + appContext.preference.globalUserConnectionPreference = true vpnController.connectAsync() } else -> { + appContext.preference.globalUserConnectionPreference = false vpnController.disconnectAsync() } } @@ -112,7 +115,6 @@ class VPNPermissionActivity : Activity() { finish() } else { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - logger.debug("requesting notification permission.") requestPermissions( arrayOf(Manifest.permission.POST_NOTIFICATIONS), NOTIFICATION ) diff --git a/base/src/main/java/com/windscribe/vpn/backend/utils/VPNProfileCreator.kt b/base/src/main/java/com/windscribe/vpn/backend/utils/VPNProfileCreator.kt index 2c2ea21ed..f83b7d7cf 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/utils/VPNProfileCreator.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/utils/VPNProfileCreator.kt @@ -72,7 +72,7 @@ class VPNProfileCreator @Inject constructor( private val proxyDNSManager: ProxyDNSManager ) { - private val logger = LoggerFactory.getLogger("profile_creator") + private val logger = LoggerFactory.getLogger("vpn") var wgForceInit = AtomicBoolean(false) private val publicIpV4Array = arrayOf( "0.0.0.0/5", "8.0.0.0/7", "11.0.0.0/8", "12.0.0.0/6", diff --git a/base/src/main/java/com/windscribe/vpn/backend/utils/WindNotificationBuilder.kt b/base/src/main/java/com/windscribe/vpn/backend/utils/WindNotificationBuilder.kt index 3a2aef31b..c0f785f09 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/utils/WindNotificationBuilder.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/utils/WindNotificationBuilder.kt @@ -46,7 +46,7 @@ class WindNotificationBuilder @Inject constructor( private var lastUpdateTime = System.currentTimeMillis() private var trafficStats: String? = null - private var logger = LoggerFactory.getLogger("notification_builder") + private var logger = LoggerFactory.getLogger("vpn") fun buildNotification(status: Status): Notification { val location = notificationTitle @@ -83,7 +83,6 @@ class WindNotificationBuilder @Inject constructor( try { notificationManager.cancel(notificationId) notificationManager.cancelAll() - logger.debug("Cancelled sticky notification.") } catch (e: Exception) { logger.debug(e.toString()) } @@ -180,7 +179,6 @@ class WindNotificationBuilder @Inject constructor( if (it.status === Disconnected) { trafficStats = null lastUpdateTime = System.currentTimeMillis() - logger.debug("Cancelling notification on disconnect.") notificationManager.cancel(NotificationConstants.SERVICE_NOTIFICATION_ID) } else { notificationManager.notify( diff --git a/base/src/main/java/com/windscribe/vpn/backend/utils/WindVpnController.kt b/base/src/main/java/com/windscribe/vpn/backend/utils/WindVpnController.kt index 399487150..3d966821d 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/utils/WindVpnController.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/utils/WindVpnController.kt @@ -74,7 +74,7 @@ open class WindVpnController @Inject constructor( ) { - private val logger = LoggerFactory.getLogger("controller_v") + private val logger = LoggerFactory.getLogger("vpn") private var isConnecting = false private suspend fun createVPNProfile( @@ -295,7 +295,6 @@ open class WindVpnController @Inject constructor( logger.debug("Protocol: $protocolInformation") val profileToConnect = createVPNProfile(protocolInformation, attempt) logger.debug("Location: $profileToConnect") - logger.debug("Selecting VPN service to launch.") launchVPNService(protocolInformation, connectionId) } catch (e: Exception) { if (e is InvalidVPNConfigException) { @@ -364,7 +363,6 @@ open class WindVpnController @Inject constructor( // Force disconnect if state did not change to disconnect vpnConnectionStateManager.setState(VPNState(Disconnected, error = error), true) delay(100) - logger.debug("Force disconnected") } checkForReconnect() } diff --git a/base/src/main/java/com/windscribe/vpn/backend/wireguard/WireGuardWrapperService.kt b/base/src/main/java/com/windscribe/vpn/backend/wireguard/WireGuardWrapperService.kt index 0d2b7f809..757bfcb64 100644 --- a/base/src/main/java/com/windscribe/vpn/backend/wireguard/WireGuardWrapperService.kt +++ b/base/src/main/java/com/windscribe/vpn/backend/wireguard/WireGuardWrapperService.kt @@ -45,7 +45,7 @@ class WireGuardWrapperService : GoBackend.VpnService() { @Inject lateinit var preferencesHelper: PreferencesHelper - private var logger = LoggerFactory.getLogger("vpn_backend") + private var logger = LoggerFactory.getLogger("vpn") override fun onCreate() { Windscribe.appContext.serviceComponent.inject(this) diff --git a/base/src/main/java/com/windscribe/vpn/bootreceiver/BootSessionService.kt b/base/src/main/java/com/windscribe/vpn/bootreceiver/BootSessionService.kt index 25b3c8440..7c38d72ff 100644 --- a/base/src/main/java/com/windscribe/vpn/bootreceiver/BootSessionService.kt +++ b/base/src/main/java/com/windscribe/vpn/bootreceiver/BootSessionService.kt @@ -26,7 +26,7 @@ class BootSessionService : JobIntentWorkAroundService() { @Inject lateinit var shortcutStateManager: ShortcutStateManager - private val logger = LoggerFactory.getLogger("boot_session_s") + private val logger = LoggerFactory.getLogger("vpn") private val stateBoolean = AtomicBoolean() override fun onCreate() { super.onCreate() diff --git a/base/src/main/java/com/windscribe/vpn/commonutils/LowerCaseLevelConverter.kt b/base/src/main/java/com/windscribe/vpn/commonutils/LowerCaseLevelConverter.kt new file mode 100644 index 000000000..c005b4dae --- /dev/null +++ b/base/src/main/java/com/windscribe/vpn/commonutils/LowerCaseLevelConverter.kt @@ -0,0 +1,10 @@ +package com.windscribe.vpn.commonutils + +import ch.qos.logback.classic.pattern.ClassicConverter +import ch.qos.logback.classic.spi.ILoggingEvent + +class LowerCaseLevelConverter: ClassicConverter() { + override fun convert(event: ILoggingEvent): String { + return event.level.toString().lowercase() + } +} \ No newline at end of file diff --git a/base/src/main/java/com/windscribe/vpn/commonutils/RegionLocator.kt b/base/src/main/java/com/windscribe/vpn/commonutils/RegionLocator.kt index f0ab82d17..380247cc0 100644 --- a/base/src/main/java/com/windscribe/vpn/commonutils/RegionLocator.kt +++ b/base/src/main/java/com/windscribe/vpn/commonutils/RegionLocator.kt @@ -11,7 +11,7 @@ import org.slf4j.LoggerFactory object RegionLocator { - val logger: Logger = LoggerFactory.getLogger("region_locator") + val logger: Logger = LoggerFactory.getLogger("util") fun matchesCountryCode(code: String): Boolean { val manager = appContext.getSystemService(TELEPHONY_SERVICE) as TelephonyManager diff --git a/base/src/main/java/com/windscribe/vpn/constants/NetworkKeyConstants.kt b/base/src/main/java/com/windscribe/vpn/constants/NetworkKeyConstants.kt index d3653584f..f235c2aa7 100644 --- a/base/src/main/java/com/windscribe/vpn/constants/NetworkKeyConstants.kt +++ b/base/src/main/java/com/windscribe/vpn/constants/NetworkKeyConstants.kt @@ -34,6 +34,8 @@ object NetworkKeyConstants { const val PORT_MAP_VERSION = 5 const val URL_DISCORD = "https://discord.com/invite/vpn" const val URL_REDDIT = "https://www.reddit.com/r/Windscribe/" + const val URL_YOUTUBE = "https://www.youtube.com/c/Windscribe" + const val URL_X = "https://x.com/windscribecom" const val URL_GARRY = "/support?garry=1" const val URL_KNOWLEDGE = "/support/knowledgebase" const val URL_STATUS = "/status" diff --git a/base/src/main/java/com/windscribe/vpn/constants/PreferencesKeyConstants.kt b/base/src/main/java/com/windscribe/vpn/constants/PreferencesKeyConstants.kt index 38ea8622b..26c57c053 100644 --- a/base/src/main/java/com/windscribe/vpn/constants/PreferencesKeyConstants.kt +++ b/base/src/main/java/com/windscribe/vpn/constants/PreferencesKeyConstants.kt @@ -15,7 +15,6 @@ object PreferencesKeyConstants { const val OPEN_VPN_SERVER_CONFIG = "server_config" const val OPEN_VPN_CREDENTIALS = "server_credentials" const val IKEV2_CREDENTIALS = "IKev2_server_credentials" - const val NEWS_FEED_RESPONSE = "news_feed_response" const val NEWS_FEED_ALERT = "news_feed_alert" const val NEW_INSTALLATION = "new_installation" const val I_NEW = "new" diff --git a/base/src/main/java/com/windscribe/vpn/decoytraffic/DecoyTrafficController.kt b/base/src/main/java/com/windscribe/vpn/decoytraffic/DecoyTrafficController.kt index 2feca0fa9..1e6828822 100644 --- a/base/src/main/java/com/windscribe/vpn/decoytraffic/DecoyTrafficController.kt +++ b/base/src/main/java/com/windscribe/vpn/decoytraffic/DecoyTrafficController.kt @@ -23,7 +23,7 @@ class DecoyTrafficController(val scope: CoroutineScope, val apiCallManager: IApi private var fakeTrafficVolume = 0 private var sendTrafficRequestInProgress = false private var sendTrafficIntervalInSeconds = 1 - private val logger = LoggerFactory.getLogger("decoy_traffic_controller") + private val logger = LoggerFactory.getLogger("vpn") private var _events = MutableStateFlow(preferencesHelper.isDecoyTrafficOn) val state: StateFlow = _events private var fakeTraffic = preferencesHelper.fakeTrafficVolume diff --git a/base/src/main/java/com/windscribe/vpn/di/BaseApplicationModule.kt b/base/src/main/java/com/windscribe/vpn/di/BaseApplicationModule.kt index 0102952e4..cafbac843 100644 --- a/base/src/main/java/com/windscribe/vpn/di/BaseApplicationModule.kt +++ b/base/src/main/java/com/windscribe/vpn/di/BaseApplicationModule.kt @@ -8,7 +8,7 @@ import androidx.core.app.NotificationCompat import androidx.room.Room import androidx.room.RoomDatabase import androidx.sqlite.db.SupportSQLiteDatabase -import com.windscribe.vpn.BuildConfig +import com.windscribe.vpn.BuildConfig.DEV import com.windscribe.vpn.ServiceInteractor import com.windscribe.vpn.ServiceInteractorImpl import com.windscribe.vpn.Windscribe @@ -101,7 +101,7 @@ import javax.inject.Singleton @Module open class BaseApplicationModule { - private val logger = LoggerFactory.getLogger("di_") + private val logger = LoggerFactory.getLogger("wsnet") open lateinit var windscribeApp: Windscribe @@ -206,7 +206,8 @@ open class BaseApplicationModule { } }).addMigrations(Migrations.migration_26_27).addMigrations(Migrations.migration_27_28) .addMigrations(Migrations.migration_29_31) - .addMigrations(Migrations.migration_33_34).build() + .addMigrations(Migrations.migration_33_34) + .addMigrations(Migrations.migration_34_35).build() } @@ -787,7 +788,7 @@ open class BaseApplicationModule { WSNet.setLogger({ val msg = it.split(Regex("\\]\\s*")).lastOrNull()?.trim() ?: "" logger.debug(msg) - }, BuildConfig.DEV) + }, DEV) if (preferencesHelper.getDeviceUUID() == null) { preferencesHelper.setDeviceUUID(UUID.randomUUID().toString()) } @@ -796,7 +797,7 @@ open class BaseApplicationModule { } else { appContext.resources.configuration.locale.language.substring(0..1) } - WSNet.initialize("android", "android", WindUtilities.getVersionName(), preferencesHelper.getDeviceUUID() ?: "", "2.6.0", "4", BuildConfig.DEV, systemLanguageCode, preferencesHelper.wsNetSettings) + WSNet.initialize("android", "android", WindUtilities.getVersionName(), preferencesHelper.getDeviceUUID() ?: "", "2.6.0", "4", DEV, systemLanguageCode, preferencesHelper.wsNetSettings) val networkListener = object : DeviceStateManager.DeviceStateListener { override fun onNetworkStateChanged() { super.onNetworkStateChanged() diff --git a/base/src/main/java/com/windscribe/vpn/localdatabase/Migrations.java b/base/src/main/java/com/windscribe/vpn/localdatabase/Migrations.java index d006d8589..f0b175000 100644 --- a/base/src/main/java/com/windscribe/vpn/localdatabase/Migrations.java +++ b/base/src/main/java/com/windscribe/vpn/localdatabase/Migrations.java @@ -63,6 +63,16 @@ public void migrate(@NonNull final SupportSQLiteDatabase database) { } }; + public static final Migration migration_34_35 = new Migration(34, 35) { + @Override + public void migrate(@NonNull final SupportSQLiteDatabase database) { + database.execSQL("ALTER TABLE StaticRegion" + + " ADD COLUMN status INTEGER"); + invalidateData(); + logger.debug("Migrated database from version:34 to version:35"); + } + }; + private static void invalidateData() { Windscribe.getAppContext().getPreference().setMigrationRequired(true); } diff --git a/base/src/main/java/com/windscribe/vpn/localdatabase/WindscribeDatabase.java b/base/src/main/java/com/windscribe/vpn/localdatabase/WindscribeDatabase.java index 18810debb..f3bffe581 100644 --- a/base/src/main/java/com/windscribe/vpn/localdatabase/WindscribeDatabase.java +++ b/base/src/main/java/com/windscribe/vpn/localdatabase/WindscribeDatabase.java @@ -34,7 +34,7 @@ @Database(entities = {PingTestResults.class, UserStatusTable.class, ServerStatusUpdateTable.class, PopupNotificationTable.class, Region.class, City.class, Favourite.class, PingTime.class, StaticRegion.class, NetworkInfo.class, ConfigFile.class, - WindNotification.class}, version = 34) + WindNotification.class}, version = 35) @Singleton public abstract class WindscribeDatabase extends RoomDatabase { diff --git a/base/src/main/java/com/windscribe/vpn/mocklocation/MockLocationManager.kt b/base/src/main/java/com/windscribe/vpn/mocklocation/MockLocationManager.kt index d0ac5af37..ef3c7ab7b 100644 --- a/base/src/main/java/com/windscribe/vpn/mocklocation/MockLocationManager.kt +++ b/base/src/main/java/com/windscribe/vpn/mocklocation/MockLocationManager.kt @@ -22,7 +22,7 @@ import javax.inject.Singleton @Singleton class MockLocationManager(val context: Context, val scope: CoroutineScope, val vpnConnectionStateManager: VPNConnectionStateManager, val preferencesHelper: PreferencesHelper) { - private val logger = LoggerFactory.getLogger("mock_location") + private val logger = LoggerFactory.getLogger("state") private var mockGps: MockLocationProvider? = null private var mockNetwork: MockLocationProvider? = null private var pushLocationJob: Job? = null @@ -62,7 +62,6 @@ class MockLocationManager(val context: Context, val scope: CoroutineScope, val v fun init() { scope.launch { - logger.info("Initiating mock location controller.") vpnConnectionStateManager.state.collectLatest { state -> if (state.status == VPNState.Status.Disconnected || !preferencesHelper.isGpsSpoofingOn) { stop() @@ -71,7 +70,6 @@ class MockLocationManager(val context: Context, val scope: CoroutineScope, val v val latitude = it.lat?.toDoubleOrNull() val longitude = it.lang?.toDoubleOrNull() if (latitude != null && longitude != null) { - logger.info("Starting mock location providers.") start(latitude, longitude) } } diff --git a/base/src/main/java/com/windscribe/vpn/repository/ConnectionDataRepository.kt b/base/src/main/java/com/windscribe/vpn/repository/ConnectionDataRepository.kt index f205373f8..bb7f5db29 100644 --- a/base/src/main/java/com/windscribe/vpn/repository/ConnectionDataRepository.kt +++ b/base/src/main/java/com/windscribe/vpn/repository/ConnectionDataRepository.kt @@ -27,7 +27,7 @@ class ConnectionDataRepository @Inject constructor( private val apiCallManager: IApiCallManager, private val autoConnectionManager: Lazy ) { - private val logger = LoggerFactory.getLogger("connection_data_updater") + private val logger = LoggerFactory.getLogger("data") suspend fun updateConnectionData() { update().await() diff --git a/base/src/main/java/com/windscribe/vpn/repository/EmergencyConnectRepository.kt b/base/src/main/java/com/windscribe/vpn/repository/EmergencyConnectRepository.kt index cbca56877..347032a43 100644 --- a/base/src/main/java/com/windscribe/vpn/repository/EmergencyConnectRepository.kt +++ b/base/src/main/java/com/windscribe/vpn/repository/EmergencyConnectRepository.kt @@ -15,11 +15,6 @@ interface EmergencyConnectRepository { * Implementation of emergency connect repository. */ class EmergencyConnectRepositoryImpl(private val emergencyConnect: WSNetEmergencyConnect) : EmergencyConnectRepository { - private val logger = LoggerFactory.getLogger("e_connect_r") - - init { - logger.debug("Initializing Emergency connect repository.") - } /** Get emergency connect profiles. * @return diff --git a/base/src/main/java/com/windscribe/vpn/repository/IpRepository.kt b/base/src/main/java/com/windscribe/vpn/repository/IpRepository.kt index 998439e40..b4688a5e9 100644 --- a/base/src/main/java/com/windscribe/vpn/repository/IpRepository.kt +++ b/base/src/main/java/com/windscribe/vpn/repository/IpRepository.kt @@ -20,7 +20,7 @@ class IpRepository( private val apiCallManagerV2: IApiCallManager, private val vpnConnectionStateManager: VPNConnectionStateManager ) { - private val logger = LoggerFactory.getLogger("ip_repository") + private val logger = LoggerFactory.getLogger("data") private val _state = MutableSharedFlow>() val state = _state @@ -79,7 +79,6 @@ class IpRepository( ipAddress = ipAddress.replace("000".toRegex(), "") ipAddress = ipAddress.replace("00".toRegex(), "") } else { - logger.info("Saving Ipv4 address...") ipAddress = ipResponse } return ipAddress diff --git a/base/src/main/java/com/windscribe/vpn/repository/LatencyRepository.kt b/base/src/main/java/com/windscribe/vpn/repository/LatencyRepository.kt index 4e99e218a..d0163d8be 100644 --- a/base/src/main/java/com/windscribe/vpn/repository/LatencyRepository.kt +++ b/base/src/main/java/com/windscribe/vpn/repository/LatencyRepository.kt @@ -56,7 +56,7 @@ class LatencyRepository @Inject constructor( companion object { const val MINIMUM_PING_VALIDATION_MINUTES = 5 } - private val logger = LoggerFactory.getLogger("latency") + private val logger = LoggerFactory.getLogger("ping") private var _latencyEvent = MutableStateFlow(Pair(false, LatencyType.Servers)) val latencyEvent: StateFlow> = _latencyEvent.asStateFlow() private val skipPing diff --git a/base/src/main/java/com/windscribe/vpn/repository/LocationRepository.kt b/base/src/main/java/com/windscribe/vpn/repository/LocationRepository.kt index c021bf5a8..f1be91ffa 100644 --- a/base/src/main/java/com/windscribe/vpn/repository/LocationRepository.kt +++ b/base/src/main/java/com/windscribe/vpn/repository/LocationRepository.kt @@ -41,7 +41,7 @@ class LocationRepository @Inject constructor( private val localDbInterface: LocalDbInterface, private val userRepository: Lazy ) { - private val logger = LoggerFactory.getLogger("selected_location_updater") + private val logger = LoggerFactory.getLogger("data") private var _selectedCityEvents = MutableStateFlow(preferencesHelper.selectedCity) val selectedCity: StateFlow = _selectedCityEvents @@ -140,8 +140,6 @@ class LocationRepository @Inject constructor( get() = localDbInterface.lowestPingId .flatMap { localDbInterface.getCityByID(it) } .flatMap { city: City -> Single.fromCallable { city.getId() } } - .doOnError { logger.debug("Still waiting for latency to complete.") } - .doOnSuccess { city: Int -> logger.debug("Found lowest ping city: $city") } private val randomLocation: Single get() { diff --git a/base/src/main/java/com/windscribe/vpn/repository/NotificationRepository.kt b/base/src/main/java/com/windscribe/vpn/repository/NotificationRepository.kt index 24203a51e..c98c45083 100644 --- a/base/src/main/java/com/windscribe/vpn/repository/NotificationRepository.kt +++ b/base/src/main/java/com/windscribe/vpn/repository/NotificationRepository.kt @@ -20,7 +20,7 @@ class NotificationRepository @Inject constructor( private val apiCallManager: IApiCallManager, private val localDbInterface: LocalDbInterface ) { - private val logger = LoggerFactory.getLogger("notification_updater") + private val logger = LoggerFactory.getLogger("data") fun update(): Completable { logger.debug("Starting notification data update.") return apiCallManager.getNotifications(appContext.appLifeCycleObserver.pushNotificationAction?.pcpID) diff --git a/base/src/main/java/com/windscribe/vpn/repository/ServerListRepository.kt b/base/src/main/java/com/windscribe/vpn/repository/ServerListRepository.kt index d3b24fd5a..0ae17254e 100644 --- a/base/src/main/java/com/windscribe/vpn/repository/ServerListRepository.kt +++ b/base/src/main/java/com/windscribe/vpn/repository/ServerListRepository.kt @@ -40,7 +40,7 @@ class ServerListRepository @Inject constructor( private val advanceParameterRepository: AdvanceParameterRepository, private val preferenceHelper: PreferencesHelper ) { - private val logger = LoggerFactory.getLogger("server_list_repository") + private val logger = LoggerFactory.getLogger("data") private var _events = MutableSharedFlow>(replay = 1) val regions: SharedFlow> = _events private var _locationUIInvalidation = MutableSharedFlow(replay = 1) @@ -138,7 +138,6 @@ class ServerListRepository @Inject constructor( } private fun addToDatabase(regions: List): Completable { - logger.debug("Saving server list to database") val cities: MutableList = ArrayList() for (region in regions) { if (region.getCities() != null) { @@ -154,7 +153,6 @@ class ServerListRepository @Inject constructor( preferenceChangeObserver.postCityServerChange() load() }) - .doOnError { logger.debug("Error saving server list to database") } } diff --git a/base/src/main/java/com/windscribe/vpn/repository/UserRepository.kt b/base/src/main/java/com/windscribe/vpn/repository/UserRepository.kt index b79797a5e..4aa241221 100644 --- a/base/src/main/java/com/windscribe/vpn/repository/UserRepository.kt +++ b/base/src/main/java/com/windscribe/vpn/repository/UserRepository.kt @@ -33,12 +33,11 @@ class UserRepository( private val autoConnectionManager: AutoConnectionManager ) { var user = MutableLiveData() - private val logger = LoggerFactory.getLogger("user_repo") + private val logger = LoggerFactory.getLogger("data") private val _userInfo = MutableSharedFlow(replay = 1) val userInfo: SharedFlow = _userInfo init { - logger.debug("Starting user repository.") reload() } @@ -56,7 +55,6 @@ class UserRepository( callback?.invoke(newUser) } ?: kotlin.run { try { - logger.debug("Loading user info from cache") val cachedSessionResponse = serviceInteractor.preferenceHelper.getResponseString(PreferencesKeyConstants.GET_SESSION) val userSession = @@ -64,7 +62,7 @@ class UserRepository( user.postValue(User(userSession)) _userInfo.emit(User(userSession)) } catch (ignored: Exception) { - logger.debug("No user is logged in.") + logger.info("No user is logged in.") } } } @@ -80,7 +78,7 @@ class UserRepository( user.postValue(User(userSession)) _userInfo.tryEmit(User(userSession)) } catch (ignored: Exception) { - logger.debug("No user is logged in.") + logger.info("No user is logged in.") } } diff --git a/base/src/main/java/com/windscribe/vpn/repository/WgConfigRepository.kt b/base/src/main/java/com/windscribe/vpn/repository/WgConfigRepository.kt index 370de37c3..6133bb60d 100644 --- a/base/src/main/java/com/windscribe/vpn/repository/WgConfigRepository.kt +++ b/base/src/main/java/com/windscribe/vpn/repository/WgConfigRepository.kt @@ -28,7 +28,7 @@ import javax.inject.Singleton @Singleton class WgConfigRepository(val scope: CoroutineScope, val interactor: ServiceInteractor) { - private val logger = LoggerFactory.getLogger("wg_config_repo") + private val logger = LoggerFactory.getLogger("data") fun deleteKeys() { logger.debug("Deleting cached wg params.") diff --git a/base/src/main/java/com/windscribe/vpn/serverlist/entity/StaticRegion.java b/base/src/main/java/com/windscribe/vpn/serverlist/entity/StaticRegion.java index cb208b404..3e68399b1 100644 --- a/base/src/main/java/com/windscribe/vpn/serverlist/entity/StaticRegion.java +++ b/base/src/main/java/com/windscribe/vpn/serverlist/entity/StaticRegion.java @@ -84,6 +84,10 @@ public class StaticRegion { @Expose private String pingHost; + @SerializedName("status") + @Expose + private Integer status; + public String getCityName() { return cityName; } @@ -217,6 +221,11 @@ public void setPingHost(@Nullable String pingHost) { this.pingHost = pingHost; } + @Nullable + public Integer getStatus() { return status; } + + public void setStatus(@Nullable Integer status) { this.status = status; } + @NonNull @Override public String toString() { @@ -235,6 +244,7 @@ public String toString() { ", deviceName='" + deviceName + '\'' + ", OvpnX509='" + ovpnX509 + '\'' + ", pingHost='" + pingHost + '\'' + + ", status='" + status + '\'' + '}'; } diff --git a/base/src/main/java/com/windscribe/vpn/serverlist/interfaces/ListViewClickListener.kt b/base/src/main/java/com/windscribe/vpn/serverlist/interfaces/ListViewClickListener.kt index c18c993a6..6b0843016 100644 --- a/base/src/main/java/com/windscribe/vpn/serverlist/interfaces/ListViewClickListener.kt +++ b/base/src/main/java/com/windscribe/vpn/serverlist/interfaces/ListViewClickListener.kt @@ -14,7 +14,7 @@ interface ListViewClickListener { fun onCityClick(cityId: Int) fun onConfigFileClicked(configFile: ConfigFile) fun onStaticIpClick(staticIpId: Int) - fun onUnavailableRegion() + fun onUnavailableRegion(isStaticIP: Boolean) fun removeFromFavourite(cityId: Int, position: Int, adapter: RecyclerView.Adapter) fun setScrollTo(scrollTo: Int) } \ No newline at end of file diff --git a/base/src/main/java/com/windscribe/vpn/services/AutoConnectService.kt b/base/src/main/java/com/windscribe/vpn/services/AutoConnectService.kt index a63dd15d4..239f7d967 100644 --- a/base/src/main/java/com/windscribe/vpn/services/AutoConnectService.kt +++ b/base/src/main/java/com/windscribe/vpn/services/AutoConnectService.kt @@ -56,7 +56,7 @@ class AutoConnectService : Service(), NetworkInfoListener { private var serviceScope = CoroutineScope(Dispatchers.Main + Job()) - private var logger = LoggerFactory.getLogger("auto_connect_s") + private var logger = LoggerFactory.getLogger("vpn") companion object { var isAutoConnectingServiceRunning = false diff --git a/base/src/main/java/com/windscribe/vpn/services/DeviceStateService.kt b/base/src/main/java/com/windscribe/vpn/services/DeviceStateService.kt index b2b0e9ce3..225713b3c 100644 --- a/base/src/main/java/com/windscribe/vpn/services/DeviceStateService.kt +++ b/base/src/main/java/com/windscribe/vpn/services/DeviceStateService.kt @@ -40,7 +40,7 @@ class DeviceStateService : JobIntentWorkAroundService() { @Inject lateinit var vpnConnectionStateManager: VPNConnectionStateManager - private val logger = LoggerFactory.getLogger("network_status") + private val logger = LoggerFactory.getLogger("vpn") private val stateBoolean = AtomicBoolean() private val compositeDisposable = CompositeDisposable() override fun onCreate() { diff --git a/base/src/main/java/com/windscribe/vpn/services/DisconnectService.kt b/base/src/main/java/com/windscribe/vpn/services/DisconnectService.kt index 974c3b261..dc1f41378 100644 --- a/base/src/main/java/com/windscribe/vpn/services/DisconnectService.kt +++ b/base/src/main/java/com/windscribe/vpn/services/DisconnectService.kt @@ -29,7 +29,7 @@ class DisconnectService : IntentService("DisconnectService") { @Inject lateinit var scope: CoroutineScope - private val logger = LoggerFactory.getLogger("disconnect_service") + private val logger = LoggerFactory.getLogger("vpn") override fun onCreate() { super.onCreate() diff --git a/base/src/main/java/com/windscribe/vpn/services/NetworkWhiteListService.kt b/base/src/main/java/com/windscribe/vpn/services/NetworkWhiteListService.kt index ee14b456c..fd4012ca2 100644 --- a/base/src/main/java/com/windscribe/vpn/services/NetworkWhiteListService.kt +++ b/base/src/main/java/com/windscribe/vpn/services/NetworkWhiteListService.kt @@ -126,7 +126,7 @@ class NetworkWhiteListService : Service(), NetworkInfoListener { const val UNSECURED_NETWORK_ACTION = "unsecured_network_action" const val DISCONNECT_ACTION = "disconnect_action" - private const val TAG = "check_network_service" + private const val TAG = "vpn" fun startService(context: Context) { val startIntent = Intent(context, NetworkWhiteListService::class.java) startIntent.action = UNSECURED_NETWORK_ACTION diff --git a/base/src/main/java/com/windscribe/vpn/services/VpnTileService.kt b/base/src/main/java/com/windscribe/vpn/services/VpnTileService.kt index 01339cff2..4e0952d8b 100644 --- a/base/src/main/java/com/windscribe/vpn/services/VpnTileService.kt +++ b/base/src/main/java/com/windscribe/vpn/services/VpnTileService.kt @@ -44,7 +44,7 @@ class VpnTileService : TileService() { @Inject lateinit var shortcutStateManager: ShortcutStateManager - private val logger = LoggerFactory.getLogger("quick_title_s") + private val logger = LoggerFactory.getLogger("shortcut") override fun onCreate() { super.onCreate() diff --git a/base/src/main/java/com/windscribe/vpn/state/AppLifeCycleObserver.kt b/base/src/main/java/com/windscribe/vpn/state/AppLifeCycleObserver.kt index 33e75fe25..5a0360ffd 100644 --- a/base/src/main/java/com/windscribe/vpn/state/AppLifeCycleObserver.kt +++ b/base/src/main/java/com/windscribe/vpn/state/AppLifeCycleObserver.kt @@ -70,7 +70,6 @@ class AppLifeCycleObserver @Inject constructor( logger.debug("----------------App moved to Foreground.------------\n") } if (appContext.vpnConnectionStateManager.isVPNConnected().not()) { - logger.debug("Resetting server list country code.") overriddenCountryCode = null } networkInfoManager.reload() diff --git a/base/src/main/java/com/windscribe/vpn/state/DeviceStateManager.kt b/base/src/main/java/com/windscribe/vpn/state/DeviceStateManager.kt index b2d10a5c0..97a0353de 100644 --- a/base/src/main/java/com/windscribe/vpn/state/DeviceStateManager.kt +++ b/base/src/main/java/com/windscribe/vpn/state/DeviceStateManager.kt @@ -28,7 +28,7 @@ class DeviceStateManager @Inject constructor(val scope: CoroutineScope) : Broadc private val listeners = ConcurrentLinkedQueue() private var _deviceInteractiveEvents = MutableStateFlow(false) val isDeviceInteractive: StateFlow = _deviceInteractiveEvents - private val logger = LoggerFactory.getLogger("device_state") + private val logger = LoggerFactory.getLogger("state") fun addListener(deviceStateListener: DeviceStateListener) { listeners.add(deviceStateListener) diff --git a/base/src/main/java/com/windscribe/vpn/state/DynamicShortcutManager.kt b/base/src/main/java/com/windscribe/vpn/state/DynamicShortcutManager.kt index 58cc843fa..b1a776463 100644 --- a/base/src/main/java/com/windscribe/vpn/state/DynamicShortcutManager.kt +++ b/base/src/main/java/com/windscribe/vpn/state/DynamicShortcutManager.kt @@ -41,7 +41,7 @@ class DynamicShortcutManager(private val context: Context, private val scope: Co const val RECENT_DATE_KEY = "ws_recent_date_key" } - private val logger = LoggerFactory.getLogger("shortcut_m") + private val logger = LoggerFactory.getLogger("shortcut") init { listenForVPNState() @@ -139,7 +139,6 @@ class DynamicShortcutManager(private val context: Context, private val scope: Co putExtra(RECENT_CONNECT_ID, selectedLocation.cityId) putExtra(RECENT_LOCATION_TYPE_INT, locationTypeInt.ordinal) } - logger.debug("****Ordinal ${locationTypeInt.ordinal}") val latestShortcut = ShortcutInfoCompat.Builder(context, shortcutID) .setShortLabel("${selectedLocation.nodeName} ${selectedLocation.nickName}") .setIcon(IconCompat.createWithResource(context, FlagIconResource.getSmallFlag(selectedLocation.countryCode))) @@ -168,8 +167,7 @@ class DynamicShortcutManager(private val context: Context, private val scope: Co .setExtras(v.extras ?: PersistableBundle.EMPTY) .setRank(index + 2) .build() - val added = ShortcutManagerCompat.pushDynamicShortcut(context, updated) - logger.debug("Pushing shortcut - ${updated.shortLabel} at index ${index + 2} Result: $added") + val ignored = ShortcutManagerCompat.pushDynamicShortcut(context, updated) } } diff --git a/base/src/main/java/com/windscribe/vpn/state/ShortcutStateManager.kt b/base/src/main/java/com/windscribe/vpn/state/ShortcutStateManager.kt index e49533749..07ebe450b 100644 --- a/base/src/main/java/com/windscribe/vpn/state/ShortcutStateManager.kt +++ b/base/src/main/java/com/windscribe/vpn/state/ShortcutStateManager.kt @@ -18,7 +18,7 @@ class ShortcutStateManager( private val interactor: ServiceInteractor, private val windVpnController: WindVpnController ) { - private var logger = LoggerFactory.getLogger("shortcut_manager") + private var logger = LoggerFactory.getLogger("shortcut") private var initilized = false fun connect() { if (initilized) { diff --git a/base/src/main/java/com/windscribe/vpn/state/VPNConnectionStateManager.kt b/base/src/main/java/com/windscribe/vpn/state/VPNConnectionStateManager.kt index cbe2ec365..123b8c313 100644 --- a/base/src/main/java/com/windscribe/vpn/state/VPNConnectionStateManager.kt +++ b/base/src/main/java/com/windscribe/vpn/state/VPNConnectionStateManager.kt @@ -29,7 +29,7 @@ import javax.inject.Singleton @Singleton class VPNConnectionStateManager(val scope: CoroutineScope, val autoConnectionManager: AutoConnectionManager, val preferencesHelper: PreferencesHelper, val userRepository: Lazy) { - private val logger = LoggerFactory.getLogger("vpn_backend") + private val logger = LoggerFactory.getLogger("vpn") private val _events = MutableStateFlow(VPNState(Disconnected)) val state: StateFlow = _events diff --git a/base/src/main/java/com/windscribe/vpn/workers/WindScribeWorkManager.kt b/base/src/main/java/com/windscribe/vpn/workers/WindScribeWorkManager.kt index 962c31931..7b3f8152c 100644 --- a/base/src/main/java/com/windscribe/vpn/workers/WindScribeWorkManager.kt +++ b/base/src/main/java/com/windscribe/vpn/workers/WindScribeWorkManager.kt @@ -27,19 +27,16 @@ import javax.inject.Singleton @Singleton class WindScribeWorkManager(private val context: Context, private val scope: CoroutineScope, private val vpnConnectionStateManager: VPNConnectionStateManager, val preferencesHelper: PreferencesHelper) { private var foregroundSessionUpdateJob: Job? = null - private var logger = LoggerFactory.getLogger("work_manager") + private var logger = LoggerFactory.getLogger("worker") fun onAppStart() { if (preferencesHelper.sessionHash == null) return - logger.debug("Starting one time work requests") // One time val data = Data.Builder().putBoolean("forceUpdate", true).build() updateSession(data) // Hourly - logger.debug("Starting hourly work requests") WorkManager.getInstance(context).enqueueUniquePeriodicWork(NOTIFICATION_HOURLY_WORKER_KEY, REPLACE, createPeriodicWorkerRequest(NotificationWorker::class.java, HOURS)) WorkManager.getInstance(context).enqueueUniquePeriodicWork(SESSION_HOURLY_WORKER_KEY, REPLACE, createPeriodicWorkerRequest(SessionWorker::class.java, HOURS)) // Every day - logger.debug("Starting every day work requests") WorkManager.getInstance(context).enqueueUniquePeriodicWork(NOTIFICATION_DAY_WORKER_KEY, REPLACE, createPeriodicWorkerRequest(NotificationWorker::class.java, DAYS)) WorkManager.getInstance(context).enqueueUniquePeriodicWork(SESSION_DAY_WORKER_KEY, REPLACE, createPeriodicWorkerRequest(SessionWorker::class.java, DAYS)) keepSessionUpdated() @@ -47,7 +44,6 @@ class WindScribeWorkManager(private val context: Context, private val scope: Cor fun onAppMovedToForeground() { if (preferencesHelper.sessionHash == null) return - logger.debug("Starting foreground session update") WorkManager.getInstance(context).enqueueUniqueWork(SERVER_LIST_WORKER_KEY, ExistingWorkPolicy.REPLACE, createOneTimeWorkerRequest(SessionWorker::class.java)) keepSessionUpdated() } @@ -56,14 +52,12 @@ class WindScribeWorkManager(private val context: Context, private val scope: Cor foregroundSessionUpdateJob = scope.launch { while (true) { delay(1000 * 60) - logger.debug("Starting foreground session update") WorkManager.getInstance(context).enqueueUniqueWork(SESSION_WORKER_KEY, ExistingWorkPolicy.REPLACE, createOneTimeWorkerRequest(SessionWorker::class.java)) } } } fun onAppMovedToBackground() { - logger.debug("Removed foreground session update.") foregroundSessionUpdateJob?.cancel() } diff --git a/base/src/main/java/com/windscribe/vpn/workers/worker/CredentialsWorker.kt b/base/src/main/java/com/windscribe/vpn/workers/worker/CredentialsWorker.kt index 2c333046e..89c6753aa 100644 --- a/base/src/main/java/com/windscribe/vpn/workers/worker/CredentialsWorker.kt +++ b/base/src/main/java/com/windscribe/vpn/workers/worker/CredentialsWorker.kt @@ -11,7 +11,7 @@ import javax.inject.Inject import org.slf4j.LoggerFactory class CredentialsWorker(appContext: Context, params: WorkerParameters) : CoroutineWorker(appContext, params) { - private val logger = LoggerFactory.getLogger("credentials_updater") + private val logger = LoggerFactory.getLogger("worker") @Inject lateinit var connectionDataRepository: ConnectionDataRepository diff --git a/base/src/main/java/com/windscribe/vpn/workers/worker/NotificationWorker.kt b/base/src/main/java/com/windscribe/vpn/workers/worker/NotificationWorker.kt index b71473e50..aed456de6 100644 --- a/base/src/main/java/com/windscribe/vpn/workers/worker/NotificationWorker.kt +++ b/base/src/main/java/com/windscribe/vpn/workers/worker/NotificationWorker.kt @@ -16,7 +16,7 @@ import org.slf4j.LoggerFactory class NotificationWorker(context: Context, workerParams: WorkerParameters) : CoroutineWorker(context, workerParams) { - private val logger = LoggerFactory.getLogger("notification_updater") + private val logger = LoggerFactory.getLogger("worker") @Inject lateinit var notificationRepository: NotificationRepository @Inject diff --git a/base/src/main/java/com/windscribe/vpn/workers/worker/ServerListWorker.kt b/base/src/main/java/com/windscribe/vpn/workers/worker/ServerListWorker.kt index f8bccb566..11f161f19 100644 --- a/base/src/main/java/com/windscribe/vpn/workers/worker/ServerListWorker.kt +++ b/base/src/main/java/com/windscribe/vpn/workers/worker/ServerListWorker.kt @@ -18,7 +18,7 @@ import org.slf4j.LoggerFactory class ServerListWorker(context: Context, workerParams: WorkerParameters) : CoroutineWorker(context, workerParams) { - private val logger = LoggerFactory.getLogger("server_list_worker") + private val logger = LoggerFactory.getLogger("worker") @Inject lateinit var serverListRepository: ServerListRepository diff --git a/base/src/main/java/com/windscribe/vpn/workers/worker/SessionWorker.kt b/base/src/main/java/com/windscribe/vpn/workers/worker/SessionWorker.kt index 5f0d68e80..2adc290a2 100644 --- a/base/src/main/java/com/windscribe/vpn/workers/worker/SessionWorker.kt +++ b/base/src/main/java/com/windscribe/vpn/workers/worker/SessionWorker.kt @@ -33,7 +33,7 @@ import javax.inject.Inject class SessionWorker(context: Context, workerParams: WorkerParameters) : CoroutineWorker(context, workerParams) { - val logger: Logger = LoggerFactory.getLogger("session_worker") + val logger: Logger = LoggerFactory.getLogger("worker") @Inject lateinit var preferencesHelper: PreferencesHelper diff --git a/base/src/main/java/com/windscribe/vpn/workers/worker/StaticIpWorker.kt b/base/src/main/java/com/windscribe/vpn/workers/worker/StaticIpWorker.kt index b38b4212a..a46d1d167 100644 --- a/base/src/main/java/com/windscribe/vpn/workers/worker/StaticIpWorker.kt +++ b/base/src/main/java/com/windscribe/vpn/workers/worker/StaticIpWorker.kt @@ -17,7 +17,7 @@ class StaticIpWorker(context: Context, params: WorkerParameters) : CoroutineWork @Inject lateinit var userRepository: UserRepository - val logger: Logger = LoggerFactory.getLogger("static_ip_repo") + val logger: Logger = LoggerFactory.getLogger("worker") init { appContext.applicationComponent.inject(this) diff --git a/base/src/main/libs/wsnet.aar b/base/src/main/libs/wsnet.aar index 5bf24269c..b69b903ed 100644 Binary files a/base/src/main/libs/wsnet.aar and b/base/src/main/libs/wsnet.aar differ diff --git a/base/src/main/res/drawable/ec.xml b/base/src/main/res/drawable/ec.xml index a7eae04d8..ddfa12082 100644 --- a/base/src/main/res/drawable/ec.xml +++ b/base/src/main/res/drawable/ec.xml @@ -1,34 +1,5974 @@ - - + android:viewportWidth="414" + android:viewportHeight="207"> + + + android:pathData="M0,0H414V207H0V0Z" + android:fillColor="#ED1C24"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + android:strokeColor="#000000"/> + + android:strokeColor="#000000"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + android:pathData="M201.51,59.39C199.99,59.47 198.49,58.46 198.49,58.46C196.6,58.09 196.49,56.38 196.49,56.38C195.73,56.09 195.08,54.15 195.08,54.15C193.91,54.85 192.44,54.16 192.44,54.16C192.44,54.16 192.44,53.87 191.12,54.16C189.8,54.45 190.03,53.91 190.03,53.91C190.03,53.91 190.55,53.38 188.21,53.91C185.87,54.45 188.4,53.21 188.4,53.21C187.72,53.42 185.49,53.58 185.49,53.58C184.68,53.62 183.85,54.02 182.94,54.28C182.38,54.44 181.42,54.63 180.93,54.84C179.63,55.39 177.03,56.59 174.88,57.43C172.05,58.54 169.82,59.38 169.96,59.35C170.14,59.3 173.03,57.47 176.65,55.83C180.01,54.3 183.88,52.89 185.82,52.34C188.35,51.5 190.42,51.9 191.59,52.33C192.16,52.53 195.28,52.23 196.68,52.4C198.08,52.56 198.22,54.86 198.22,54.86C198.49,55.02 198.58,57.18 198.58,57.18C198.58,57.18 197.81,57.2 198.71,57.33C199.62,57.45 201.28,58.77 201.28,58.77C201.85,58.77 201.91,58.75 201.91,58.75C201.91,58.75 202.24,58.33 202.7,58.16C203.15,57.98 203.57,57.81 204.07,57.77C204.59,57.73 205.3,57.73 205.82,57.79C206.32,57.85 206.93,57.85 207.65,57.98C208.36,58.12 208.44,58.16 208.66,58.24C208.89,58.31 209.09,58.26 209.09,58.26C210.03,57.87 211.76,57.18 212.16,57.26C212.16,57.26 212.81,57.1 213.16,56.82C213.51,56.55 214.32,55.9 214.32,55.9C214.32,55.9 213.76,51.99 217.73,52.37C221.69,52.76 226.95,53.27 228.01,53.43C229.06,53.59 232.84,54.67 233.74,55.11C234.65,55.55 237.24,56.71 238.4,57.22C238.87,57.43 240.65,58.22 241.98,58.74C243.96,59.53 245.44,60.83 245.44,60.83C244.2,60.31 243.2,59.7 242.21,59.28C241.41,58.93 240.58,58.77 239.93,58.48C238.56,57.87 237.5,57.31 236.66,56.93C233.59,55.5 233.62,55.44 232.38,55.34C231.52,55.27 232.99,56.39 232.99,56.39C232.99,56.39 230.18,55.29 229.28,54.91C228.37,54.53 227.62,54.36 226.77,54.42C225.91,54.47 225.26,54.31 224.76,54.15C224.26,53.98 221.4,53.87 220.89,53.82C220.39,53.76 219.99,53.65 219.99,53.65L220.19,53.98L218.78,53.76L218.38,54.36C218.38,54.36 217.03,54.64 216.93,54.2C216.83,53.76 216.12,56.17 215.77,56.88C215.42,57.59 213.82,57.35 213.41,57.79C213.01,58.23 212.16,58.52 211.96,58.63C211.76,58.74 211.15,58.69 210.79,58.69C210.27,58.69 210.72,58.7 209.86,58.86C209.86,58.86 209.12,58.85 208.84,58.74C208.55,58.62 207.93,58.44 207.61,58.35C207.18,58.23 204.8,58.18 204.46,58.19C204.12,58.21 203.55,58.39 203.17,58.54C202.79,58.7 202.13,59.1 202.13,59.2" + android:strokeWidth="0.222083" + android:fillColor="#00000000" + android:strokeColor="#000000"/> + android:pathData="M201.67,58.93C201.67,58.93 201.51,59.05 201.47,59.36C201.43,59.66 201.45,59.54 201.45,59.54" + android:fillColor="#452C25"/> + android:pathData="M209.38,58.48C209.58,58.63 209.79,58.78 209.97,58.96C209.97,58.97 210.03,59.02 210.01,58.98C209.99,58.93 209.95,58.89 209.92,58.85C209.72,58.66 209.49,58.48 209.26,58.32C209.23,58.29 209.27,58.36 209.27,58.36C209.3,58.4 209.34,58.45 209.38,58.48Z" + android:fillColor="#574F4C"/> + diff --git a/base/src/main/res/font/ibm_plex_sans_medium.ttf b/base/src/main/res/font/ibm_plex_sans_medium.ttf new file mode 100644 index 000000000..9395402b0 Binary files /dev/null and b/base/src/main/res/font/ibm_plex_sans_medium.ttf differ diff --git a/base/src/main/res/font/ibm_plex_sans_semi_bold.ttf b/base/src/main/res/font/ibm_plex_sans_semi_bold.ttf new file mode 100644 index 000000000..a5bd9ee62 Binary files /dev/null and b/base/src/main/res/font/ibm_plex_sans_semi_bold.ttf differ diff --git a/base/src/main/res/values-ar/strings.xml b/base/src/main/res/values-ar/strings.xml index 7758697fc..b985dbc76 100644 --- a/base/src/main/res/values-ar/strings.xml +++ b/base/src/main/res/values-ar/strings.xml @@ -483,4 +483,31 @@ أدخل مفتاح=قيمة في كل سطر. قم بالترقية الآن للبقاء محميًا أو انتظر حتى تتم إعادة تعيين النطاق الترددي الخاص بك في %s سجل التغييرات + استعادة + غير محدود كل شيء + استخدم على جميع الأجهزة بدون حدود للبيانات + جميع مواقع VPN + خوادم في 130 مدينة، أكثر من أي VPN آخر + زيادة السرعة والأمان + يحجب 99.9% من المواقع الضارة والمتعقبات + شهريًا + يتم الفوترة شهريًا + سنويًا + اشترك + يمكن إدارة الاشتراكات شهريًا أو سنويًا أو إيقافها من خلال إعدادات حساب متجر Play بعد الشراء. تشمل جميع الأسعار الضرائب المطبقة. + %s/شهر، يتم الفوترة سنويًا + يتم الفوترة سنويًا + ابدأ استخدام برو + مرحبًا بك في Windscribe Pro! + شكرًا لترقيتك إلى Windscribe Pro! لديك الآن وصول إلى ميزات أكثر قوة. + إعداد على جميع أجهزتك + اتصل بأي موقع + عرض نطاق غير محدود + شارك + انضم إلى مجتمع Discord الخاص بنا + انضم إلى مجتمع Reddit الخاص بنا + اعثر علينا على YouTube + تابعنا على X + يتم الشحن كل شهر + يتم الشحن كل 12 شهرًا diff --git a/base/src/main/res/values-bn/strings.xml b/base/src/main/res/values-bn/strings.xml index 9c21893c0..72c2af9d1 100644 --- a/base/src/main/res/values-bn/strings.xml +++ b/base/src/main/res/values-bn/strings.xml @@ -480,4 +480,31 @@ সংরক্ষণ করুন খালি করুন প্রতি লাইনে 1 key=value লিখুন।. + পুনরুদ্ধার + অসীমিত সবকিছু + সব ডিভাইসে ব্যবহার করুন, কোন ডাটা সীমা নেই + সকল VPN অবস্থান + ১৩০ শহরে সার্ভার, অন্য যে কোনো VPN থেকে বেশি + বর্ধিত গতি ও নিরাপত্তা + 99.9% ক্ষতিকারক ওয়েবসাইট ও ট্র্যাকার ব্লক করে + মাসিক + মাসিক বিল + বাৎসরিক + সাবস্ক্রাইব করুন + সাবস্ক্রিপশনগুলি মাসিক, বার্ষিকভাবে পরিচালনা করা বা বন্ধ করা যেতে পারে প্লে স্টোর অ্যাকাউন্ট সেটিংসে গিয়ে। সমস্ত মূল্যে প্রযোজ্য কর অন্তর্ভুক্ত। + %s/মাস, বাৎসরিক বিল + বাৎসরিক বিল + প্রো ব্যবহার শুরু করুন + Windscribe Pro-এ স্বাগতম! + Windscribe Pro-এ আপগ্রেড করার জন্য ধন্যবাদ! এখন আপনি আরও শক্তিশালী ফিচার ব্যবহার করতে পারবেন। + আপনার সমস্ত ডিভাইসে সেটআপ করুন + যেকোনো অবস্থানে সংযোগ করুন + অসীমিত ব্যান্ডউইথ + শেয়ার করুন + আমাদের Discord কমিউনিটিতে যোগ দিন + আমাদের Reddit কমিউনিটিতে যোগ দিন + আমাদের YouTube-এ খুঁজুন + আমাদের X-এ অনুসরণ করুন + প্রতি মাসে চার্জ করা হয় + প্রতি ১২ মাসে চার্জ করা হয় diff --git a/base/src/main/res/values-de/strings.xml b/base/src/main/res/values-de/strings.xml index 1c89bb4cf..4f5e104b5 100644 --- a/base/src/main/res/values-de/strings.xml +++ b/base/src/main/res/values-de/strings.xml @@ -484,4 +484,31 @@ Gefällt dir Windscribe? Das hoffen wir doch. Bewerte uns im Play Store und wir Geben Sie pro Zeile 1 Schlüssel=Wert ein. Jetzt upgraden, um geschützt zu bleiben, oder warten Sie, bis Ihr Datenvolumen am %s zurückgesetzt wird Änderungsprotokoll + Wiederherstellen + Unbegrenzt Alles + Auf allen Geräten verwenden, ohne Datenbeschränkungen + Alle VPN-Standorte + Server in 130 Städten, mehr als jedes andere VPN + Erhöhte Geschwindigkeit und Sicherheit + Blockiert 99,9 % schädlicher Websites und Tracker + Monatlich + Monatlich abgerechnet + Jährlich + Abonnieren + Abonnements können monatlich oder jährlich verwaltet oder deaktiviert werden, indem Sie nach dem Kauf die Play Store-Kontoeinstellungen aufrufen. Alle Preise enthalten die geltenden Steuern. + %s/Monat, jährlich abgerechnet + Jährlich abgerechnet + Beginne mit Pro + Willkommen bei Windscribe Pro! + Danke für dein Upgrade auf Windscribe Pro! Du hast jetzt Zugriff auf noch leistungsstärkere Funktionen. + Auf allen Geräten einrichten + Mit jedem Standort verbinden + Unbegrenzte Bandbreite + TEILEN + Tritt unserer Discord-Community bei + Tritt unserer Reddit-Community bei + Finde uns auf YouTube + Folge uns auf X + jeden Monat berechnet + alle 12 Monate berechnet diff --git a/base/src/main/res/values-es/strings.xml b/base/src/main/res/values-es/strings.xml index c72d5c330..30d17ae19 100644 --- a/base/src/main/res/values-es/strings.xml +++ b/base/src/main/res/values-es/strings.xml @@ -483,4 +483,31 @@ Introduzca 1 clave=valor por línea. Actualiza ahora para mantenerte protegido o espera hasta que tu ancho de banda se restablezca el %s Registro de cambios + Restaurar + Todo ilimitado + Usa en todos los dispositivos sin límites de datos + Todas las ubicaciones VPN + Servidores en 130 ciudades, más que cualquier otro VPN + Mayor velocidad y seguridad + Bloquea el 99.9% de los sitios web maliciosos y rastreadores + Mensual + Facturado mensualmente + Anual + Suscribirse + Las suscripciones pueden gestionarse mensualmente, anualmente o desactivarse accediendo a la configuración de la cuenta de Play Store después de la compra. Todos los precios incluyen los impuestos aplicables. + %s/mes, facturado anualmente + Facturado anualmente + Comienza a usar Pro + ¡Bienvenido a Windscribe Pro! + ¡Gracias por actualizar a Windscribe Pro! Ahora tienes acceso a funciones aún más potentes. + Configura en todos tus dispositivos + Conéctate a cualquier ubicación + Ancho de banda ilimitado + COMPARTIR + Únete a nuestra comunidad de Discord + Únete a nuestra comunidad de Reddit + Encuéntranos en YouTube + Síguenos en X + cobrado cada mes + cobrado cada 12 meses diff --git a/base/src/main/res/values-fa/strings.xml b/base/src/main/res/values-fa/strings.xml index f0458daa9..84f7b18b4 100644 --- a/base/src/main/res/values-fa/strings.xml +++ b/base/src/main/res/values-fa/strings.xml @@ -483,4 +483,31 @@ در هر خط یک کلید=مقدار وارد کنید. هم‌اکنون ارتقا دهید تا محافظت شوید یا منتظر بمانید تا پهنای باند شما در %s بازنشانی شود لیست تغییرات + بازیابی + همه چیز نامحدود + استفاده در تمام دستگاه‌ها بدون محدودیت داده + همه موقعیت‌های VPN + سرورها در ۱۳۰ شهر، بیشتر از هر VPN دیگر + سرعت و امنیت بیشتر + مسدود کردن ۹۹.۹٪ از وب‌سایت‌های مخرب و ردیاب‌ها + ماهانه + صورتحساب ماهانه + سالانه + اشتراک + اشتراک‌ها را می‌توان به‌صورت ماهانه یا سالانه مدیریت کرد یا پس از خرید از طریق تنظیمات حساب Play Store غیرفعال کرد. همه قیمت‌ها شامل مالیات‌های اعمال‌شده هستند. + %s/ماه، صورتحساب سالانه + صورتحساب سالانه + شروع استفاده از Pro + به Windscribe Pro خوش آمدید! + سپاس از ارتقاء به Windscribe Pro! اکنون به ویژگی‌های قدرتمندتری دسترسی دارید. + راه‌اندازی در تمام دستگاه‌های شما + اتصال به هر موقعیت + پهنای باند نامحدود + اشتراک‌گذاری + به انجمن Discord ما بپیوندید + به انجمن Reddit ما بپیوندید + ما را در YouTube پیدا کنید + ما را در X دنبال کنید + هر ماه شارژ می‌شود + هر ۱۲ ماه شارژ می‌شود diff --git a/base/src/main/res/values-fr/strings.xml b/base/src/main/res/values-fr/strings.xml index e87c3e814..75bf2b9f0 100644 --- a/base/src/main/res/values-fr/strings.xml +++ b/base/src/main/res/values-fr/strings.xml @@ -483,4 +483,31 @@ dernier emplacement choisi. Saisissez une clé=valeur par ligne. Mettez à niveau maintenant pour rester protégé ou attendez que votre bande passante soit réinitialisée le %s Journal des modifications + Restaurer + Tout illimité + Utilisez sur tous les appareils, sans limite de données + Tous les emplacements VPN + Des serveurs dans 130 villes, plus que tout autre VPN + Vitesse et sécurité accrues + Bloque 99,9 % des sites malveillants et des traqueurs + Mensuel + Facturé mensuellement + Annuel + S\'abonner + Les abonnements peuvent être gérés mensuellement, annuellement ou désactivés en accédant aux paramètres du compte Play Store après l\'achat. Tous les prix incluent les taxes applicables. + %s/mois, facturé annuellement + Facturé annuellement + Commencez à utiliser Pro + Bienvenue sur Windscribe Pro ! + Merci d\'avoir mis à niveau vers Windscribe Pro ! Vous avez maintenant accès à des fonctionnalités encore plus puissantes. + Configurez sur tous vos appareils + Connectez-vous à n\'importe quel emplacement + Bande passante illimitée + PARTAGER + Rejoignez notre communauté Discord + Rejoignez notre communauté Reddit + Trouvez-nous sur YouTube + Suivez-nous sur X + facturé chaque mois + facturé tous les 12 mois diff --git a/base/src/main/res/values-hi/strings.xml b/base/src/main/res/values-hi/strings.xml index af102840e..3e222f594 100644 --- a/base/src/main/res/values-hi/strings.xml +++ b/base/src/main/res/values-hi/strings.xml @@ -483,4 +483,31 @@ प्रति पंक्ति 1 key=value दर्ज करें। सुरक्षित रहने के लिए अभी अपग्रेड करें या तब तक प्रतीक्षा करें जब तक आपका बैंडविड्थ %s को रीसेट नहीं हो जाता परिवर्तन सूची + पुनर्स्थापित करें + असीमित सबकुछ + सभी डिवाइस पर उपयोग करें, बिना डेटा सीमा के + सभी वीपीएन स्थान + 130 शहरों में सर्वर, किसी भी अन्य वीपीएन से अधिक + बेहतर गति और सुरक्षा + 99.9% हानिकारक वेबसाइट और ट्रैकर को ब्लॉक करता है + मासिक + मासिक बिल किया जाएगा + वार्षिक + सदस्यता लें + सदस्यता को मासिक, वार्षिक रूप से प्रबंधित किया जा सकता है या खरीदारी के बाद प्ले स्टोर खाता सेटिंग्स में जाकर बंद किया जा सकता है। सभी कीमतों में लागू कर शामिल हैं। + %s/माह, वार्षिक बिल किया जाएगा + वार्षिक बिल किया जाएगा + प्रो उपयोग करना शुरू करें + विंडस्क्राइब प्रो में आपका स्वागत है! + विंडस्क्राइब प्रो में अपग्रेड करने के लिए धन्यवाद! अब आपके पास और भी शक्तिशाली सुविधाओं की पहुँच है। + अपने सभी उपकरणों पर सेटअप करें + किसी भी स्थान से कनेक्ट करें + असीमित बैंडविड्थ + साझा करें + हमारे डिस्कॉर्ड समुदाय में शामिल हों + हमारे रेडिट समुदाय में शामिल हों + हमें यूट्यूब पर खोजें + हमें X पर फॉलो करें + हर महीने चार्ज किया जाता है + हर 12 महीने में चार्ज किया जाता है diff --git a/base/src/main/res/values-in/strings.xml b/base/src/main/res/values-in/strings.xml index 9f515a095..aafcbc39e 100644 --- a/base/src/main/res/values-in/strings.xml +++ b/base/src/main/res/values-in/strings.xml @@ -483,4 +483,31 @@ Lokasi terakhir yang dipilih. Masukkan 1 kunci=nilai per baris. Tingkatkan sekarang untuk tetap terlindungi atau tunggu hingga bandwidth Anda direset pada %s Catatan Perubahan + Pulihkan + Semua Tanpa Batas + Gunakan di semua perangkat, tanpa batas data + Semua Lokasi VPN + Server di 130 kota, lebih banyak dari VPN lainnya + Kecepatan dan Keamanan Ditingkatkan + Memblokir 99,9% situs berbahaya dan pelacak + Bulanan + Ditagih Bulanan + Tahunan + Berlangganan + Langganan dapat dikelola secara bulanan, tahunan, atau dinonaktifkan dengan masuk ke Pengaturan Akun Play Store setelah pembelian. Semua harga sudah termasuk pajak yang berlaku. + %s/bulan, Ditagih Tahunan + Ditagih Tahunan + Mulai Menggunakan Pro + Selamat Datang di Windscribe Pro! + Terima kasih telah meningkatkan ke Windscribe Pro! Sekarang Anda memiliki akses ke fitur yang lebih canggih. + Atur di Semua Perangkat Anda + Terhubung ke Lokasi Mana Pun + Bandwidth Tanpa Batas + BAGIKAN + Bergabung dengan komunitas Discord kami + Bergabung dengan komunitas Reddit kami + Temukan kami di YouTube + Ikuti kami di X + dikenakan biaya setiap bulan + dikenakan biaya setiap 12 bulan diff --git a/base/src/main/res/values-it/strings.xml b/base/src/main/res/values-it/strings.xml index 0f71fb66e..a83166cc6 100644 --- a/base/src/main/res/values-it/strings.xml +++ b/base/src/main/res/values-it/strings.xml @@ -490,4 +490,31 @@ Ultima posizione scelta. Condivisione di File Sconsigliata Aggiorna ora per rimanere protetto o attendi che la tua larghezza di banda venga reimpostata il %s Registro delle modifiche + Ripristina + Tutto Illimitato + Usa su tutti i dispositivi, senza limiti di dati + Tutte le Posizioni VPN + Server in 130 città, più di qualsiasi altro VPN + Velocità e Sicurezza Aumentate + Blocca il 99,9% dei siti dannosi e dei tracker + Mensile + Fatturato Mensilmente + Annuale + Abbonati + Gli abbonamenti possono essere gestiti mensilmente, annualmente o disattivati accedendo alle impostazioni dell\'account Play Store dopo l\'acquisto. Tutti i prezzi includono le tasse applicabili. + %s/mese, Fatturato Annualmente + Fatturato Annualmente + Inizia a Usare Pro + Benvenuto su Windscribe Pro! + Grazie per aver effettuato l\'upgrade a Windscribe Pro! Ora hai accesso a funzionalità ancora più potenti. + Configura su Tutti i Tuoi Dispositivi + Connettiti a Qualsiasi Posizione + Larghezza di Banda Illimitata + CONDIVIDI + Unisciti alla nostra community su Discord + Unisciti alla nostra community su Reddit + Trova noi su YouTube + Seguici su X + addebito ogni mese + addebito ogni 12 mesi diff --git a/base/src/main/res/values-ja/strings.xml b/base/src/main/res/values-ja/strings.xml index cf490cb6c..f091108fc 100644 --- a/base/src/main/res/values-ja/strings.xml +++ b/base/src/main/res/values-ja/strings.xml @@ -483,4 +483,31 @@ 1 行に 1 つの key=value を入力します。 今すぐアップグレードして保護を維持するか、帯域幅が%sにリセットされるまで待ってください 変更履歴 + 復元 + すべて無制限 + すべてのデバイスで、データ制限なしで使用可能 + すべてのVPNロケーション + 130都市にサーバーを配置、他のVPNよりも多い + 速度とセキュリティの向上 + 99.9%の悪意あるウェブサイトとトラッカーをブロック + 月額プラン + 月額請求 + 年額プラン + 購読 + サブスクリプションは毎月または毎年管理したり、購入後にPlayストアのアカウント設定からオフにしたりできます。すべての価格には適用される税金が含まれています。 + %s/月(年額請求) + 年額請求 + Pro版を使い始める + Windscribe Proへようこそ! + Windscribe Proにアップグレードしていただきありがとうございます!さらに強力な機能が利用可能になりました。 + すべてのデバイスでセットアップ + どのロケーションにも接続可能 + 無制限の帯域幅 + 共有 + Discordコミュニティに参加 + Redditコミュニティに参加 + YouTubeで見つける + Xでフォロー + 毎月請求されます + 12か月ごとに請求されます diff --git a/base/src/main/res/values-ko/strings.xml b/base/src/main/res/values-ko/strings.xml index d59615009..5b6378bc1 100644 --- a/base/src/main/res/values-ko/strings.xml +++ b/base/src/main/res/values-ko/strings.xml @@ -483,4 +483,31 @@ 라인마다 키=값을 입력하세요. 지금 업그레이드하여 보호 상태를 유지하거나 %s에 대역폭이 재설정될 때까지 기다리세요 변경 로그 + 복원 + 무제한 이용 + 모든 기기에서 데이터 제한 없이 사용 가능 + 모든 VPN 위치 + 130개 도시의 서버 제공, 다른 VPN보다 많음 + 속도 및 보안 향상 + 악성 웹사이트 및 트래커의 99.9% 차단 + 월간 요금제 + 월 단위 청구 + 연간 요금제 + 구독 + 구독은 매월 또는 매년 관리하거나 구매 후 Play 스토어 계정 설정에서 해제할 수 있습니다. 모든 가격에는 적용 가능한 세금이 포함됩니다. + %s/월 (연간 청구) + 연간 청구 + Pro 사용 시작 + Windscribe Pro에 오신 것을 환영합니다! + Windscribe Pro로 업그레이드해 주셔서 감사합니다! 이제 더욱 강력한 기능을 사용할 수 있습니다. + 모든 기기에서 설정 + 모든 위치에 연결 + 무제한 대역폭 + 공유 + Discord 커뮤니티 참여 + Reddit 커뮤니티 참여 + YouTube에서 찾기 + X에서 팔로우 + 매달 청구됨 + 12개월마다 청구됨 diff --git a/base/src/main/res/values-pl/strings.xml b/base/src/main/res/values-pl/strings.xml index e00d47b5e..b971a4205 100644 --- a/base/src/main/res/values-pl/strings.xml +++ b/base/src/main/res/values-pl/strings.xml @@ -483,4 +483,31 @@ ostatnio wybrana lokalizacja. Wprowadź 1 klucz=wartość w każdej linii. Ulepsz teraz, aby pozostać chronionym, lub poczekaj, aż twoja przepustowość zostanie zresetowana %s Dziennik zmian + Przywróć + Nieograniczone wszystko + Używaj na wszystkich urządzeniach bez ograniczeń danych + Wszystkie lokalizacje VPN + Serwery w 130 miastach, więcej niż jakikolwiek inny VPN + Zwiększona prędkość i bezpieczeństwo + Blokuje 99,9% złośliwych stron i trackerów + Miesięczny + Rozliczane miesięcznie + Roczny + Subskrybuj + Subskrypcje można zarządzać miesięcznie, rocznie lub wyłączyć je w ustawieniach konta Play Store po zakupie. Wszystkie ceny zawierają obowiązujące podatki. + %s/miesiąc, rozliczane rocznie + Rozliczane rocznie + Rozpocznij korzystanie z Pro + Witamy w Windscribe Pro! + Dziękujemy za aktualizację do Windscribe Pro! Teraz masz dostęp do jeszcze potężniejszych funkcji. + Skonfiguruj na wszystkich swoich urządzeniach + Połącz się z dowolną lokalizacją + Nieograniczona przepustowość + UDOSTĘPNIJ + Dołącz do naszej społeczności na Discordzie + Dołącz do naszej społeczności na Reddicie + Znajdź nas na YouTube + Śledź nas na X + pobierana opłata co miesiąc + pobierana opłata co 12 miesięcy diff --git a/base/src/main/res/values-pt-rBR/strings.xml b/base/src/main/res/values-pt-rBR/strings.xml index 402af056c..a372ab625 100644 --- a/base/src/main/res/values-pt-rBR/strings.xml +++ b/base/src/main/res/values-pt-rBR/strings.xml @@ -483,4 +483,31 @@ last chosen location. Enter 1 key=value per line. Atualize agora para continuar protegido ou aguarde até que sua largura de banda seja redefinida em %s Registro de alterações + Restaurar + Tudo Ilimitado + Use em todos os dispositivos, sem limites de dados + Todas as Localizações VPN + Servidores em 130 cidades, mais do que qualquer outro VPN + Maior Velocidade e Segurança + Bloqueia 99,9% dos sites maliciosos e rastreadores + Mensal + Cobrado Mensalmente + Anual + Assinar + As assinaturas podem ser gerenciadas mensalmente, anualmente ou desativadas nas configurações da conta da Play Store após a compra. Todos os preços incluem impostos aplicáveis. + %s/mês, Cobrado Anualmente + Cobrado Anualmente + Comece a usar o Pro + Bem-vindo ao Windscribe Pro! + Obrigado por atualizar para o Windscribe Pro! Agora você tem acesso a recursos ainda mais poderosos. + Configurar em Todos os Seus Dispositivos + Conecte-se a Qualquer Localização + Largura de Banda Ilimitada + COMPARTILHAR + Junte-se à nossa comunidade no Discord + Junte-se à nossa comunidade no Reddit + Encontre-nos no YouTube + Siga-nos no X + cobrado todo mês + cobrado a cada 12 meses diff --git a/base/src/main/res/values-pt/strings.xml b/base/src/main/res/values-pt/strings.xml index 70cc9ae5b..c03dedef7 100644 --- a/base/src/main/res/values-pt/strings.xml +++ b/base/src/main/res/values-pt/strings.xml @@ -483,4 +483,31 @@ Insira 1 chave=valor por linha. Atualize agora para continuar protegido ou aguarde até que sua largura de banda seja redefinida em %s Registro de alterações + Restaurar + Tudo Ilimitado + Use em todos os dispositivos, sem limites de dados + Todas as Localizações VPN + Servidores em 130 cidades, mais do que qualquer outro VPN + Maior Velocidade e Segurança + Bloqueia 99,9% dos sites maliciosos e rastreadores + Mensal + Cobrado Mensalmente + Anual + Assinar + As assinaturas podem ser gerenciadas mensalmente, anualmente ou desativadas acessando as configurações da conta do Play Store após a compra. Todos os preços incluem impostos aplicáveis. + %s/mês, Cobrado Anualmente + Cobrado Anualmente + Comece a usar o Pro + Bem-vindo ao Windscribe Pro! + Obrigado por atualizar para o Windscribe Pro! Agora você tem acesso a recursos ainda mais poderosos. + Configurar em Todos os Seus Dispositivos + Conecte-se a Qualquer Localização + Largura de Banda Ilimitada + COMPARTILHAR + Junte-se à nossa comunidade no Discord + Junte-se à nossa comunidade no Reddit + Encontre-nos no YouTube + Siga-nos no X + cobrado todos os meses + cobrado a cada 12 meses diff --git a/base/src/main/res/values-ru/strings.xml b/base/src/main/res/values-ru/strings.xml index 5f7bdccfe..fc6ba1d53 100644 --- a/base/src/main/res/values-ru/strings.xml +++ b/base/src/main/res/values-ru/strings.xml @@ -486,4 +486,31 @@ Выберите DNS-сервер, который будет использоваться при подключении к Windscribe. Обновитесь сейчас, чтобы оставаться защищённым, или дождитесь, пока ваш трафик не будет сброшен %s Журнал изменений + Восстановить + Безлимитный доступ + Используйте на всех устройствах без ограничений по данным + Все VPN-локации + Серверы в 130 городах — больше, чем у любого другого VPN + Увеличенная скорость и безопасность + Блокирует 99,9% вредоносных сайтов и трекеров + Месячный + Оплачивается ежемесячно + Годовой + Подписаться + Подписками можно управлять ежемесячно, ежегодно или отключить их в настройках аккаунта Play Store после покупки. Все цены включают применимые налоги. + %s/месяц, Оплачивается ежегодно + Оплачивается ежегодно + Начать использование Pro + Добро пожаловать в Windscribe Pro! + Спасибо за обновление до Windscribe Pro! Теперь у вас есть доступ к еще более мощным функциям. + Настроить на всех устройствах + Подключение к любой локации + Безлимитная пропускная способность + ПОДЕЛИТЬСЯ + Присоединяйтесь к нашему сообществу в Discord + Присоединяйтесь к нашему сообществу на Reddit + Найдите нас на YouTube + Подписывайтесь на нас в X + списывается каждый месяц + списывается каждые 12 месяцев diff --git a/base/src/main/res/values-tr/strings.xml b/base/src/main/res/values-tr/strings.xml index 49d8a899b..29df58200 100644 --- a/base/src/main/res/values-tr/strings.xml +++ b/base/src/main/res/values-tr/strings.xml @@ -483,4 +483,31 @@ son seçilen yer. Her satıra 1 anahtar=değer girin. Korunmaya devam etmek için şimdi yükseltin veya bant genişliğiniz %s tarihinde sıfırlanana kadar bekleyin Değişiklik Günlüğü + Geri Yükle + Sınırsız Her Şey + Tüm cihazlarda veri sınırı olmadan kullanın + Tüm VPN Konumları + 130 şehirde sunucular, diğer tüm VPN\'lerden daha fazla + Artırılmış Hız ve Güvenlik + Kötü amaçlı web sitelerinin ve takipçilerin %99,9\'unu engeller + Aylık + Aylık Faturalandırılır + Yıllık + Abone Ol + Abonelikler aylık veya yıllık olarak yönetilebilir ya da satın aldıktan sonra Play Store hesap ayarlarından kapatılabilir. Tüm fiyatlar geçerli vergileri içerir. + %s/ay, Yıllık Faturalandırılır + Yıllık Faturalandırılır + Pro\'yu Kullanmaya Başla + Windscribe Pro\'ya Hoş Geldiniz! + Windscribe Pro\'ya yükselttiğiniz için teşekkürler! Artık daha güçlü özelliklere erişiminiz var. + Tüm Cihazlarınızda Kurun + Herhangi Bir Konuma Bağlanın + Sınırsız Bant Genişliği + PAYLAŞ + Discord topluluğumuza katılın + Reddit topluluğumuza katılın + Bizi YouTube\'da bulun + Bizi X\'te takip edin + her ay ücretlendirilir + her 12 ayda bir ücretlendirilir diff --git a/base/src/main/res/values-uk/strings.xml b/base/src/main/res/values-uk/strings.xml index 7a7983075..5ff8afae9 100644 --- a/base/src/main/res/values-uk/strings.xml +++ b/base/src/main/res/values-uk/strings.xml @@ -483,4 +483,31 @@ Зберегти Ясний Введіть 1 ключ=значення в кожному рядку. + Відновити + Необмежені можливості + Використовуйте на всіх пристроях без обмежень даних + Усі VPN-локації + Сервери у 130 містах, більше ніж у будь-якого іншого VPN + Підвищена швидкість і безпека + Блокує 99,9% шкідливих сайтів і трекерів + Щомісячно + Виставляється рахунок щомісяця + Щорічно + Підписатися + Підписками можна керувати щомісяця, щорічно або вимикати їх у налаштуваннях облікового запису Play Store після покупки. Усі ціни включають застосовні податки. + %s/місяць, рахунок виставляється щорічно + Рахунок виставляється щорічно + Почати користуватися Pro + Ласкаво просимо до Windscribe Pro! + Дякуємо за оновлення до Windscribe Pro! Тепер у вас є доступ до ще потужніших функцій. + Налаштуйте на всіх своїх пристроях + Підключайтеся до будь-якого місця + Необмежена пропускна здатність + ПОДІЛИТИСЯ + Приєднуйтесь до нашої спільноти Discord + Приєднуйтесь до нашої спільноти Reddit + Знайдіть нас на YouTube + Слідкуйте за нами в X + стягується щомісяця + стягується кожні 12 місяців diff --git a/base/src/main/res/values-ur/strings.xml b/base/src/main/res/values-ur/strings.xml index 0336753d7..fbf0e8edd 100644 --- a/base/src/main/res/values-ur/strings.xml +++ b/base/src/main/res/values-ur/strings.xml @@ -482,4 +482,31 @@ last chosen location. Enter 1 key=value per line. Upgrade now to stay protected or wait until your bandwidth is reset on %s Changelog + بحال کریں + لا محدود سب کچھ + تمام ڈیوائسز پر بغیر کسی ڈیٹا حد کے استعمال کریں + تمام VPN مقامات + 130 شہروں میں سرورز، کسی بھی دوسرے VPN سے زیادہ + زیادہ رفتار اور سیکیورٹی + 99.9٪ نقصان دہ ویب سائٹس اور ٹریکرز کو بلاک کرتا ہے + ماہانہ + ماہانہ بل + سالانہ + سبسکرائب کریں + سبسکرپشنز کو ماہانہ، سالانہ منظم کیا جا سکتا ہے یا خریداری کے بعد پلے اسٹور اکاؤنٹ سیٹنگز میں جا کر بند کیا جا سکتا ہے۔ تمام قیمتوں میں لاگو ٹیکس شامل ہیں۔ + %s/ماہ، سالانہ بل + سالانہ بل + Pro کا استعمال شروع کریں + Windscribe Pro میں خوش آمدید! + Windscribe Pro میں اپ گریڈ کرنے کا شکریہ! اب آپ مزید طاقتور خصوصیات تک رسائی حاصل کر سکتے ہیں۔ + اپنی تمام ڈیوائسز پر سیٹ اپ کریں + کسی بھی مقام سے جڑیں + لا محدود بینڈوڈتھ + شیئر کریں + ہماری Discord کمیونٹی میں شامل ہوں + ہماری Reddit کمیونٹی میں شامل ہوں + ہمیں YouTube پر تلاش کریں + ہمیں X پر فالو کریں + ہر مہینے چارج کیا جاتا ہے + ہر 12 مہینے بعد چارج کیا جاتا ہے diff --git a/base/src/main/res/values-vi/strings.xml b/base/src/main/res/values-vi/strings.xml index de45e1bc3..0080ce84c 100644 --- a/base/src/main/res/values-vi/strings.xml +++ b/base/src/main/res/values-vi/strings.xml @@ -483,4 +483,31 @@ Vị trí được chọn cuối cùng. Nhập 1 key=value mỗi dòng. Nâng cấp ngay để được bảo vệ hoặc chờ đến khi băng thông của bạn được đặt lại vào %s Nhật ký thay đổi + Khôi phục + Mọi thứ không giới hạn + Sử dụng trên tất cả thiết bị mà không có giới hạn dữ liệu + Tất cả vị trí VPN + Máy chủ tại 130 thành phố, nhiều hơn bất kỳ VPN nào khác + Tốc độ và bảo mật cao hơn + Chặn 99,9% trang web độc hại và trình theo dõi + Hàng tháng + Thanh toán hàng tháng + Hàng năm + Đăng ký + Đăng ký có thể được quản lý hàng tháng, hàng năm hoặc tắt bằng cách vào Cài đặt tài khoản Play Store sau khi mua. Tất cả giá đã bao gồm thuế áp dụng. + %s/tháng, Thanh toán hàng năm + Thanh toán hàng năm + Bắt đầu sử dụng Pro + Chào mừng đến với Windscribe Pro! + Cảm ơn bạn đã nâng cấp lên Windscribe Pro! Giờ đây, bạn có thể truy cập nhiều tính năng mạnh mẽ hơn. + Thiết lập trên tất cả thiết bị của bạn + Kết nối đến bất kỳ vị trí nào + Băng thông không giới hạn + CHIA SẺ + Tham gia cộng đồng Discord của chúng tôi + Tham gia cộng đồng Reddit của chúng tôi + Tìm chúng tôi trên YouTube + Theo dõi chúng tôi trên X + được tính phí hàng tháng + được tính phí mỗi 12 tháng diff --git a/base/src/main/res/values-zh-rTW/strings.xml b/base/src/main/res/values-zh-rTW/strings.xml index 8f2b6f33d..8c2408149 100644 --- a/base/src/main/res/values-zh-rTW/strings.xml +++ b/base/src/main/res/values-zh-rTW/strings.xml @@ -483,4 +483,31 @@ 每行輸入1個鍵=值。 立即升級以保持保護,或等待您的頻寬於%s重置 更新日誌 + 恢復 + 無限制體驗 + 可在所有設備上使用,無數據限制 + 所有 VPN 位置 + 覆蓋 130 個城市,超過任何其他 VPN + 更快的速度與更高的安全性 + 封鎖 99.9% 惡意網站和追蹤器 + 包月 + 按月計費 + 包年 + 訂閱 + 訂閱可以按月或按年管理,或在購買後前往 Play 商店帳戶設定關閉。所有價格均包含適用稅費。 + %s/月,按年計費 + 按年計費 + 開始使用 Pro + 歡迎使用 Windscribe Pro! + 感謝升級到 Windscribe Pro!您現在可以存取更多強大功能。 + 在所有設備上設定 + 連接到任何位置 + 無限頻寬 + 分享 + 加入我們的 Discord 社群 + 加入我們的 Reddit 社群 + 在 YouTube 上找到我們 + 在 X 上關注我們 + 每月收費 + 每 12 個月收費 diff --git a/base/src/main/res/values-zh/strings.xml b/base/src/main/res/values-zh/strings.xml index a5d6782a4..b0b16288d 100644 --- a/base/src/main/res/values-zh/strings.xml +++ b/base/src/main/res/values-zh/strings.xml @@ -483,4 +483,31 @@ 每行输入1个键=值。 立即升级以保持保护,或等待您的带宽在%s重置 更新日志 + 恢复 + 无限制体验 + 可在所有设备上使用,无数据限制 + 所有 VPN 位置 + 覆盖 130 个城市,超过任何其他 VPN + 更快的速度与更高的安全性 + 拦截 99.9% 恶意网站和跟踪器 + 包月 + 按月计费 + 包年 + 订阅 + 订阅可按月或按年管理,或在购买后前往 Play 商店账户设置关闭。所有价格均包含适用税费。 + %s/月,按年计费 + 按年计费 + 开始使用 Pro + 欢迎使用 Windscribe Pro! + 感谢升级到 Windscribe Pro!您现在可以访问更多强大功能。 + 在所有设备上设置 + 连接到任何位置 + 无限带宽 + 分享 + 加入我们的 Discord 社区 + 加入我们的 Reddit 社区 + 在 YouTube 上找到我们 + 在 X 上关注我们 + 每月收费 + 每 12 个月收费 diff --git a/base/src/main/res/values/strings.xml b/base/src/main/res/values/strings.xml index 52e6dfa46..3a17b478d 100644 --- a/base/src/main/res/values/strings.xml +++ b/base/src/main/res/values/strings.xml @@ -504,4 +504,31 @@ last chosen location. Don’t ask again Upgrade now to stay protected or wait until your bandwidth is reset on %s Changelog + Restore + Unlimited Everything + Use on all devices, with no data limits + All VPN Locations + Servers in 130 cities, more than any other VPN + Increased Speed and Security + Blocks 99.9% of malicious websites and trackers + Monthly + Billed Monthly + Yearly + Subscribe + Subscriptions may be managed monthly, yearly or turned off by going to the Play Store Account Settings after purchase. All prices include applicable taxes. + %s/month, Billed Annually + Billed Annually + Start using Pro + Welcome to Windscribe Pro! + Thanks for upgrading to Windscribe Pro! You now have access to even more powerful features. + Set Up on All Your Devices + Connect to Any Location + Unlimited Bandwidth + SHARE + Join our Discord community + Join our Reddit community + Find us on Youtube + Follow us on X + charged every month + charged every 12 months diff --git a/build.gradle b/build.gradle index aa94cea9a..eb1e7e06d 100644 --- a/build.gradle +++ b/build.gradle @@ -6,8 +6,8 @@ project.ext { appTargetSdk = 34 appCompiledSdk = 34 appBuildTool = "34.0.0" - appVersionCode = 1617 - appVersionName = "3.81" + appVersionCode = 1621 + appVersionName = "3.82" java = "17" } diff --git a/mobile/build.gradle b/mobile/build.gradle index ef4757107..47de14b0c 100644 --- a/mobile/build.gradle +++ b/mobile/build.gradle @@ -19,6 +19,7 @@ android { } buildFeatures { buildConfig = true + dataBinding = true } compileSdkVersion rootProject.appCompiledSdk @@ -26,8 +27,8 @@ android { applicationId rootProject.AppId minSdkVersion rootProject.appMinSdk targetSdkVersion rootProject.appTargetSdk - versionName System.getenv().getOrDefault("VERSION_NAME", "3.81") - versionCode 1617 + versionName System.getenv().getOrDefault("VERSION_NAME", "3.82") + versionCode 1621 vectorDrawables.useSupportLibrary = true testInstrumentationRunner "com.windscribe.vpn.CustomRunner" diff --git a/mobile/proguard-rules.pro b/mobile/proguard-rules.pro index 374a60b7e..2f820f840 100644 --- a/mobile/proguard-rules.pro +++ b/mobile/proguard-rules.pro @@ -67,3 +67,4 @@ -keep class org.pcap4j.packet.factory.** { *; } # Keep classes from minidns-client -keep class org.minidns.** { *; } +-keep class com.windscribe.vpn.commonutils.LowerCaseLevelConverter { *; } diff --git a/mobile/src/fdroid/java/com/windscribe/mobile/upgradeactivity/UpgradeActivity.java b/mobile/src/fdroid/java/com/windscribe/mobile/upgradeactivity/UpgradeActivity.java index 674c31f61..50916bbca 100644 --- a/mobile/src/fdroid/java/com/windscribe/mobile/upgradeactivity/UpgradeActivity.java +++ b/mobile/src/fdroid/java/com/windscribe/mobile/upgradeactivity/UpgradeActivity.java @@ -22,7 +22,6 @@ public static Intent getStartIntent(Context context) { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentLayout(R.layout.activity_upgrade, false); ErrorDialog.show(this, getString(R.string.billing_unavailable), null, true); } } diff --git a/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/PlansFragment.kt b/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/PlansFragment.kt deleted file mode 100644 index 4c3e8984f..000000000 --- a/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/PlansFragment.kt +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright (c) 2021 Windscribe Limited. - */ - -package com.windscribe.mobile.upgradeactivity - -import android.annotation.SuppressLint -import android.app.AlertDialog.Builder -import android.content.Context -import android.content.DialogInterface -import android.graphics.Color -import android.os.Bundle -import android.text.Spannable -import android.text.SpannableString -import android.text.Spanned -import android.text.TextPaint -import android.text.method.LinkMovementMethod -import android.text.style.ClickableSpan -import android.text.style.ForegroundColorSpan -import android.transition.Slide -import android.view.Gravity -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.Button -import android.widget.RadioButton -import android.widget.RadioGroup -import android.widget.RadioGroup.OnCheckedChangeListener -import android.widget.TextView -import android.widget.TextView.BufferType.SPANNABLE -import androidx.appcompat.app.AppCompatActivity -import androidx.core.view.get -import androidx.core.view.size -import androidx.fragment.app.Fragment -import butterknife.BindView -import butterknife.ButterKnife -import butterknife.OnClick -import com.windscribe.mobile.R -import com.windscribe.mobile.R.* -import com.windscribe.vpn.billing.AmazonProducts -import com.windscribe.vpn.billing.BillingFragmentCallback -import com.windscribe.vpn.billing.GoogleProducts -import com.windscribe.vpn.billing.WindscribeInAppProduct - -class PlansFragment : Fragment(), OnCheckedChangeListener { - - @JvmField - @BindView(R.id.continueToFree) - var continueToFreeButton: Button? = null - - @JvmField - @BindView(R.id.continueToPremium) - var continueToPremiumButton: Button? = null - - @JvmField - @BindView(R.id.planOptionContainer) - var planRadioGroup: RadioGroup? = null - - @JvmField - @BindView(R.id.promoPlan) - var promoPlan: TextView? = null - - @JvmField - @BindView(R.id.promoSticker) - var promoSticker: TextView? = null - - @JvmField - @BindView(R.id.terms_policy) - var termAndPolicyView: TextView? = null - - @JvmField - @BindView(R.id.nav_title) - var titleView: TextView? = null - - private var isEmailAdded = false - private var isEmailConfirmed = false - private var billingListener: BillingFragmentCallback? = null - private var windscribeInAppProduct: WindscribeInAppProduct? = null - override fun onAttach(context: Context) { - super.onAttach(context) - try { - billingListener = context as BillingFragmentCallback - } catch (ignored: ClassCastException) { - } - } - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - val view = inflater.inflate(layout.fragment_plans, container, false) - ButterKnife.bind(this, view) - return view - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - titleView?.text = getString(string.plans) - setEmailStatus(isEmailAdded, isEmailConfirmed) - showPlans() - setTermAndPolicyText() - planRadioGroup?.setOnCheckedChangeListener(this) - if (planRadioGroup?.size!! > 0) { - val firstItem = planRadioGroup?.get(0) as RadioButton - planRadioGroup?.check(firstItem.id) - } - } - - @SuppressLint("SetTextI18n") - private fun showPlans() { - windscribeInAppProduct?.let { plan -> - if(plan.getSkus().isEmpty()) { - return - } - if (plan.isPromo()) { - planRadioGroup?.visibility = View.GONE - promoPlan?.visibility = View.VISIBLE - promoSticker?.visibility = View.VISIBLE - val firstPlan = plan.getSkus().first() - val planText: Spannable = - SpannableString("${plan.getPrice(firstPlan)}/${plan.getPlanDuration(firstPlan)}") - promoPlan?.append(planText) - val divider: Spannable = SpannableString(" | ") - context?.let { - divider.setSpan( - ForegroundColorSpan(it.resources.getColor(R.color.colorWhite15)), - 0, - 5, - Spannable.SPAN_EXCLUSIVE_EXCLUSIVE - ) - } - promoPlan?.append(divider) - val discountText: Spannable = SpannableString(plan.getDiscountLabel(firstPlan)) - promoPlan?.append(discountText) - promoSticker?.text = plan.getPromoStickerLabel(firstPlan) - continueToPremiumButton?.setTag(R.id.sku_tag, firstPlan) - continueToPremiumButton?.isEnabled = true - continueToPremiumButton?.text = - "Continue ${plan.getPrice(firstPlan)}/${plan.getPlanDuration(firstPlan)}" - } else { - planRadioGroup?.visibility = View.VISIBLE - promoPlan?.visibility = View.GONE - promoSticker?.visibility = View.GONE - plan.getSkus().forEach { - val params = RadioGroup.LayoutParams( - RadioGroup.LayoutParams.WRAP_CONTENT, - RadioGroup.LayoutParams.WRAP_CONTENT - ) - params.weight = 1F - val radioButton = - this.layoutInflater.inflate(layout.plan_radio_option, null) as RadioButton - val planDuration = plan.getPlanDuration(it) - val planPrice = plan.getPrice(it) - radioButton.text = "$planPrice/$planDuration" - radioButton.setTag(R.id.sku_tag, it) - planRadioGroup?.addView(radioButton, params) - } - } - } - } - - fun add( - activity: AppCompatActivity, - products: WindscribeInAppProduct, - container: Int, - addToBackStack: Boolean, - isEmailAdded: Boolean, - isEmailConfirmed: Boolean - ) { - this.isEmailAdded = isEmailAdded - this.isEmailConfirmed = isEmailConfirmed - this.windscribeInAppProduct = products - enterTransition = Slide(Gravity.BOTTOM).addTarget(R.id.plan_fragment_container) - val transaction = activity.supportFragmentManager - .beginTransaction() - .replace(container, this) - if (addToBackStack) { - transaction.addToBackStack(this.javaClass.name) - } - transaction.commit() - } - - @OnClick(R.id.continueToFree) - fun tenGbFree() { - billingListener?.onTenGbFreeClick() - } - - @OnClick(R.id.nav_button) - fun onBackPressed() { - requireActivity().onBackPressed() - } - - @SuppressLint("SetTextI18n") - override fun onCheckedChanged(group: RadioGroup, checkedId: Int) { - val viewTag = view?.findViewById(checkedId)?.getTag(R.id.sku_tag) as String? - viewTag?.let { - val planDuration = windscribeInAppProduct?.getPlanDuration(viewTag) - val planPrice = windscribeInAppProduct?.getPrice(viewTag) - planDuration.let { - planPrice.let { - continueToPremiumButton?.isEnabled = true - continueToPremiumButton?.text = "Continue $planPrice/$planDuration" - continueToPremiumButton?.setTag(R.id.sku_tag, viewTag) - } - } - } - } - - @OnClick(R.id.firstInfoIcon) - fun onFirstInfoIconClick() { - showDialog(getString(string.as_much_as_bandwidth_you_like)) - } - - @OnClick(R.id.continueToPremium) - fun onPlanClicked() { - val viewTag = continueToPremiumButton?.getTag(R.id.sku_tag) as String? - viewTag?.let { - when (windscribeInAppProduct) { - is GoogleProducts -> { - val skuDetails = - (windscribeInAppProduct as GoogleProducts).getSkuDetails(viewTag) - billingListener?.onContinuePlanClick(skuDetails, 0) - } - is AmazonProducts -> { - val product = (windscribeInAppProduct as AmazonProducts).getProduct(viewTag) - billingListener?.onContinuePlanClick(product) - } - else -> {} - } - } - } - - @SuppressLint("NonConstantResourceId") - @OnClick(R.id.secondInfoIcon) - fun onSecondInfoIconClick() { - showDialog(getString(string.access_to_multiple_servers)) - } - - @SuppressLint("NonConstantResourceId") - @OnClick(R.id.thirdInfoIcon) - fun onThirdInfoIconClick() { - showDialog(getString(string.ad_malware_blocker)) - } - - fun setEmailStatus(isEmailAdded: Boolean, isEmailConfirmed: Boolean) { - continueToFreeButton?.visibility = - if (isEmailAdded && isEmailConfirmed) View.GONE else View.VISIBLE - } - - private fun setTermAndPolicyText() { - val appName = getString(string.app_name) - val termAndPolicyText = getString(string.terms_policy_en) - val fullText = "$appName $termAndPolicyText" - val spannable: Spannable = SpannableString(fullText) - val spanStart = fullText.length - termAndPolicyText.length - spannable.setSpan( - ForegroundColorSpan(Color.WHITE), - spanStart, - fullText.length, - Spannable.SPAN_EXCLUSIVE_EXCLUSIVE - ) - val termsSpan = object : ClickableSpan() { - override fun onClick(textView: View) { - billingListener?.onTermsClick() - } - - override fun updateDrawState(textPaint: TextPaint) { - textPaint.color = textPaint.linkColor - textPaint.isUnderlineText = false - } - } - val policySpan = object : ClickableSpan() { - override fun onClick(textView: View) { - billingListener?.onPolicyClick() - } - - override fun updateDrawState(textPaint: TextPaint) { - textPaint.color = textPaint.linkColor - textPaint.isUnderlineText = false - } - } - if (fullText.indexOf("&") != -1) { - spannable.setSpan( - termsSpan, spanStart, fullText.indexOf("&") - 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE - ) - spannable.setSpan( - policySpan, - fullText.indexOf("&") + 1, - fullText.length, - Spanned.SPAN_EXCLUSIVE_EXCLUSIVE - ) - termAndPolicyView?.movementMethod = LinkMovementMethod.getInstance() - termAndPolicyView?.setText(spannable, SPANNABLE) - } - } - - private fun showDialog(message: String) { - Builder(context, style.tool_tip_dialog) - .setMessage(message) - .setPositiveButton("OK") { dialog1: DialogInterface, _: Int -> dialog1.cancel() }.show() - } - - companion object { - @JvmStatic - fun newInstance(): PlansFragment { - return PlansFragment() - } - } -} diff --git a/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradeActivity.java b/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradeActivity.java index f5a346aad..b1448f8d6 100644 --- a/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradeActivity.java +++ b/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradeActivity.java @@ -4,18 +4,30 @@ package com.windscribe.mobile.upgradeactivity; -import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; -import static com.windscribe.mobile.email.AddEmailActivity.goToHomeAfterFinish; import static com.windscribe.vpn.Windscribe.appContext; import static com.windscribe.vpn.constants.ExtraConstants.PROMO_EXTRA; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; +import android.graphics.Color; import android.os.Bundle; +import android.text.Spannable; +import android.text.SpannableString; +import android.text.Spanned; +import android.text.TextPaint; +import android.text.TextUtils; +import android.text.method.LinkMovementMethod; +import android.text.style.ClickableSpan; +import android.text.style.ForegroundColorSpan; +import android.text.style.StrikethroughSpan; +import android.view.View; +import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.databinding.DataBindingUtil; import androidx.fragment.app.Fragment; import com.amazon.device.iap.model.Product; @@ -26,74 +38,49 @@ import com.google.common.collect.ImmutableList; import com.windscribe.mobile.R; import com.windscribe.mobile.base.BaseActivity; -import com.windscribe.mobile.confirmemail.ConfirmActivity; -import com.windscribe.mobile.custom_view.CustomDialog; +import com.windscribe.mobile.databinding.ActivityUpgradeBinding; import com.windscribe.mobile.di.ActivityModule; import com.windscribe.mobile.dialogs.ErrorDialog; import com.windscribe.mobile.dialogs.ProgressDialog; -import com.windscribe.mobile.email.AddEmailActivity; -import com.windscribe.mobile.welcome.WelcomeActivity; -import com.windscribe.mobile.windscribe.WindscribeActivity; -import com.windscribe.vpn.Windscribe; +import com.windscribe.mobile.utils.UiUtil; import com.windscribe.vpn.api.response.PushNotificationAction; import com.windscribe.vpn.billing.AmazonBillingManager; -import com.windscribe.vpn.billing.BillingFragmentCallback; +import com.windscribe.vpn.billing.AmazonProducts; import com.windscribe.vpn.billing.GoogleBillingManager; +import com.windscribe.vpn.billing.GoogleProducts; import com.windscribe.vpn.billing.PurchaseState; import com.windscribe.vpn.billing.WindscribeInAppProduct; -import com.windscribe.vpn.commonutils.ThemeUtils; import com.windscribe.vpn.constants.NetworkKeyConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; +import java.util.Locale; import javax.inject.Inject; -public class UpgradeActivity extends BaseActivity - implements UpgradeView - , BillingFragmentCallback { - - public enum BillingType { - Google("android"), Amazon("amazon"); - - private final String value; - - BillingType(String value) { - this.value = value; - } +import kotlin.Pair; - @SuppressWarnings("unused") - public String getValue() { - return value; - } - } - - private static final String TAG = "upgrade_a"; - - @Inject - CustomDialog mUpgradeDialog; +public class UpgradeActivity extends BaseActivity + implements UpgradeView { + private static final String TAG = "billing"; + private final Logger logger = LoggerFactory.getLogger(TAG); @Inject - UpgradePresenter mUpgradePresenter; - - private boolean bBillingProcessFinished = false; - - private BillingType billingType = BillingType.Google; - + UpgradePresenter presenter; @Inject - AmazonBillingManager mAmazonBillingManager; - + AmazonBillingManager amazonBillingManager; @Inject - GoogleBillingManager mGoogleBillingManager; - - private final Logger mUpgradeLog = LoggerFactory.getLogger(TAG); - + GoogleBillingManager googleBillingManager; + private ActivityUpgradeBinding binding = null; + private boolean billingProcessFinished = false; + private BillingType billingType = BillingType.Google; private ProductDetails selectedProductDetails; - private Boolean upgradingFromWebsite = false; + private WindscribeInAppProduct plans = null; + public static Intent getStartIntent(Context context) { return new Intent(context, UpgradeActivity.class); } @@ -102,28 +89,267 @@ public static Intent getStartIntent(Context context) { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setActivityModule(new ActivityModule(this, this)).inject(this); - setContentLayout(R.layout.activity_upgrade, false); - - mUpgradeLog.info("OnCreate: Upgrade Activity"); + binding = DataBindingUtil.setContentView(this, R.layout.activity_upgrade); + setContentLayout(false); + addClickListeners(); + deactivatePlans(); + setTermAndPolicyText(); + logger.info("OnCreate: Upgrade Activity"); showProgressBar("Loading Billing Plans..."); // In app notification promo if (getIntent().hasExtra(PROMO_EXTRA)) { PushNotificationAction pushNotificationAction = (PushNotificationAction) getIntent() .getSerializableExtra(PROMO_EXTRA); - mUpgradePresenter.setPushNotificationAction(pushNotificationAction); + if (pushNotificationAction != null) { + presenter.setPushNotificationAction(pushNotificationAction); + } } else { // Push notification promo if (appContext.appLifeCycleObserver.getPushNotificationAction() != null) { - mUpgradePresenter.setPushNotificationAction(appContext.appLifeCycleObserver.getPushNotificationAction()); + presenter.setPushNotificationAction(appContext.appLifeCycleObserver.getPushNotificationAction()); } } setBillingType(); if (billingType == BillingType.Amazon) { - getLifecycle().addObserver(mAmazonBillingManager); + getLifecycle().addObserver(amazonBillingManager); initAmazonBillingLifecycleListeners(); } else { - getLifecycle().addObserver(mGoogleBillingManager); + getLifecycle().addObserver(googleBillingManager); initBillingLifecycleListeners(); + binding.restoreBtn.setVisibility(View.GONE); + } + } + + private void addClickListeners() { + binding.monthlyPlanContainer.setOnClickListener(v -> setActivePlan(true)); + binding.yearlyPlanContainer.setOnClickListener(v -> setActivePlan(false)); + binding.restoreBtn.setOnClickListener(v -> presenter.restorePurchase()); + binding.closeBtn.setOnClickListener(v -> finish()); + binding.subscribe.setOnClickListener(v -> { + String sku = v.getTag().toString(); + if (plans instanceof GoogleProducts) { + ProductDetails productDetails = ((GoogleProducts) plans).getSkuDetails(sku); + buyGoogleProduct(productDetails); + } else if (plans instanceof AmazonProducts) { + Product productDetails = ((AmazonProducts) plans).getProduct(sku); + presenter.onContinuePlanClick(productDetails); + } + }); + } + + private void buyGoogleProduct(ProductDetails productDetails) { + logger.info("User clicked on plan item..."); + String regionPlanUrl = presenter.regionalPlanIfAvailable(productDetails.getProductId()); + if (regionPlanUrl != null) { + presenter.onRegionalPlanSelected(regionPlanUrl); + } else { + this.selectedProductDetails = productDetails; + BillingFlowParams.ProductDetailsParams.Builder builder = BillingFlowParams.ProductDetailsParams.newBuilder(); + builder.setProductDetails(productDetails); + if (productDetails.getSubscriptionOfferDetails() != null) { + String offerToken = productDetails + .getSubscriptionOfferDetails() + .get(0) + .getOfferToken(); + builder.setOfferToken(offerToken); + } + ImmutableList productDetailsParamsList = ImmutableList.of(builder.build()); + presenter.buyGoogleProduct(productDetailsParamsList); + } + } + + private void setActivePlan(Boolean isMonthly) { + if (isMonthly) { + binding.yearlyPlanContainer.setActive(false); + binding.monthlyPlanContainer.setActive(true); + binding.monthlyPlanSelection.setChecked(true); + binding.yearlyPlanSelection.setChecked(false); + binding.subscribe.setTag(binding.monthlyPlanContainer.getTag()); + binding.subscribe.setEnabled(true); + } else { + binding.monthlyPlanContainer.setActive(false); + binding.yearlyPlanContainer.setActive(true); + binding.monthlyPlanSelection.setChecked(false); + binding.yearlyPlanSelection.setChecked(true); + binding.subscribe.setTag(binding.yearlyPlanContainer.getTag()); + binding.subscribe.setEnabled(true); + } + } + + private void hideMonthlyView() { + binding.monthlyPlanContainer.setVisibility(View.GONE); + binding.monthlyPlanSelection.setVisibility(View.GONE); + binding.monthlyBilled.setVisibility(View.GONE); + binding.monthlyPlanTitle.setVisibility(View.GONE); + binding.monthlyPlanPrice.setVisibility(View.GONE); + } + + private void hideYearlyView() { + binding.yearlyPlanContainer.setVisibility(View.GONE); + binding.yearlyPlanSelection.setVisibility(View.GONE); + binding.yearlyBilled.setVisibility(View.GONE); + binding.yearlyPlanTitle.setVisibility(View.GONE); + binding.yearlyPlanPrice.setVisibility(View.GONE); + binding.yearlyPlanDiscount.setVisibility(View.GONE); + } + + private void deactivatePlans() { + binding.monthlyPlanContainer.setActive(false); + binding.monthlyPlanContainer.setEnabled(false); + binding.yearlyPlanContainer.setActive(false); + binding.yearlyPlanSelection.setChecked(false); + binding.monthlyPlanPrice.setText("--"); + binding.yearlyPlanPrice.setText("--"); + binding.yearlyPlanDiscount.setVisibility(View.GONE); + binding.subscribe.setEnabled(false); + } + + private void setYearlyPlan(String yearlySku, @Nullable String monthlySku, boolean isPromo) { + String yearlyPrice = plans.getPrice(yearlySku); + binding.yearlyPlanPrice.setText(yearlyPrice); + binding.yearlyPlanContainer.setEnabled(true); + binding.yearlyPlanContainer.setTag(yearlySku); + + if (isPromo) { + String discount = plans.getDiscountLabel(yearlySku); + binding.yearlyPromoDiscount.setText(discount); + binding.yearlyPromoDiscount.setVisibility(View.VISIBLE); + binding.yearlyPlanDiscount.setVisibility(View.GONE); + + Pair exchangeRateWithCurrency = getExchangeRate(yearlySku); + String originalPriceStr = plans.getOriginalPrice(yearlySku); + + if (exchangeRateWithCurrency != null && originalPriceStr != null) { + try { + double originalPrice = Double.parseDouble(originalPriceStr); + double localFullPrice = exchangeRateWithCurrency.getSecond() * originalPrice; + String formattedPrice = String.format(Locale.getDefault(), "%.2f", localFullPrice); + String currency = exchangeRateWithCurrency.getFirst(); + SpannableString originalPriceSpan = new SpannableString(currency + " " + formattedPrice); + originalPriceSpan.setSpan(new StrikethroughSpan(), 0, originalPriceSpan.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + binding.yearlyBilled.setText(TextUtils.concat(originalPriceSpan, " ", yearlyPrice, " ", getString(R.string.charged_every_12_months))); + } catch (NumberFormatException ignored) { + } + } + } else { + setMonthlyBilledAmount(yearlySku, monthlySku); + } + } + + private @Nullable Pair getExchangeRate(String sku) { + Pair localPricePair = UiUtil.INSTANCE.getPriceWithCurrency(plans.getPrice(sku)); + Pair usdPricePair = UiUtil.INSTANCE.getPriceWithCurrency(plans.getUsdPrice(sku)); + if (localPricePair != null && usdPricePair != null) { + Double localPrice = localPricePair.getSecond(); + Double usdPrice = usdPricePair.getSecond(); + if (localPrice != null && usdPrice != null && usdPrice > 0) { + return new Pair<>(localPricePair.getFirst(), localPrice / usdPrice); + } + } + return null; + } + + private void setMonthlyPlan(String sku, boolean isPromo) { + String monthlyPrice = plans.getPrice(sku); + binding.monthlyPlanPrice.setText(monthlyPrice); + binding.monthlyPlanContainer.setEnabled(true); + binding.monthlyPlanContainer.setTag(sku); + + if (isPromo) { + String discount = plans.getDiscountLabel(sku); + binding.monthlyPromoDiscount.setText(discount); + binding.monthlyPromoDiscount.setVisibility(View.VISIBLE); + + Pair exchangeRateWithCurrency = getExchangeRate(sku); + String originalPriceStr = plans.getOriginalPrice(sku); + + if (exchangeRateWithCurrency != null && originalPriceStr != null) { + try { + double originalPrice = Double.parseDouble(originalPriceStr); + double localFullPrice = exchangeRateWithCurrency.getSecond() * originalPrice; + String formattedPrice = String.format(Locale.getDefault(), "%.2f", localFullPrice); + String currency = exchangeRateWithCurrency.getFirst(); + SpannableString originalPriceSpan = new SpannableString(currency + " " + formattedPrice); + originalPriceSpan.setSpan(new StrikethroughSpan(), 0, originalPriceSpan.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + binding.monthlyBilled.setText(TextUtils.concat(originalPriceSpan, " ", monthlyPrice, " ", getString(R.string.charged_every_month))); + + } catch (NumberFormatException ignored) { + } + } + } else { + binding.monthlyBilled.setText(getString(R.string.billed_monthly)); + } + } + + private void setMonthlyBilledAmount(String yearlySku, @Nullable String monthlySku) { + Pair yearlyPriceWithCurrency = UiUtil.INSTANCE.getPriceWithCurrency(plans.getPrice(yearlySku)); + if (yearlyPriceWithCurrency != null) { + double monthlyPrice = yearlyPriceWithCurrency.getSecond() / 12; + String monthly = String.format(Locale.getDefault(), "%s %.2f", yearlyPriceWithCurrency.getFirst(), monthlyPrice); + binding.yearlyBilled.setText(getString(R.string.monthly_billed, monthly)); + + if (monthlySku != null) { + Pair monthlyPriceWithCurrency = UiUtil.INSTANCE.getPriceWithCurrency(plans.getPrice(monthlySku)); + if (monthlyPriceWithCurrency != null) { + double monthlyPriceWithDiscount = monthlyPriceWithCurrency.getSecond(); + double discount = ((monthlyPriceWithDiscount - monthlyPrice) / monthlyPriceWithDiscount) * 100; + binding.yearlyPlanDiscount.setVisibility(View.VISIBLE); + binding.yearlyPlanDiscount.setText(String.format(Locale.getDefault(), "-%d%%", Math.round(discount))); + } + } + } else { + binding.yearlyBilled.setText(getString(R.string.yearly_billed)); + } + } + + private void setTermAndPolicyText() { + String appName = getString(R.string.app_name); + String termAndPolicyText = getString(R.string.terms_policy_en); + String fullText = appName + " " + termAndPolicyText; + Spannable spannable = new SpannableString(fullText); + int spanStart = fullText.length() - termAndPolicyText.length(); + spannable.setSpan( + new ForegroundColorSpan(Color.WHITE), + spanStart, + fullText.length(), + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE + ); + ClickableSpan termsSpan = new ClickableSpan() { + @Override + public void onClick(@NonNull View textView) { + openURLInBrowser(NetworkKeyConstants.getWebsiteLink(NetworkKeyConstants.URL_TERMS)); + } + + @Override + public void updateDrawState(@NonNull TextPaint textPaint) { + textPaint.setColor(textPaint.linkColor); + textPaint.setUnderlineText(true); + } + }; + + // Clickable span for Policy + ClickableSpan policySpan = new ClickableSpan() { + @Override + public void onClick(@NonNull View textView) { + openURLInBrowser(NetworkKeyConstants.getWebsiteLink(NetworkKeyConstants.URL_PRIVACY)); + } + + @Override + public void updateDrawState(@NonNull TextPaint textPaint) { + textPaint.setColor(textPaint.linkColor); + textPaint.setUnderlineText(true); + } + }; + int andIndex = fullText.indexOf("&"); + if (andIndex != -1) { + spannable.setSpan( + termsSpan, spanStart, andIndex - 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE + ); + spannable.setSpan( + policySpan, andIndex + 1, fullText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE + ); + binding.terms.setMovementMethod(LinkMovementMethod.getInstance()); + binding.terms.setText(spannable, TextView.BufferType.SPANNABLE); } } @@ -131,19 +357,17 @@ protected void onCreate(Bundle savedInstanceState) { protected void onResume() { super.onResume(); if (upgradingFromWebsite) { - goBackToMainActivity(); + finish(); } else { if (billingType == BillingType.Google) { - mUpgradePresenter.checkBillingProcessStatus(); + presenter.checkBillingProcessStatus(); } - mUpgradePresenter.setLayoutFromApiSession(); } } @Override protected void onDestroy() { - mUpgradeDialog.cancel(); - mUpgradePresenter.onDestroy(); + presenter.onDestroy(); super.onDestroy(); } @@ -154,33 +378,11 @@ public BillingType getBillingType() { @Override public void getProducts(List skuList) { - mAmazonBillingManager.getProducts(skuList); + amazonBillingManager.getProducts(skuList); } @Override public void goBackToMainActivity() { - mUpgradeLog.info("Going back to previous activity..."); - onBackPressed(); - } - - @Override - public void goToAddEmail() { - Intent startIntent = new Intent(this, AddEmailActivity.class); - startIntent.putExtra(goToHomeAfterFinish, false); - startActivity(startIntent); - } - - @Override - public void goToConfirmEmail() { - Intent startIntent = new Intent(this, ConfirmActivity.class); - startActivity(startIntent); - } - - @Override - public void gotToClaimAccount() { - Intent startIntent = WelcomeActivity.getStartIntent(this); - startIntent.putExtra("startFragmentName", "AccountSetUp"); - startActivity(startIntent); finish(); } @@ -191,31 +393,7 @@ public void hideProgressBar() { @Override public boolean isBillingProcessFinished() { - return bBillingProcessFinished; - } - - @Override - public void onContinuePlanClick(ProductDetails productDetails, int selectedIndex) { - if (productDetails != null) { - mUpgradeLog.info("User clicked on plan item..."); - String regionPlanUrl = mUpgradePresenter.regionalPlanIfAvailable(productDetails.getProductId()); - if (regionPlanUrl != null) { - mUpgradePresenter.onRegionalPlanSelected(regionPlanUrl); - } else { - this.selectedProductDetails = productDetails; - BillingFlowParams.ProductDetailsParams.Builder builder = BillingFlowParams.ProductDetailsParams.newBuilder(); - builder.setProductDetails(productDetails); - if (productDetails.getSubscriptionOfferDetails() != null) { - String offerToken = productDetails - .getSubscriptionOfferDetails() - .get(selectedIndex) - .getOfferToken(); - builder.setOfferToken(offerToken); - } - ImmutableList productDetailsParamsList = ImmutableList.of(builder.build()); - mUpgradePresenter.onMonthlyItemClicked(productDetailsParamsList); - } - } + return billingProcessFinished; } @Override @@ -224,15 +402,10 @@ public void openUrlInBrowser(String url) { openURLInBrowser(url); } - @Override - public void onContinuePlanClick(final Product selectedSku) { - mUpgradePresenter.onContinuePlanClick(selectedSku); - } - @Override public void onPurchaseCancelled() { - mUpgradeLog.info("Setting billing process finished..."); - bBillingProcessFinished = true; + logger.info("Setting billing process finished..."); + billingProcessFinished = true; } @Override @@ -240,76 +413,66 @@ public void onPurchaseSuccessful(@Nullable List purchases) { if (purchases != null) { Purchase purchase = purchases.get(0); if (selectedProductDetails != null && selectedProductDetails.getOneTimePurchaseOfferDetails() != null) { - mGoogleBillingManager.InAppConsume(purchase); + googleBillingManager.InAppConsume(purchase); } else { - mGoogleBillingManager.subscriptionConsume(purchase); + googleBillingManager.subscriptionConsume(purchase); } } } - @Override - public void onRestorePurchaseClick() { - mUpgradePresenter.restorePurchase(); - } - - @Override - public void onTenGbFreeClick() { - mUpgradeLog.info("User clicked on continue free..."); - mUpgradePresenter.onContinueFreeClick(); - } - - @Override - public void onPolicyClick() { - openURLInBrowser(NetworkKeyConstants.getWebsiteLink(NetworkKeyConstants.URL_PRIVACY)); - } - - @Override - public void onTermsClick() { - openURLInBrowser(NetworkKeyConstants.getWebsiteLink(NetworkKeyConstants.URL_TERMS)); - } - @Override public void querySkuDetails(List products) { - mUpgradeLog.info("Querying sku details..."); - mGoogleBillingManager.querySkuDetailsAsync(products); + logger.info("Querying sku details..."); + googleBillingManager.querySkuDetailsAsync(products); } @Override public void restorePurchase() { - mAmazonBillingManager.getPurchaseHistory(); + amazonBillingManager.getPurchaseHistory(); } @Override public void setBillingProcessStatus(boolean bProcessFinished) { - bBillingProcessFinished = bProcessFinished; + billingProcessFinished = bProcessFinished; } @Override - public void setEmailStatus(boolean isEmailAdded, boolean isEmailConfirmed) { - Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.cl_upgrade); - if (fragment instanceof PlansFragment) { - ((PlansFragment) fragment).setEmailStatus(isEmailAdded, isEmailConfirmed); + public void setupPlans(final WindscribeInAppProduct windscribeInAppProduct) { + if (windscribeInAppProduct.getSkus().isEmpty()) return; + this.plans = windscribeInAppProduct; + String monthly = plans.getMonthlyPlan(); + String yearly = plans.getYearlyPlan(); + String promo = plans.getPromoPlan(); + if (promo != null) { + if (monthly != null) { + hideYearlyView(); + setMonthlyPlan(monthly, true); + setActivePlan(true); + } else { + hideMonthlyView(); + setYearlyPlan(yearly, null, true); + setActivePlan(false); + } + binding.yearlyPlanSelection.setVisibility(View.GONE); + binding.monthlyPlanSelection.setVisibility(View.GONE); + } else { + if (monthly != null) setMonthlyPlan(monthly, false); + if (yearly != null) setYearlyPlan(yearly, monthly, false); + setActivePlan(true); } } @Override - public void showBillingDialog(final WindscribeInAppProduct windscribeInAppProduct, final boolean isEmailAdded, - final boolean isEmailConfirmed) { - PlansFragment.newInstance() - .add(this, windscribeInAppProduct, R.id.cl_upgrade, false, isEmailAdded, isEmailConfirmed); - } - - @Override - public void showBillingErrorDialog(String errorMessage) { + public void showBillingError(String errorMessage) { hideProgressBar(); - ErrorDialog.show(this, errorMessage, ThemeUtils.getColor(this, R.attr.overlayDialogBackgroundColor, R.color.colorDeepBlue90), true); + ErrorDialog.show(this, errorMessage, getResources().getColor(R.color.colorDeepNavy80), true); } @Override public void showProgressBar(final String progressHeaderText) { Fragment fragment = getSupportFragmentManager().findFragmentByTag(ProgressDialog.tag); if (!(fragment instanceof ProgressDialog)) { - ProgressDialog.show(this, progressHeaderText); + ProgressDialog.show(this, progressHeaderText, getResources().getColor(R.color.colorDeepNavy80)); } if (fragment instanceof ProgressDialog) { ((ProgressDialog) fragment).updateProgressStatus(progressHeaderText); @@ -318,7 +481,7 @@ public void showProgressBar(final String progressHeaderText) { @Override public void showToast(String toastText) { - mUpgradeLog.info("Showing toast to the user..."); + logger.info("Showing toast to the user..."); Toast.makeText(this, toastText, Toast.LENGTH_SHORT).show(); } @@ -329,83 +492,67 @@ public void startPurchaseFlow(ImmutableList { - mUpgradeLog.info("Billing client connected successfully..."); - mUpgradePresenter.onBillingSetupSuccessful(); + amazonBillingManager.onBillingSetUpSuccess.observe(this, code -> { + logger.info("Billing client connected successfully..."); + presenter.onBillingSetupSuccessful(); }); - mAmazonBillingManager.onProductsResponseSuccess - .observe(this, products -> mUpgradePresenter.onProductDataResponse(products)); + amazonBillingManager.onProductsResponseSuccess + .observe(this, products -> presenter.onProductDataResponse(products)); - mAmazonBillingManager.onProductsResponseFailure - .observe(this, requestStatus -> mUpgradePresenter.onProductResponseFailure()); + amazonBillingManager.onProductsResponseFailure + .observe(this, requestStatus -> presenter.onProductResponseFailure()); - mAmazonBillingManager.onPurchaseResponseSuccess - .observe(this, purchaseResponse -> mUpgradePresenter.onPurchaseResponse(purchaseResponse)); + amazonBillingManager.onPurchaseResponseSuccess + .observe(this, purchaseResponse -> presenter.onPurchaseResponse(purchaseResponse)); - mAmazonBillingManager.onPurchaseResponseFailure - .observe(this, requestStatus -> mUpgradePresenter.onPurchaseResponseFailure(requestStatus)); + amazonBillingManager.onPurchaseResponseFailure + .observe(this, requestStatus -> presenter.onPurchaseResponseFailure(requestStatus)); - mAmazonBillingManager.onAmazonPurchaseHistorySuccess - .observe(this, purchases -> mUpgradePresenter.onAmazonPurchaseHistorySuccess(purchases)); + amazonBillingManager.onAmazonPurchaseHistorySuccess + .observe(this, purchases -> presenter.onAmazonPurchaseHistorySuccess(purchases)); - mAmazonBillingManager.onAmazonPurchaseHistoryError - .observe(this, error -> mUpgradePresenter.onAmazonPurchaseHistoryError(error)); + amazonBillingManager.onAmazonPurchaseHistoryError + .observe(this, error -> presenter.onAmazonPurchaseHistoryError(error)); } void initBillingLifecycleListeners() { - mGoogleBillingManager.onBillingSetUpSuccess.observe(this, code -> { - mUpgradeLog.info("Billing client connected successfully..."); - mUpgradePresenter.onBillingSetupSuccessful(); + googleBillingManager.onBillingSetUpSuccess.observe(this, code -> { + logger.info("Billing client connected successfully..."); + presenter.onBillingSetupSuccessful(); }); - mGoogleBillingManager.onBillingSetupFailure.observe(this, code -> { - mUpgradeLog.info("Billing client set up failure..."); - mUpgradePresenter.onBillingSetupFailed(code); + googleBillingManager.onBillingSetupFailure.observe(this, code -> { + logger.info("Billing client set up failure..."); + presenter.onBillingSetupFailed(code); }); - mGoogleBillingManager.onProductConsumeSuccess.observe(this, purchase -> { - mUpgradeLog.info("Product consumption successful..."); + googleBillingManager.onProductConsumeSuccess.observe(this, purchase -> { + logger.info("Product consumption successful..."); showToast(getResources().getString(R.string.purchase_successful)); - mUpgradePresenter.onPurchaseConsumed(purchase); + presenter.onPurchaseConsumed(purchase); }); - mGoogleBillingManager.onProductConsumeFailure.observe(this, customPurchase -> { - mUpgradeLog.debug("Product consumption failed..."); - mUpgradePresenter.onConsumeFailed(customPurchase.getResponseCode(), customPurchase.getPurchase()); + googleBillingManager.onProductConsumeFailure.observe(this, customPurchase -> { + logger.debug("Product consumption failed..."); + presenter.onConsumeFailed(customPurchase.getResponseCode(), customPurchase.getPurchase()); }); - mGoogleBillingManager.purchaseUpdateEvent.observe(this, customPurchases -> { - mUpgradeLog.info("Purchase updated..."); - mUpgradePresenter.onPurchaseUpdated(customPurchases.getResponseCode(), customPurchases.getPurchase()); + googleBillingManager.purchaseUpdateEvent.observe(this, customPurchases -> { + logger.info("Purchase updated..."); + presenter.onPurchaseUpdated(customPurchases.getResponseCode(), customPurchases.getPurchase()); }); - mGoogleBillingManager.querySkuDetailEvent.observe(this, customSkuDetails -> mUpgradePresenter + googleBillingManager.querySkuDetailEvent.observe(this, customSkuDetails -> presenter .onSkuDetailsReceived(customSkuDetails.getBillingResult().getResponseCode(), customSkuDetails.getProductDetails())); @@ -420,4 +567,27 @@ private void setBillingType() { billingType = BillingType.Google; } } + + @Override + public void goToSuccessfulUpgrade(Boolean isGhostAccount) { + Intent startIntent = new Intent(this, UpgradeSuccessActivity.class); + startIntent.putExtra("isGhostAccount", isGhostAccount); + startActivity(startIntent); + finish(); + } + + public enum BillingType { + Google("android"), Amazon("amazon"); + + private final String value; + + BillingType(String value) { + this.value = value; + } + + @SuppressWarnings("unused") + public String getValue() { + return value; + } + } } diff --git a/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradePresenter.java b/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradePresenter.java index b20b218c5..269a2fbad 100644 --- a/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradePresenter.java +++ b/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradePresenter.java @@ -34,13 +34,11 @@ public interface UpgradePresenter { void onConsumeFailed(int responseCode, Purchase purchase); - void onContinueFreeClick(); - void onContinuePlanClick(final Product selectedSku); void onDestroy(); - void onMonthlyItemClicked(@Nullable ImmutableList productDetailsParams); + void buyGoogleProduct(@Nullable ImmutableList productDetailsParams); void onProductDataResponse(Map products); @@ -58,8 +56,6 @@ public interface UpgradePresenter { void restorePurchase(); - void setLayoutFromApiSession(); - void setPurchaseFlowState(PurchaseState state); void setPushNotificationAction(@NonNull PushNotificationAction pushNotificationAction); diff --git a/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradePresenterImpl.java b/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradePresenterImpl.java index d5630eed7..31c07c815 100644 --- a/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradePresenterImpl.java +++ b/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradePresenterImpl.java @@ -15,18 +15,13 @@ import static com.android.billingclient.api.BillingClient.BillingResponseCode.OK; import static com.android.billingclient.api.BillingClient.BillingResponseCode.SERVICE_UNAVAILABLE; import static com.android.billingclient.api.BillingClient.BillingResponseCode.USER_CANCELED; -import static com.windscribe.vpn.constants.ApiConstants.PAY_ID; -import static com.windscribe.vpn.constants.ApiConstants.PROMO_CODE; import static com.windscribe.vpn.constants.BillingConstants.AMAZON_PURCHASED_ITEM; -import static com.windscribe.vpn.constants.BillingConstants.AMAZON_PURCHASE_TYPE; -import static com.windscribe.vpn.constants.BillingConstants.AMAZON_USER_ID; import static com.windscribe.vpn.constants.BillingConstants.GP_PACKAGE_NAME; import static com.windscribe.vpn.constants.BillingConstants.GP_PRODUCT_ID; import static com.windscribe.vpn.constants.BillingConstants.PLAY_STORE_UPDATE; import static com.windscribe.vpn.constants.BillingConstants.PURCHASED_ITEM; import static com.windscribe.vpn.constants.BillingConstants.PURCHASED_ITEM_NULL; import static com.windscribe.vpn.constants.BillingConstants.PURCHASE_TOKEN; -import static com.windscribe.vpn.constants.BillingConstants.PURCHASE_TYPE; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -61,13 +56,10 @@ import com.windscribe.vpn.commonutils.RegionLocator; import com.windscribe.vpn.constants.BillingConstants; import com.windscribe.vpn.constants.NetworkErrorCodes; -import com.windscribe.vpn.constants.PreferencesKeyConstants; -import com.windscribe.vpn.constants.UserStatusConstants; import com.windscribe.vpn.errormodel.WindError; import com.windscribe.vpn.exceptions.GenericApiException; import com.windscribe.vpn.exceptions.InvalidSessionException; import com.windscribe.vpn.exceptions.UnknownException; -import com.windscribe.vpn.model.User; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; @@ -79,6 +71,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.concurrent.TimeUnit; import javax.inject.Inject; @@ -94,21 +87,15 @@ public class UpgradePresenterImpl implements UpgradePresenter { - private static final String TAG = "upgrade_p"; - + private static final String TAG = "billing"; + private final Logger presenterLog = LoggerFactory.getLogger(TAG); private Purchase mPurchase; - private PushNotificationAction mPushNotificationAction; - private ActivityInteractor mUpgradeInteractor; - private UpgradeView mUpgradeView; - private List mobileBillingPlans = new ArrayList<>(); private BillingPlanResponse.OverriddenPlans overriddenPlans = null; - private final Logger presenterLog = LoggerFactory.getLogger(TAG); - @Inject public UpgradePresenterImpl(UpgradeView mUpgradeView, ActivityInteractor activityInteractor) { this.mUpgradeView = mUpgradeView; @@ -126,7 +113,6 @@ public void onDestroy() { } if (!mUpgradeInteractor.getCompositeDisposable().isDisposed()) { - presenterLog.info("Disposing network observer..."); mUpgradeInteractor.getCompositeDisposable().dispose(); } @@ -136,10 +122,8 @@ public void onDestroy() { @Override public void checkBillingProcessStatus() { - //If the billing process status is true then go back to main activity if (mUpgradeView.isBillingProcessFinished()) { mUpgradeView.setBillingProcessStatus(false); - mUpgradeView.goBackToMainActivity(); } } @@ -163,11 +147,11 @@ public void handleAmazonPurchase(final Receipt receipt, final UserData userData) verifyAmazonReceipt(amazonPurchase); } catch (Exception ignored) { presenterLog.debug("Error saving fulfilling amazon order."); - mUpgradeView.showBillingErrorDialog("Error saving fulfilling amazon order."); + mUpgradeView.showBillingError("Error saving fulfilling amazon order."); } } else { presenterLog.debug("Subscription/Consumable with receipt is already cancelled."); - mUpgradeView.showBillingErrorDialog("Receipt cancelled already."); + mUpgradeView.showBillingError("Receipt cancelled already."); } } @@ -200,7 +184,7 @@ public void onSuccess(@NonNull final String accountID) { @Override public void onAmazonPurchaseHistoryError(final String error) { mUpgradeView.hideProgressBar(); - mUpgradeView.showBillingErrorDialog(error); + mUpgradeView.showBillingError(error); } @Override @@ -212,7 +196,7 @@ public void onAmazonPurchaseHistorySuccess(final List amazonPurc public void onBillingSetupFailed(int errorCode) { String errorMessage = getBillingErrorMessage(errorCode); if (mUpgradeView != null) { - mUpgradeView.showBillingErrorDialog(errorMessage); + mUpgradeView.showBillingError(errorMessage); } } @@ -248,28 +232,13 @@ public void onConsumeFailed(int responseCode, Purchase purchase) { onBillingSetupFailed(responseCode); } - @Override - public void onContinueFreeClick() { - User user = mUpgradeInteractor.getUserRepository().getUser().getValue(); - if(user!=null){ - boolean userLoggedIn = mUpgradeInteractor.getAppPreferenceInterface().getSessionHash() != null; - if (user.isGhost()) { - mUpgradeView.gotToClaimAccount(); - } else if (userLoggedIn && user.getEmailStatus() == User.EmailStatus.NoEmail) { - mUpgradeView.goToAddEmail(); - } else if (userLoggedIn && user.getEmailStatus() == User.EmailStatus.EmailProvided) { - mUpgradeView.goToConfirmEmail(); - } - } - } - @Override public void onContinuePlanClick(final Product selectedSku) { mUpgradeView.startPurchaseFlow(selectedSku); } @Override - public void onMonthlyItemClicked(@Nullable ImmutableList productDetailsParams) { + public void buyGoogleProduct(@Nullable ImmutableList productDetailsParams) { if (productDetailsParams != null) { //Start purchase flow presenterLog.info("Starting purchase flow..."); @@ -283,36 +252,8 @@ public void onMonthlyItemClicked(@Nullable ImmutableList products) { - mUpgradeInteractor.getCompositeDisposable().add( - mUpgradeInteractor.getUserSessionData() - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribeWith(new DisposableSingleObserver() { - @Override - public void onError(@NotNull Throwable e) { - presenterLog.debug("Error reading user session response..." + e - .getLocalizedMessage()); - if (mUpgradeView != null) { - mUpgradeView.hideProgressBar(); - mUpgradeView.showBillingDialog( - new AmazonProducts(products, mobileBillingPlans, mPushNotificationAction), - true, true); - } - } - - @Override - public void onSuccess(@NotNull UserSessionResponse userSessionResponse) { - presenterLog.info("Showing upgrade dialog to the user..."); - if (mUpgradeView != null) { - mUpgradeView.hideProgressBar(); - mUpgradeView.showBillingDialog( - new AmazonProducts(products, mobileBillingPlans, mPushNotificationAction), - userSessionResponse.getUserEmail() != null, - userSessionResponse.getEmailStatus() - == UserStatusConstants.EMAIL_STATUS_CONFIRMED); - } - } - })); + mUpgradeView.hideProgressBar(); + mUpgradeView.setupPlans(new AmazonProducts(products, mobileBillingPlans, mPushNotificationAction)); } @Override @@ -347,7 +288,7 @@ public void onPurchaseConsumed(Purchase itemPurchased) { public void onError(@NotNull Throwable e) { presenterLog.debug("Payment verification failed. " + WindError.getInstance().convertThrowableToString(e)); if (mUpgradeView != null) { - mUpgradeView.showBillingErrorDialog("Payment verification failed!"); + mUpgradeView.showBillingError("Payment verification failed!"); } } @@ -447,21 +388,17 @@ public void onSkuDetailsReceived(int responseCode, final List pr if (mUpgradeInteractor == null | mUpgradeView == null) { return; } - if (responseCode == OK && productDetails.size() > 0) { - mUpgradeInteractor.getCompositeDisposable().add( - mUpgradeInteractor.getUserSessionData() - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(userSession -> onUserSessionResponse(productDetails, userSession), - throwable -> onUserSessionResponseError(productDetails, throwable))); - } else if (productDetails.size() == 0) { + if (responseCode == OK && !productDetails.isEmpty()) { + mUpgradeView.hideProgressBar(); + mUpgradeView.setupPlans(new GoogleProducts(productDetails, mobileBillingPlans, mPushNotificationAction)); + } else if (productDetails.isEmpty()) { presenterLog.debug("Failed to find requested products from the store."); - mUpgradeView.showBillingErrorDialog("Promo is not valid anymore."); + mUpgradeView.showBillingError("Promo is not valid anymore."); } else { String errorMessage = getBillingErrorMessage(responseCode); presenterLog.debug("Error while retrieving sku details from play billing. Error Code: " + responseCode + " Message: " + errorMessage); - mUpgradeView.showBillingErrorDialog(errorMessage); + mUpgradeView.showBillingError(errorMessage); } } @@ -471,40 +408,6 @@ public void restorePurchase() { mUpgradeView.restorePurchase(); } - @Override - public void setLayoutFromApiSession() { - mUpgradeInteractor.getCompositeDisposable().add(mUpgradeInteractor.getApiCallManager() - .getSessionGeneric(null) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribeWith( - new DisposableSingleObserver>() { - @Override - public void onError(@NotNull Throwable e) { - //Error in API Call - presenterLog.debug("Error while making get session call:" + e.getMessage()); - } - - @Override - public void onSuccess( - @NotNull GenericResponseClass userSessionResponse) { - if (userSessionResponse.getDataClass() != null) { - mUpgradeInteractor.getAppPreferenceInterface() - .saveResponseStringData(PreferencesKeyConstants.GET_SESSION, - new Gson().toJson(userSessionResponse.getDataClass())); - mUpgradeView - .setEmailStatus(userSessionResponse.getDataClass().getUserEmail() != null, - userSessionResponse.getDataClass().getEmailStatus() - == UserStatusConstants.EMAIL_STATUS_CONFIRMED); - } else if (userSessionResponse.getErrorClass() != null) { - //Server responded with error! - presenterLog.debug("Server returned error during get session call." - + userSessionResponse.getErrorClass().toString()); - } - } - })); - } - @Override public void setPurchaseFlowState(PurchaseState state) { mUpgradeInteractor.getAppPreferenceInterface().savePurchaseFlowState(state.name()); @@ -521,7 +424,7 @@ public void setPushNotificationAction(@NonNull PushNotificationAction pushNotifi private List billingResponseToSkuList(BillingPlanResponse billingPlanResponse) { List inAppSkuList = new ArrayList<>(); - if (billingPlanResponse.getPlansList().size() > 0) { + if (!billingPlanResponse.getPlansList().isEmpty()) { this.mobileBillingPlans = billingPlanResponse.getPlansList(); this.overriddenPlans = billingPlanResponse.getOverriddenPlans(); presenterLog.debug("Getting in app skus from billing plan..."); @@ -616,7 +519,7 @@ private void onBillingResponse(GenericResponseClass skuList = billingResponseToSkuList(billingPlanResponse.getDataClass()); - if (skuList.size() > 0) { + if (!skuList.isEmpty()) { if (mUpgradeView.getBillingType() == UpgradeActivity.BillingType.Amazon) { presenterLog.debug("Querying amazon products"); mUpgradeView.getProducts(skuList); @@ -638,15 +541,15 @@ public String apply(BillingPlanResponse.BillingPlans billingPlans) { mUpgradeView.querySkuDetails(products); } } else if (mPushNotificationAction != null) { - mUpgradeView.showBillingErrorDialog("Promo is not valid anymore."); + mUpgradeView.showBillingError("Promo is not valid anymore."); } else { - mUpgradeView.showBillingErrorDialog("Failed to get billing plans check your network connection."); + mUpgradeView.showBillingError("Failed to get billing plans check your network connection."); } } else if (billingPlanResponse.getErrorClass() != null) { presenterLog.debug(String .format("Billing response error: %s", billingPlanResponse.getErrorClass().getErrorMessage())); - mUpgradeView.showBillingErrorDialog(billingPlanResponse.getErrorClass().getErrorMessage()); + mUpgradeView.showBillingError(billingPlanResponse.getErrorClass().getErrorMessage()); } } @@ -654,29 +557,7 @@ private void onBillingResponseError(Throwable throwable) { presenterLog .debug("Failed to get the billing plans... proceeding with default plans" + WindError.getInstance() .convertThrowableToString(throwable)); - mUpgradeView.showBillingErrorDialog("Failed to get billing plans check your network connection."); - } - - private void onUserSessionResponse(List productDetails, UserSessionResponse userSessionResponse) { - presenterLog.info("Showing upgrade dialog to the user..."); - if (mUpgradeView != null) { - mUpgradeView.hideProgressBar(); - mUpgradeView.showBillingDialog( - new GoogleProducts(productDetails, mobileBillingPlans, mPushNotificationAction), - userSessionResponse.getUserEmail() != null, - userSessionResponse.getEmailStatus() - == UserStatusConstants.EMAIL_STATUS_CONFIRMED); - } - } - - private void onUserSessionResponseError(List productDetails, Throwable throwable) { - //We failed to get the data remaining - presenterLog.debug("Error reading user session response..." + throwable.getLocalizedMessage()); - if (mUpgradeView != null) { - mUpgradeView.hideProgressBar(); - mUpgradeView.showBillingDialog( - new GoogleProducts(productDetails, mobileBillingPlans, mPushNotificationAction), true, true); - } + mUpgradeView.showBillingError("Failed to get billing plans check your network connection."); } private Completable postPromoPaymentConfirmation() { @@ -701,7 +582,7 @@ private void saveAmazonSubscriptionRecord(final AmazonPurchase amazonPurchase) { private void showBillingError(ApiErrorResponse errorResponse) { presenterLog.info(errorResponse.toString()); - mUpgradeView.showBillingErrorDialog(errorResponse.getErrorMessage()); + mUpgradeView.showBillingError(errorResponse.getErrorMessage()); if (errorResponse.getErrorCode() == 4005) { presenterLog.debug("Purchase flow: Token was already verified once. Ignore"); mUpgradeInteractor.getAppPreferenceInterface() @@ -711,10 +592,10 @@ private void showBillingError(ApiErrorResponse errorResponse) { private Completable updateUserStatus() { return getUserSession().flatMapCompletable(userSessionResponse -> - Completable.fromAction(() -> mUpgradeInteractor.getUserRepository().reload(userSessionResponse,null)) + Completable.fromAction(() -> mUpgradeInteractor.getUserRepository().reload(userSessionResponse, null)) .doFinally(() -> mUpgradeInteractor.getServerListUpdater().load()) .doOnError(throwable -> presenterLog.debug("Error updating user status table. " - + WindError.getInstance().convertThrowableToString(throwable)))); + + WindError.getInstance().convertThrowableToString(throwable)))); } private void upgradeUserAccount() { @@ -723,7 +604,7 @@ private void upgradeUserAccount() { mUpgradeInteractor.getCompositeDisposable() .add((mPushNotificationAction != null ? postPromoPaymentConfirmation() : Completable.fromAction(() -> { - })) + })) .andThen(mUpgradeInteractor.getConnectionDataUpdater().update()) .andThen(mUpgradeInteractor.getServerListUpdater().update()) .andThen(updateUserStatus()) @@ -740,11 +621,7 @@ public void onComplete() { .getUserStatus()); boolean ghostMode = mUpgradeInteractor.getAppPreferenceInterface() .userIsInGhostMode(); - if (ghostMode) { - mUpgradeView.startSignUpActivity(); - } else { - mUpgradeView.startWindscribeActivity(); - } + mUpgradeView.goToSuccessfulUpgrade(ghostMode); } @Override @@ -752,7 +629,9 @@ public void onError(@NotNull Throwable e) { presenterLog.debug("Could not modify the server list data..." + WindError.getInstance().convertThrowableToString(e)); mUpgradeView.hideProgressBar(); - mUpgradeView.startWindscribeActivity(); + boolean ghostMode = mUpgradeInteractor.getAppPreferenceInterface() + .userIsInGhostMode(); + mUpgradeView.goToSuccessfulUpgrade(ghostMode); } })); @@ -772,9 +651,9 @@ private void verifyAmazonReceipt(final AmazonPurchase amazonPurchase) { @Override public void onError(@NotNull Throwable e) { presenterLog.debug("Payment verification failed. " + WindError.getInstance() - .convertThrowableToString(e)); + .convertThrowableToString(e)); if (mUpgradeView != null) { - mUpgradeView.showBillingErrorDialog("Payment verification failed!"); + mUpgradeView.showBillingError("Payment verification failed!"); } } @@ -805,12 +684,12 @@ public void onSuccess(@NotNull GenericResponseClass webSession) { mUpgradeView.hideProgressBar(); if (webSession.getDataClass() != null) { - String urlWithSession = url+"&temp_session=" + webSession.getDataClass().getTempSession(); - presenterLog.debug("Url: "+urlWithSession); + String urlWithSession = url + "&temp_session=" + webSession.getDataClass().getTempSession(); + presenterLog.debug("Url: " + urlWithSession); mUpgradeView.openUrlInBrowser(urlWithSession); } else if (webSession.getErrorClass() != null) { - mUpgradeView.showBillingErrorDialog(webSession.getErrorClass().getErrorMessage()); + mUpgradeView.showBillingError(webSession.getErrorClass().getErrorMessage()); } else { - mUpgradeView.showBillingErrorDialog("Unable to generate web session. Check your network connection."); + mUpgradeView.showBillingError("Unable to generate web session. Check your network connection."); } } })); diff --git a/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradeSuccessActivity.kt b/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradeSuccessActivity.kt new file mode 100644 index 000000000..809f1c8f3 --- /dev/null +++ b/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradeSuccessActivity.kt @@ -0,0 +1,49 @@ +package com.windscribe.mobile.upgradeactivity + +import android.os.Bundle +import androidx.databinding.DataBindingUtil +import com.windscribe.mobile.R +import com.windscribe.mobile.base.BaseActivity +import com.windscribe.mobile.databinding.ActivityUpgradeSuccessBinding +import com.windscribe.mobile.welcome.WelcomeActivity.Companion.getStartIntent +import com.windscribe.vpn.constants.NetworkKeyConstants + +class UpgradeSuccessActivity: BaseActivity() { + + private lateinit var binding: ActivityUpgradeSuccessBinding + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + binding = DataBindingUtil.setContentView(this, R.layout.activity_upgrade_success); + setContentLayout(false) + addClickListeners() + } + + private fun addClickListeners() { + binding.closeBtn.setOnClickListener { + finish() + } + binding.startUsingPro.setOnClickListener { + if (intent.getBooleanExtra("isGhostAccount", false)) { + val startIntent = getStartIntent(this) + startIntent.putExtra("startFragmentName", "AccountSetUp") + startActivity(startIntent) + finish() + } else { + finish() + } + } + binding.discord.onClick { + openURLInBrowser(NetworkKeyConstants.URL_DISCORD) + } + binding.reddit.onClick { + openURLInBrowser(NetworkKeyConstants.URL_REDDIT) + } + binding.youtube.onClick { + openURLInBrowser(NetworkKeyConstants.URL_YOUTUBE) + } + binding.x.onClick { + openURLInBrowser(NetworkKeyConstants.URL_X) + } + + } +} \ No newline at end of file diff --git a/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradeView.java b/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradeView.java index 5b963f1c0..f859dd69a 100644 --- a/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradeView.java +++ b/mobile/src/google/java/com/windscribe/mobile/upgradeactivity/UpgradeView.java @@ -23,12 +23,6 @@ public interface UpgradeView { void goBackToMainActivity(); - void goToAddEmail(); - - void goToConfirmEmail(); - - void gotToClaimAccount(); - void hideProgressBar(); boolean isBillingProcessFinished(); @@ -44,12 +38,9 @@ public interface UpgradeView { void setBillingProcessStatus(boolean bProcessFinished); - void setEmailStatus(boolean isEmailAdded, boolean isEmailConfirmed); - - void showBillingDialog(final WindscribeInAppProduct windscribeInAppProduct, boolean isEmailAdded, - boolean isEmailConfirmed); + void setupPlans(final WindscribeInAppProduct windscribeInAppProduct); - void showBillingErrorDialog(String errorMessage); + void showBillingError(String errorMessage); void showProgressBar(String message); @@ -59,9 +50,7 @@ void showBillingDialog(final WindscribeInAppProduct windscribeInAppProduct, bool void startPurchaseFlow(Product product); - void startSignUpActivity(); - - void startWindscribeActivity(); - void openUrlInBrowser(String url); + + void goToSuccessfulUpgrade(Boolean isGhostAccount); } diff --git a/mobile/src/main/AndroidManifest.xml b/mobile/src/main/AndroidManifest.xml index 9f8e1e2a2..eaf3dfc68 100644 --- a/mobile/src/main/AndroidManifest.xml +++ b/mobile/src/main/AndroidManifest.xml @@ -102,6 +102,8 @@ + diff --git a/mobile/src/main/java/com/windscribe/mobile/about/AboutActivity.kt b/mobile/src/main/java/com/windscribe/mobile/about/AboutActivity.kt index cabc24ea4..b33fcd12e 100644 --- a/mobile/src/main/java/com/windscribe/mobile/about/AboutActivity.kt +++ b/mobile/src/main/java/com/windscribe/mobile/about/AboutActivity.kt @@ -54,7 +54,7 @@ class AboutActivity : BaseActivity(), AboutView { @BindView(R.id.nav_title) lateinit var activityTitleView: TextView - private val logger = LoggerFactory.getLogger("about_a") + private val logger = LoggerFactory.getLogger("basic") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/mobile/src/main/java/com/windscribe/mobile/account/AccountActivity.kt b/mobile/src/main/java/com/windscribe/mobile/account/AccountActivity.kt index 4ec8de139..fe6638cd2 100644 --- a/mobile/src/main/java/com/windscribe/mobile/account/AccountActivity.kt +++ b/mobile/src/main/java/com/windscribe/mobile/account/AccountActivity.kt @@ -123,7 +123,7 @@ class AccountActivity : BaseActivity(), AccountView, AccountFragmentCallback { lateinit var presenter: AccountPresenter var alertDialog: AlertDialog? = null - private val logger = LoggerFactory.getLogger("account_a") + private val logger = LoggerFactory.getLogger("basic") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) DaggerActivityComponent.builder().activityModule(ActivityModule(this, this)) @@ -282,7 +282,6 @@ class AccountActivity : BaseActivity(), AccountView, AccountFragmentCallback { infoIcon: Int, containerBackground: Int ) { - logger.info("Setting up confirmed email layout.") tvAccountEmail.text = emailConfirm tvAccountEmail.setTextColor(emailColor) warningContainer.visibility = View.GONE @@ -296,7 +295,6 @@ class AccountActivity : BaseActivity(), AccountView, AccountFragmentCallback { } override fun setPlanName(planName: String) { - logger.info("Displaying user plan name ...") tvPlanData.text = planName } @@ -314,13 +312,11 @@ class AccountActivity : BaseActivity(), AccountView, AccountFragmentCallback { } override fun setResetDate(resetDateLabel: String, resetDate: String) { - logger.info("Displaying user next reset date ...") tvResetDateLabel.text = resetDateLabel tvResetDate.text = resetDate } override fun setUsername(username: String) { - logger.info("Displaying account username ...") tvAccountUserName.text = username } @@ -332,7 +328,6 @@ class AccountActivity : BaseActivity(), AccountView, AccountFragmentCallback { } override fun setupLayoutForFreeUser(upgradeText: String, color: Int) { - logger.info("Setting up layout for free user...") tvUpgradeInfo.text = upgradeText tvUpgradeInfo.setTextColor(color) } @@ -342,7 +337,6 @@ class AccountActivity : BaseActivity(), AccountView, AccountFragmentCallback { } override fun setupLayoutForPremiumUser(upgradeText: String, color: Int) { - logger.info("Setting up layout for premium user...") tvUpgradeInfo.text = upgradeText tvUpgradeInfo.setTextColor(color) } diff --git a/mobile/src/main/java/com/windscribe/mobile/account/AccountPresenterImpl.kt b/mobile/src/main/java/com/windscribe/mobile/account/AccountPresenterImpl.kt index 25229d992..6f38a4bf2 100644 --- a/mobile/src/main/java/com/windscribe/mobile/account/AccountPresenterImpl.kt +++ b/mobile/src/main/java/com/windscribe/mobile/account/AccountPresenterImpl.kt @@ -38,7 +38,7 @@ class AccountPresenterImpl @Inject constructor( private val accountView: AccountView, private val interactor: ActivityInteractor ) : AccountPresenter { - private val logger = LoggerFactory.getLogger("account_p") + private val logger = LoggerFactory.getLogger("basic") private val successMessage = """ Sweet, you should be diff --git a/mobile/src/main/java/com/windscribe/mobile/adapter/FavouriteAdapter.java b/mobile/src/main/java/com/windscribe/mobile/adapter/FavouriteAdapter.java index 834a20ab0..4737a33b9 100644 --- a/mobile/src/main/java/com/windscribe/mobile/adapter/FavouriteAdapter.java +++ b/mobile/src/main/java/com/windscribe/mobile/adapter/FavouriteAdapter.java @@ -170,9 +170,9 @@ private void setClickListeners(City city, FavoriteViewHolder holder) { //On click item holder.itemView.setOnClickListener(v -> { if (!city.nodesAvailable() && city.getPro() != 1) { - mListener.onUnavailableRegion(); + mListener.onUnavailableRegion(false); } else if (!city.nodesAvailable() && city.getPro() == 1 && dataDetails.isProUser()) { - mListener.onUnavailableRegion(); + mListener.onUnavailableRegion(false); } else { mListener.onCityClick(city.getId()); } diff --git a/mobile/src/main/java/com/windscribe/mobile/adapter/RegionsAdapter.java b/mobile/src/main/java/com/windscribe/mobile/adapter/RegionsAdapter.java index ef6363cb3..478993848 100644 --- a/mobile/src/main/java/com/windscribe/mobile/adapter/RegionsAdapter.java +++ b/mobile/src/main/java/com/windscribe/mobile/adapter/RegionsAdapter.java @@ -129,7 +129,7 @@ public void setGroupClickListener(Region region, RegionViewHolder holder) { holder.itemView.setOnClickListener(view -> { if (serverListData.isProUser() && region.getStatus() == NetworkKeyConstants.SERVER_STATUS_TEMPORARILY_UNAVAILABLE) { - mListener.onUnavailableRegion(); + mListener.onUnavailableRegion(false); } else { holder.onClick(view); } @@ -139,7 +139,7 @@ public void setGroupClickListener(Region region, RegionViewHolder holder) { holder.imgDropDown.setOnClickListener(view -> { if (serverListData.isProUser() && region.getStatus() == NetworkKeyConstants.SERVER_STATUS_TEMPORARILY_UNAVAILABLE) { - mListener.onUnavailableRegion(); + mListener.onUnavailableRegion(false); } else { holder.onClick(view); } @@ -298,9 +298,9 @@ private void setClickListeners(City city, CityViewHolder holder) { return; } if (!city.nodesAvailable() && city.getPro() != 1) { - mListener.onUnavailableRegion(); + mListener.onUnavailableRegion(false); } else if (!city.nodesAvailable() && city.getPro() == 1 && serverListData.isProUser()) { - mListener.onUnavailableRegion(); + mListener.onUnavailableRegion(false); } else { mListener.onCityClick(city.getId()); } diff --git a/mobile/src/main/java/com/windscribe/mobile/adapter/StaticRegionAdapter.java b/mobile/src/main/java/com/windscribe/mobile/adapter/StaticRegionAdapter.java index 73311ebd4..180c7d2b5 100644 --- a/mobile/src/main/java/com/windscribe/mobile/adapter/StaticRegionAdapter.java +++ b/mobile/src/main/java/com/windscribe/mobile/adapter/StaticRegionAdapter.java @@ -28,15 +28,13 @@ public class StaticRegionAdapter extends RecyclerView.Adapter { - private ServerListData dataDetails; - private final ListViewClickListener mListener; - + private ServerListData dataDetails; private List mStaticIpList; public StaticRegionAdapter(List mStaticIpList, ServerListData dataDetails, - ListViewClickListener mListener) { + ListViewClickListener mListener) { this.mStaticIpList = mStaticIpList; this.dataDetails = dataDetails; this.mListener = mListener; @@ -50,8 +48,10 @@ public int getItemCount() { @Override public void onBindViewHolder(@NonNull StaticRegionHolder staticRegionHolder, int i) { //Setup icon - if (NetworkKeyConstants.STATIC_IP_TYPE_DATA_CENTER - .equals(mStaticIpList.get(staticRegionHolder.getAdapterPosition()).getType())) { + StaticRegion region = mStaticIpList.get(staticRegionHolder.getAdapterPosition()); + if (region.getStatus() != null && region.getStatus() == 0) { + staticRegionHolder.mImageIpType.setImageResource(R.drawable.ic_under_construction); + } else if (NetworkKeyConstants.STATIC_IP_TYPE_DATA_CENTER.equals(region.getType())) { staticRegionHolder.mImageIpType.setImageResource(R.drawable.ic_datacenter_ip_icon); } else { staticRegionHolder.mImageIpType.setImageResource(R.drawable.ic_residential_ip_icon); @@ -93,8 +93,14 @@ public void onBindViewHolder(@NonNull StaticRegionHolder staticRegionHolder, int } } - staticRegionHolder.itemView.setOnClickListener( - v -> mListener.onStaticIpClick(mStaticIpList.get(staticRegionHolder.getAdapterPosition()).getId())); + staticRegionHolder.itemView.setOnClickListener(v -> { + StaticRegion staticRegion = mStaticIpList.get(staticRegionHolder.getAdapterPosition()); + if (staticRegion.getStatus() != null && staticRegion.getStatus() == 0) { + mListener.onUnavailableRegion(true); + } else { + mListener.onStaticIpClick(staticRegion.getId()); + } + }); setTouchListener(staticRegionHolder); } diff --git a/mobile/src/main/java/com/windscribe/mobile/base/BaseActivity.kt b/mobile/src/main/java/com/windscribe/mobile/base/BaseActivity.kt index 95d9ed7af..d0c127b30 100644 --- a/mobile/src/main/java/com/windscribe/mobile/base/BaseActivity.kt +++ b/mobile/src/main/java/com/windscribe/mobile/base/BaseActivity.kt @@ -110,13 +110,17 @@ abstract class BaseActivity : AppCompatActivity() { } protected fun setContentLayout(layoutID: Int, setTheme: Boolean = true) { + setContentLayout(setTheme) + setContentView(layoutID) + ButterKnife.bind(this) + } + + protected fun setContentLayout(setTheme: Boolean = true) { if (setTheme) { setTheme(this) } setLanguage() coldLoad.set(true) - setContentView(layoutID) - ButterKnife.bind(this) } fun setLanguage() { diff --git a/mobile/src/main/java/com/windscribe/mobile/confirmemail/ConfirmEmailPresenterImp.kt b/mobile/src/main/java/com/windscribe/mobile/confirmemail/ConfirmEmailPresenterImp.kt index e2986fe05..a82d29522 100644 --- a/mobile/src/main/java/com/windscribe/mobile/confirmemail/ConfirmEmailPresenterImp.kt +++ b/mobile/src/main/java/com/windscribe/mobile/confirmemail/ConfirmEmailPresenterImp.kt @@ -20,7 +20,7 @@ class ConfirmEmailPresenterImp @Inject constructor( private var confirmEmailView: ConfirmEmailView, private var interactor: ActivityInteractor ) : ConfirmEmailPresenter { - private val mPresenterLog = LoggerFactory.getLogger("[confirm-email-i]") + private val mPresenterLog = LoggerFactory.getLogger("basic") override fun onDestroy() { if (interactor.getCompositeDisposable().isDisposed.not()) { interactor.getCompositeDisposable().dispose() diff --git a/mobile/src/main/java/com/windscribe/mobile/connectionsettings/ConnectionSettingsPresenterImpl.kt b/mobile/src/main/java/com/windscribe/mobile/connectionsettings/ConnectionSettingsPresenterImpl.kt index ec2d1fb28..f3c0cad4f 100644 --- a/mobile/src/main/java/com/windscribe/mobile/connectionsettings/ConnectionSettingsPresenterImpl.kt +++ b/mobile/src/main/java/com/windscribe/mobile/connectionsettings/ConnectionSettingsPresenterImpl.kt @@ -56,7 +56,7 @@ class ConnectionSettingsPresenterImpl @Inject constructor( private val permissionManager: PermissionManager, private val proxyDNSManager: ProxyDNSManager ) : ConnectionSettingsPresenter { - private val logger = LoggerFactory.getLogger("con_settings_p") + private val logger = LoggerFactory.getLogger("basic") private var currentPoint = 1500 override fun onStart() { //Set split tunnel text view @@ -282,7 +282,6 @@ class ConnectionSettingsPresenterImpl @Inject constructor( } override fun onPortSelected(heading: String, port: String) { - logger.info("Saving selected port...") interactor.loadPortMap(object : PortMapLoadCallback { override fun onFinished(portMapResponse: PortMapResponse) { when (getProtocolFromHeading(portMapResponse, heading)) { @@ -331,10 +330,7 @@ class ConnectionSettingsPresenterImpl @Inject constructor( override fun onFinished(portMapResponse: PortMapResponse) { val protocol = getProtocolFromHeading(portMapResponse, heading) val savedProtocol = interactor.getSavedProtocol() - if (savedProtocol == protocol) { - //Do nothing - logger.info("Protocol re-selected is same as saved. No action taken...") - } else { + if (savedProtocol != protocol) { logger.info("Saving selected protocol...") interactor.saveProtocol(protocol) setPortMapAdapter(heading) diff --git a/mobile/src/main/java/com/windscribe/mobile/custom_view/PlanUpgradeGradientButton.kt b/mobile/src/main/java/com/windscribe/mobile/custom_view/PlanUpgradeGradientButton.kt new file mode 100644 index 000000000..99bdae2cd --- /dev/null +++ b/mobile/src/main/java/com/windscribe/mobile/custom_view/PlanUpgradeGradientButton.kt @@ -0,0 +1,70 @@ +package com.windscribe.mobile.custom_view + +import android.content.Context +import android.graphics.Canvas +import android.graphics.Color +import android.graphics.LinearGradient +import android.graphics.Paint +import android.graphics.RectF +import android.graphics.Shader +import android.util.AttributeSet +import androidx.appcompat.widget.AppCompatButton + +class PlanUpgradeGradientButton @JvmOverloads constructor( + context: Context, attrs: AttributeSet? = null, defStyle: Int = 0 +) : AppCompatButton(context, attrs, defStyle) { + + private val gradientPaint = Paint(Paint.ANTI_ALIAS_FLAG) + private val gradientColors = intArrayOf( + Color.rgb(217, 211, 255), // #D9D3FF + Color.rgb(219, 204, 247), // #DBCCF7 + Color.rgb(242, 227, 240), // #F2E3F0 + Color.rgb(218, 214, 235), // #DAD6EB + Color.rgb(201, 227, 242), // #C9E3F2 + Color.rgb(195, 229, 237), // #C3E5ED + Color.rgb(189, 237, 237), // #BDEDED + Color.rgb(194, 232, 240), // #C2E8F0 + Color.rgb(202, 222, 242) // #CADEF2 + ) + + private var rect: RectF? = null + + private val gradientPositions = + floatArrayOf(0.05f, 0.17f, 0.38f, 0.45f, 0.51f, 0.56f, 0.59f, 0.67f, 0.76f) + + private var gradientShader: LinearGradient? = null + + init { + isAllCaps = false + } + + override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { + super.onSizeChanged(w, h, oldw, oldh) + gradientShader = LinearGradient( + width * 0.21f, -height * 2.86f, + width * 0.77f, height * 4.21f, + gradientColors, gradientPositions, + Shader.TileMode.CLAMP + ) + gradientPaint.shader = gradientShader + rect = RectF(0f, 0f, width.toFloat(), height.toFloat()) + } + + override fun onDraw(canvas: Canvas) { + rect?.let { + val cornerRadius = height / 2f + canvas.drawRoundRect(it, cornerRadius, cornerRadius, gradientPaint) + } + super.onDraw(canvas) + } + + override fun setPressed(pressed: Boolean) { + super.setPressed(pressed) + alpha = if (pressed) 0.8f else 1.0f + } + + override fun setEnabled(enabled: Boolean) { + super.setEnabled(enabled) + alpha = if (enabled) 1.0f else 0.5f + } +} \ No newline at end of file diff --git a/mobile/src/main/java/com/windscribe/mobile/custom_view/PlanUpgradeStarsBackgroundView.kt b/mobile/src/main/java/com/windscribe/mobile/custom_view/PlanUpgradeStarsBackgroundView.kt new file mode 100644 index 000000000..60ee18f7c --- /dev/null +++ b/mobile/src/main/java/com/windscribe/mobile/custom_view/PlanUpgradeStarsBackgroundView.kt @@ -0,0 +1,165 @@ +package com.windscribe.mobile.custom_view + +import android.content.Context +import android.graphics.BlurMaskFilter +import android.graphics.Canvas +import android.graphics.Color +import android.graphics.LinearGradient +import android.graphics.Paint +import android.graphics.RectF +import android.graphics.Shader +import android.util.AttributeSet +import androidx.core.content.ContextCompat +import com.windscribe.mobile.R +import com.windscribe.mobile.utils.UiUtil +import kotlin.math.cos +import kotlin.math.sin +import kotlin.random.Random + +class PlanUpgradeStarsBackgroundView @JvmOverloads constructor( + context: Context, attrs: AttributeSet? = null +) : androidx.appcompat.widget.AppCompatImageView(context, attrs) { + + private var glowRect: RectF? = null + private var starPadding = 0F + private val stars = mutableListOf() + private var innerRect: RectF? = null + private val cornerRadius = resources.getDimension(R.dimen.reg_12dp) + private val gradientTopColor = ContextCompat.getColor(context, R.color.colorPowderBlue14) + private val gradientBottomColor = ContextCompat.getColor(context, R.color.colorPowderBlue0) + private var gradient: LinearGradient? = null + var active = true + private val starPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply { + color = Color.WHITE + style = Paint.Style.FILL + } + private val glowPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply { + color = ContextCompat.getColor(context, R.color.colorPowderBlue) + strokeWidth = 3f + style = Paint.Style.STROKE + maskFilter = BlurMaskFilter(10f, BlurMaskFilter.Blur.NORMAL) + } + private val activeStrokePaint = Paint(Paint.ANTI_ALIAS_FLAG).apply { + color = ContextCompat.getColor(context, R.color.colorPaleBlue) + style = Paint.Style.STROKE + strokeWidth = resources.getDimensionPixelSize(R.dimen.reg_2dp).toFloat() + } + private val strokePaint = activeStrokePaint.apply { + strokeWidth = resources.getDimensionPixelSize(R.dimen.reg_1dp).toFloat() + color = ContextCompat.getColor(context, R.color.colorWhite50) + } + private val gradientPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply { + style = Paint.Style.FILL + } + + override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { + super.onSizeChanged(w, h, oldw, oldh) + createRect() + createGradient() + generateStars() + } + + private fun createRect() { + val left = paddingLeft.toFloat() + val top = paddingTop.toFloat() + val right = width - paddingRight.toFloat() + val bottom = height - paddingBottom.toFloat() + val strokeWidth = resources.getDimensionPixelSize(R.dimen.reg_2dp).toFloat() + glowRect = RectF(left, top, right, bottom) + innerRect = + RectF(left + strokeWidth, top + strokeWidth, right - strokeWidth, bottom - strokeWidth) + starPadding = paddingLeft.toFloat() + strokeWidth + } + + private fun createGradient() { + gradient = LinearGradient( + 0f, + 0f, + 0f, + height.toFloat(), + gradientTopColor, + gradientBottomColor, + Shader.TileMode.CLAMP + ) + gradientPaint.shader = gradient + } + + private fun generateStars() { + stars.clear() + val starCount = UiUtil.getStartCount(resources, width, height) + for (i in 0 until starCount) { + val angle = Random.nextFloat() * 360 // Random movement direction + val speed = Random.nextFloat() * 0.8f + 0.2f // Random speed + + val x = + starPadding + Random.nextFloat() * (width - 2 * starPadding) // Keep within width bounds + val y = + starPadding + Random.nextFloat() * (height - 2 * starPadding) // Keep within height bounds + + stars.add( + Star( + x = x, + y = y, + size = Random.nextFloat() * 1.2f, + alpha = Random.nextFloat() * 255, + dx = cos(Math.toRadians(angle.toDouble())).toFloat() * speed, + dy = sin(Math.toRadians(angle.toDouble())).toFloat() * speed + ) + ) + } + } + + override fun onDraw(canvas: Canvas) { + super.onDraw(canvas) + if (active) { + addGradient(canvas) + addStroke(canvas, activeStrokePaint) + addGlow(canvas) + updateStarts(canvas) + } else { + addStroke(canvas, strokePaint) + } + invalidate() + } + + private fun updateStarts(canvas: Canvas) { + for (star in stars) { + starPaint.alpha = star.alpha.toInt() + canvas.drawCircle(star.x, star.y, star.size, starPaint) + star.x += star.dx + star.y += star.dy + if (star.x <= starPadding || star.x >= width - starPadding) { + star.dx = -star.dx // Reverse X direction + star.x = star.x.coerceIn(starPadding, width - starPadding) // Keep inside bounds + } + if (star.y <= starPadding || star.y >= height - starPadding) { + star.dy = -star.dy // Reverse Y direction + star.y = star.y.coerceIn(starPadding, height - starPadding) // Keep inside bounds + } + star.alpha -= 0.5f + if (star.alpha <= 50) star.alpha = 255f + } + } + + private fun addGlow(canvas: Canvas) { + glowRect?.let { + canvas.drawRoundRect(it, cornerRadius, cornerRadius, glowPaint) + } + } + + private fun addStroke(canvas: Canvas, paint: Paint) { + innerRect?.let { + canvas.drawRoundRect(it, cornerRadius, cornerRadius, paint) + } + } + + private fun addGradient(canvas: Canvas) { + innerRect?.let { + canvas.drawRoundRect(it, cornerRadius, cornerRadius, gradientPaint) + } + } + + data class Star( + var x: Float, var y: Float, var size: Float, var alpha: Float, var dx: Float, var dy: Float + ) +} \ No newline at end of file diff --git a/mobile/src/main/java/com/windscribe/mobile/custom_view/StartsView.kt b/mobile/src/main/java/com/windscribe/mobile/custom_view/StartsView.kt new file mode 100644 index 000000000..1d86f3eac --- /dev/null +++ b/mobile/src/main/java/com/windscribe/mobile/custom_view/StartsView.kt @@ -0,0 +1,47 @@ +package com.windscribe.mobile.custom_view + +import android.content.Context +import android.graphics.Canvas +import android.graphics.Color +import android.graphics.Paint +import android.util.AttributeSet +import android.view.View +import com.windscribe.mobile.utils.UiUtil +import kotlin.random.Random + +class StarsView @JvmOverloads constructor( + context: Context, attrs: AttributeSet? = null +) : View(context, attrs) { + + private val starPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply { + color = Color.WHITE + style = Paint.Style.FILL + } + + private val stars = mutableListOf() + + override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { + super.onSizeChanged(w, h, oldw, oldh) + generateStars() + } + + private fun generateStars() { + stars.clear() + val starCount = UiUtil.getStartCount(resources, width, height) + repeat(starCount) { + val x = Random.nextFloat() * width + val y = Random.nextFloat() * height + val size = Random.nextFloat() * 1.2f + stars.add(Star(x, y, size)) + } + } + + override fun onDraw(canvas: Canvas) { + super.onDraw(canvas) + for (star in stars) { + canvas.drawCircle(star.x, star.y, star.size, starPaint) + } + } + + data class Star(val x: Float, val y: Float, val size: Float) +} \ No newline at end of file diff --git a/mobile/src/main/java/com/windscribe/mobile/custom_view/preferences/IconLinkView.kt b/mobile/src/main/java/com/windscribe/mobile/custom_view/preferences/IconLinkView.kt index 9e8063d65..e376ff482 100644 --- a/mobile/src/main/java/com/windscribe/mobile/custom_view/preferences/IconLinkView.kt +++ b/mobile/src/main/java/com/windscribe/mobile/custom_view/preferences/IconLinkView.kt @@ -4,11 +4,13 @@ import android.annotation.SuppressLint import android.content.Context import android.content.res.TypedArray import android.util.AttributeSet +import android.view.Gravity import android.view.View import android.widget.ImageView import android.widget.LinearLayout import android.widget.TextView import androidx.constraintlayout.widget.ConstraintLayout +import androidx.core.widget.TextViewCompat import com.windscribe.mobile.R import com.windscribe.mobile.utils.UiUtil @@ -32,7 +34,8 @@ class IconLinkView @JvmOverloads constructor( } init { - view.findViewById(R.id.title).text = + val titleTextView = view.findViewById(R.id.title) + titleTextView.text = attributes.getString(R.styleable.ItemLinkView_ItemLinkViewTitle) val leftIcon = attributes.getResourceId(R.styleable.ItemLinkView_ItemLinkViewLeftIcon, -1) if (leftIcon == -1) { @@ -45,11 +48,20 @@ class IconLinkView @JvmOverloads constructor( view.findViewById(R.id.right_icon).setImageResource(rightIcon) view.findViewById(R.id.right_icon).tag = rightIcon } - UiUtil.setupOnTouchListener( - container = view.findViewById(R.id.container), - textView = view.findViewById(R.id.title), - iconView = view.findViewById(R.id.right_icon) - ) + val isCommunityLink = attributes.getBoolean(R.styleable.ItemLinkView_CommunityLinkLabel, false) + if (isCommunityLink) { + titleTextView.apply { + TextViewCompat.setTextAppearance(this, R.style.CommunityLinkLabel) + gravity = Gravity.START or Gravity.CENTER_VERTICAL + } + } + if (!isCommunityLink) { + UiUtil.setupOnTouchListener( + container = view.findViewById(R.id.container), + textView = view.findViewById(R.id.title), + iconView = view.findViewById(R.id.right_icon) + ) + } } fun onClick(click: OnClickListener) { diff --git a/mobile/src/main/java/com/windscribe/mobile/dialogs/NodeStatusDialog.kt b/mobile/src/main/java/com/windscribe/mobile/dialogs/NodeStatusDialog.kt index ba4e6cc15..cf3245fa0 100644 --- a/mobile/src/main/java/com/windscribe/mobile/dialogs/NodeStatusDialog.kt +++ b/mobile/src/main/java/com/windscribe/mobile/dialogs/NodeStatusDialog.kt @@ -40,6 +40,9 @@ class NodeStatusDialog : FullScreenDialog() { binding?.nodeStatusSecondaryButton?.setOnClickListener { dismiss() } + if (arguments?.getBoolean(staticLocation, false) == true) { + binding?.nodeStatusPrimaryButton?.visibility = View.GONE + } } override fun onDestroyView() { @@ -49,13 +52,16 @@ class NodeStatusDialog : FullScreenDialog() { companion object { const val tag = "NodeStatusDialog" - fun show(activity: AppCompatActivity) { + const val staticLocation = "IsStaticLocation" + fun show(activity: AppCompatActivity, isStaticLocation: Boolean) { if (activity.supportFragmentManager.findFragmentByTag(tag) != null) { return } activity.runOnUiThread { kotlin.runCatching { - NodeStatusDialog().showNow(activity.supportFragmentManager, tag) + val dialog = NodeStatusDialog() + dialog.arguments = Bundle().apply { putBoolean(staticLocation, isStaticLocation) } + dialog.showNow(activity.supportFragmentManager, tag) } } } diff --git a/mobile/src/main/java/com/windscribe/mobile/dialogs/ProgressDialog.kt b/mobile/src/main/java/com/windscribe/mobile/dialogs/ProgressDialog.kt index 9901daf42..8ec262ede 100644 --- a/mobile/src/main/java/com/windscribe/mobile/dialogs/ProgressDialog.kt +++ b/mobile/src/main/java/com/windscribe/mobile/dialogs/ProgressDialog.kt @@ -9,6 +9,7 @@ import android.os.Looper import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.annotation.ColorInt import androidx.appcompat.app.AppCompatActivity import com.windscribe.mobile.databinding.FragmentProgressBinding @@ -33,6 +34,9 @@ class ProgressDialog : FullScreenDialog() { arguments?.getString(progressTextKey)?.let { binding?.progressLabel?.text = it } + arguments?.getInt(ProgressDialog.backgroundColorKey)?.let { + view.setBackgroundColor(it) + } } override fun onDestroyView() { @@ -48,10 +52,11 @@ class ProgressDialog : FullScreenDialog() { companion object { private const val progressTextKey = "progressTextKey" + private const val backgroundColorKey = "backgroundColor" const val tag = "ProgressDialog" @JvmStatic - fun show(activity: AppCompatActivity, progressText: String? = null) { + fun show(activity: AppCompatActivity, progressText: String? = null, @ColorInt backgroundColor: Int? = null) { if (activity.supportFragmentManager.findFragmentByTag(tag) != null) { return } @@ -60,6 +65,7 @@ class ProgressDialog : FullScreenDialog() { ProgressDialog().apply { Bundle().apply { putString(progressTextKey, progressText) + backgroundColor?.let { putInt(ProgressDialog.backgroundColorKey, it) } arguments = this } }.show(activity.supportFragmentManager, tag) diff --git a/mobile/src/main/java/com/windscribe/mobile/email/AddEmailActivity.kt b/mobile/src/main/java/com/windscribe/mobile/email/AddEmailActivity.kt index eb0211aff..55744dc4f 100644 --- a/mobile/src/main/java/com/windscribe/mobile/email/AddEmailActivity.kt +++ b/mobile/src/main/java/com/windscribe/mobile/email/AddEmailActivity.kt @@ -54,7 +54,7 @@ class AddEmailActivity : BaseActivity(), AddEmailView { @Inject lateinit var presenter: AddEmailPresenter - private val logger = LoggerFactory.getLogger("[add_email_a]") + private val logger = LoggerFactory.getLogger("basic") private var softInputAssist: SoftInputAssist? = null private val generalTextWatcher: TextWatcher = object : TextWatcher { diff --git a/mobile/src/main/java/com/windscribe/mobile/email/AddEmailPresenterImpl.kt b/mobile/src/main/java/com/windscribe/mobile/email/AddEmailPresenterImpl.kt index 936e0b406..a3e718b6a 100644 --- a/mobile/src/main/java/com/windscribe/mobile/email/AddEmailPresenterImpl.kt +++ b/mobile/src/main/java/com/windscribe/mobile/email/AddEmailPresenterImpl.kt @@ -24,11 +24,10 @@ class AddEmailPresenterImpl @Inject constructor( private val interactor: ActivityInteractor ) : AddEmailPresenter { - private val logger = LoggerFactory.getLogger("[add_email_p]") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { if (interactor.getCompositeDisposable().isDisposed.not()) { - logger.info("Disposing network observer...") interactor.getCompositeDisposable().dispose() } } diff --git a/mobile/src/main/java/com/windscribe/mobile/generalsettings/GeneralSettingsActivity.kt b/mobile/src/main/java/com/windscribe/mobile/generalsettings/GeneralSettingsActivity.kt index c70dac6b1..bb116ebee 100644 --- a/mobile/src/main/java/com/windscribe/mobile/generalsettings/GeneralSettingsActivity.kt +++ b/mobile/src/main/java/com/windscribe/mobile/generalsettings/GeneralSettingsActivity.kt @@ -34,7 +34,7 @@ import javax.inject.Inject class GeneralSettingsActivity : BaseActivity(), GeneralSettingsView { - private val logger = LoggerFactory.getLogger("gen_settings_a") + private val logger = LoggerFactory.getLogger("basic") @BindView(R.id.cl_app_background_settings) lateinit var appBackgroundDropDown: AppBackgroundView @@ -307,7 +307,6 @@ class GeneralSettingsActivity : BaseActivity(), GeneralSettingsView { selectedKey: String, keys: Array ) { - logger.info("Setting up language adapter...") languageDropDown.setAdapter(localiseValues, selectedKey, keys) } @@ -316,7 +315,6 @@ class GeneralSettingsActivity : BaseActivity(), GeneralSettingsView { selelctedKey: String, keys: Array ) { - logger.info("Setting up latency adapter...") latencyDropDown.setAdapter(localiseValues, selelctedKey, keys) } @@ -333,7 +331,6 @@ class GeneralSettingsActivity : BaseActivity(), GeneralSettingsView { selectedKey: String, keys: Array ) { - logger.info("Setting up selection adapter...") locationSelectionDropDown.setAdapter(localiseValues, selectedKey, keys) } @@ -342,7 +339,6 @@ class GeneralSettingsActivity : BaseActivity(), GeneralSettingsView { selectedKey: String, keys: Array ) { - logger.info("Setting up theme adapter..") themeDropDown.setAdapter(localiseValues, selectedKey, keys) } diff --git a/mobile/src/main/java/com/windscribe/mobile/generalsettings/GeneralSettingsPresenterImpl.kt b/mobile/src/main/java/com/windscribe/mobile/generalsettings/GeneralSettingsPresenterImpl.kt index 512c3668b..5e83883f2 100644 --- a/mobile/src/main/java/com/windscribe/mobile/generalsettings/GeneralSettingsPresenterImpl.kt +++ b/mobile/src/main/java/com/windscribe/mobile/generalsettings/GeneralSettingsPresenterImpl.kt @@ -22,7 +22,7 @@ class GeneralSettingsPresenterImpl @Inject constructor( private var settingsView: GeneralSettingsView, private var interactor: ActivityInteractor ) : GeneralSettingsPresenter { - private val logger = LoggerFactory.getLogger("gen_settings_p") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { if (interactor.getCompositeDisposable().isDisposed.not()) { diff --git a/mobile/src/main/java/com/windscribe/mobile/help/HelpPresenterImpl.kt b/mobile/src/main/java/com/windscribe/mobile/help/HelpPresenterImpl.kt index b6de26dcc..34628b704 100644 --- a/mobile/src/main/java/com/windscribe/mobile/help/HelpPresenterImpl.kt +++ b/mobile/src/main/java/com/windscribe/mobile/help/HelpPresenterImpl.kt @@ -27,7 +27,7 @@ class HelpPresenterImpl @Inject constructor( private val helpView: HelpView, private val interactor: ActivityInteractor ) : HelpPresenter { - private val logger = LoggerFactory.getLogger("help_p") + private val logger = LoggerFactory.getLogger("basic") override fun init() { helpView.setActivityTitle(interactor.getResourceString(R.string.help_me)) } diff --git a/mobile/src/main/java/com/windscribe/mobile/mainmenu/MainMenuActivity.kt b/mobile/src/main/java/com/windscribe/mobile/mainmenu/MainMenuActivity.kt index d5c572756..f6fa6c8b8 100644 --- a/mobile/src/main/java/com/windscribe/mobile/mainmenu/MainMenuActivity.kt +++ b/mobile/src/main/java/com/windscribe/mobile/mainmenu/MainMenuActivity.kt @@ -358,7 +358,7 @@ class MainMenuActivity : BaseActivity(), MainMenuView { } companion object { - private const val TAG = "main_menu_a" + private const val TAG = "basic" @JvmStatic fun getStartIntent(context: Context?): Intent { diff --git a/mobile/src/main/java/com/windscribe/mobile/networksecurity/NetworkSecurityActivity.kt b/mobile/src/main/java/com/windscribe/mobile/networksecurity/NetworkSecurityActivity.kt index c6981d1ce..356e09549 100644 --- a/mobile/src/main/java/com/windscribe/mobile/networksecurity/NetworkSecurityActivity.kt +++ b/mobile/src/main/java/com/windscribe/mobile/networksecurity/NetworkSecurityActivity.kt @@ -61,7 +61,7 @@ class NetworkSecurityActivity : BaseActivity(), NetworkSecurityView, NetworkAdap @Inject lateinit var presenter: NetworkSecurityPresenter - private val logger = LoggerFactory.getLogger("net_security_a") + private val logger = LoggerFactory.getLogger("basic") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -99,7 +99,6 @@ class NetworkSecurityActivity : BaseActivity(), NetworkSecurityView, NetworkAdap } override fun hideProgress() { - logger.info("Dismissing progress dialog...") customProgress.dismiss() } @@ -154,7 +153,6 @@ class NetworkSecurityActivity : BaseActivity(), NetworkSecurityView, NetworkAdap } override fun showProgress(progressTitle: String) { - logger.info("Showing loading dialog...") customProgress.show() (customProgress.findViewById(R.id.tv_dialog_header) as TextView).text = progressTitle diff --git a/mobile/src/main/java/com/windscribe/mobile/networksecurity/NetworkSecurityPresenterImpl.kt b/mobile/src/main/java/com/windscribe/mobile/networksecurity/NetworkSecurityPresenterImpl.kt index 7f58388e6..dbd289397 100644 --- a/mobile/src/main/java/com/windscribe/mobile/networksecurity/NetworkSecurityPresenterImpl.kt +++ b/mobile/src/main/java/com/windscribe/mobile/networksecurity/NetworkSecurityPresenterImpl.kt @@ -20,7 +20,7 @@ class NetworkSecurityPresenterImpl @Inject constructor( private val networkSecurityView: NetworkSecurityView, private val interactor: ActivityInteractor ) : NetworkSecurityPresenter, NetworkInfoListener { - private val logger = LoggerFactory.getLogger("net_security_p") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { interactor.getNetworkInfoManager().removeNetworkInfoListener(this) //Dispose any observer diff --git a/mobile/src/main/java/com/windscribe/mobile/networksecurity/networkdetails/NetworkDetailPresenterImp.kt b/mobile/src/main/java/com/windscribe/mobile/networksecurity/networkdetails/NetworkDetailPresenterImp.kt index 558799bba..3c3794336 100644 --- a/mobile/src/main/java/com/windscribe/mobile/networksecurity/networkdetails/NetworkDetailPresenterImp.kt +++ b/mobile/src/main/java/com/windscribe/mobile/networksecurity/networkdetails/NetworkDetailPresenterImp.kt @@ -26,7 +26,7 @@ class NetworkDetailPresenterImp @Inject constructor( private val interactor: ActivityInteractor ) : NetworkDetailPresenter { - private val logger = LoggerFactory.getLogger("network_detail_p") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { if (!interactor.getCompositeDisposable().isDisposed) { diff --git a/mobile/src/main/java/com/windscribe/mobile/newsfeedactivity/NewsFeedActivity.kt b/mobile/src/main/java/com/windscribe/mobile/newsfeedactivity/NewsFeedActivity.kt index 908c7af80..585b96c55 100644 --- a/mobile/src/main/java/com/windscribe/mobile/newsfeedactivity/NewsFeedActivity.kt +++ b/mobile/src/main/java/com/windscribe/mobile/newsfeedactivity/NewsFeedActivity.kt @@ -38,7 +38,7 @@ class NewsFeedActivity : BaseActivity(), NewsFeedView { @BindView(R.id.tv_error) lateinit var tvError: TextView - val logger: Logger = LoggerFactory.getLogger("news_feed_a") + val logger: Logger = LoggerFactory.getLogger("basic") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -64,7 +64,6 @@ class NewsFeedActivity : BaseActivity(), NewsFeedView { @OnClick(R.id.img_news_feed_close_btn) fun onCloseButtonClicked() { - logger.info("User clicked on close button.") onBackPressed() } diff --git a/mobile/src/main/java/com/windscribe/mobile/newsfeedactivity/NewsFeedPresenterImpl.kt b/mobile/src/main/java/com/windscribe/mobile/newsfeedactivity/NewsFeedPresenterImpl.kt index 1f0604fc0..ff6dfba9c 100644 --- a/mobile/src/main/java/com/windscribe/mobile/newsfeedactivity/NewsFeedPresenterImpl.kt +++ b/mobile/src/main/java/com/windscribe/mobile/newsfeedactivity/NewsFeedPresenterImpl.kt @@ -18,7 +18,7 @@ class NewsFeedPresenterImpl @Inject constructor( private val interactor: ActivityInteractor ) : NewsFeedPresenter, NewsFeedListener { private var adapter: NewsFeedAdapter? = null - private val logger = LoggerFactory.getLogger("news_feed_p") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { interactor.getCompositeDisposable() if (!interactor.getCompositeDisposable().isDisposed) { @@ -81,7 +81,6 @@ class NewsFeedPresenterImpl @Inject constructor( wn.isRead = read } if (showPopUp) { - logger.debug("Showing pop up message with Id: $popUpId") firstItemToOpen = popUpId } else if (firstItemToOpen != -1) { logger.debug("Showing unread message with Id: $firstItemToOpen") diff --git a/mobile/src/main/java/com/windscribe/mobile/robert/RobertSettingsPresenterImpl.kt b/mobile/src/main/java/com/windscribe/mobile/robert/RobertSettingsPresenterImpl.kt index 059f140d7..3f74c6437 100644 --- a/mobile/src/main/java/com/windscribe/mobile/robert/RobertSettingsPresenterImpl.kt +++ b/mobile/src/main/java/com/windscribe/mobile/robert/RobertSettingsPresenterImpl.kt @@ -29,7 +29,7 @@ class RobertSettingsPresenterImpl( private val robertSettingsView: RobertSettingsView, private val interactor: ActivityInteractor ) : RobertSettingsPresenter, RobertAdapterListener { - private val mPresenterLog = LoggerFactory.getLogger("robert_p") + private val mPresenterLog = LoggerFactory.getLogger("basic") private var robertSettingsAdapter: RobertSettingsAdapter? = null override fun onDestroy() { interactor.getCompositeDisposable().clear() diff --git a/mobile/src/main/java/com/windscribe/mobile/splash/SplashActivity.kt b/mobile/src/main/java/com/windscribe/mobile/splash/SplashActivity.kt index f7bb47e8e..b7b43ae25 100644 --- a/mobile/src/main/java/com/windscribe/mobile/splash/SplashActivity.kt +++ b/mobile/src/main/java/com/windscribe/mobile/splash/SplashActivity.kt @@ -24,7 +24,7 @@ class SplashActivity : BaseActivity(), SplashView { @Inject lateinit var presenter: SplashPresenter - private val logger = LoggerFactory.getLogger("splash_a") + private val logger = LoggerFactory.getLogger("basic") override fun onCreate(savedInstanceState: Bundle?) { val splashScreen = installSplashScreen() super.onCreate(savedInstanceState) diff --git a/mobile/src/main/java/com/windscribe/mobile/splash/SplashPresenterImpl.kt b/mobile/src/main/java/com/windscribe/mobile/splash/SplashPresenterImpl.kt index af26ee7ad..54ead87df 100644 --- a/mobile/src/main/java/com/windscribe/mobile/splash/SplashPresenterImpl.kt +++ b/mobile/src/main/java/com/windscribe/mobile/splash/SplashPresenterImpl.kt @@ -25,7 +25,7 @@ class SplashPresenterImpl @Inject constructor( private var interactor: ActivityInteractor ) : SplashPresenter { - private val logger = LoggerFactory.getLogger("splash_p") + private val logger = LoggerFactory.getLogger("basic") /* Stop Session service if running * Check purchase token if available @@ -41,10 +41,8 @@ class SplashPresenterImpl @Inject constructor( * */ override fun onDestroy() { if (!interactor.getCompositeDisposable().isDisposed) { - logger.info("Disposing network observer...") interactor.getCompositeDisposable().dispose() } - logger.info("Setting view and interactor to null...") } fun checkApplicationInstanceAndDecideActivity() { @@ -54,7 +52,6 @@ class SplashPresenterImpl @Inject constructor( .getResponseString(PreferencesKeyConstants.NEW_INSTALLATION) if (PreferencesKeyConstants.I_NEW == installation) { //Record new install - logger.info("Recording new installation of the app") interactor.getAppPreferenceInterface() .saveResponseStringData( PreferencesKeyConstants.NEW_INSTALLATION, @@ -142,7 +139,6 @@ class SplashPresenterImpl @Inject constructor( } fun decideActivity() { - logger.info("Checking if user already logged in...") val sessionHash = interactor.getAppPreferenceInterface().sessionHash if (sessionHash != null) { if (interactor.getAppPreferenceInterface().loginTime == null){ @@ -158,8 +154,6 @@ class SplashPresenterImpl @Inject constructor( view.navigateToHome() } } else { - //Goto Login/Registration Activity - logger.info("Session auth hash not present. User not logged in...") view.navigateToLogin() } } diff --git a/mobile/src/main/java/com/windscribe/mobile/splittunneling/SplitTunnelingActivity.kt b/mobile/src/main/java/com/windscribe/mobile/splittunneling/SplitTunnelingActivity.kt index 2ef9e3f6a..7ce42af4b 100644 --- a/mobile/src/main/java/com/windscribe/mobile/splittunneling/SplitTunnelingActivity.kt +++ b/mobile/src/main/java/com/windscribe/mobile/splittunneling/SplitTunnelingActivity.kt @@ -72,7 +72,7 @@ class SplitTunnelingActivity : BaseActivity(), SplitTunnelingView { private var mTransition: AutoTransition? = null private val constraintSetTunnel = ConstraintSet() - private val mSplitViewLog = LoggerFactory.getLogger("split_settings_a") + private val mSplitViewLog = LoggerFactory.getLogger("basic") private val setView = AtomicBoolean() override fun onCreate(savedInstanceState: Bundle?) { @@ -131,8 +131,6 @@ class SplitTunnelingActivity : BaseActivity(), SplitTunnelingView { } override fun onTransitionEnd(transition: Transition) { - mSplitViewLog.info("Show split tunnel mode transition finished...") - //ConnSettingsPresenter.onManualLayoutSetupCompleted(); transition.removeListener(this) } @@ -220,8 +218,6 @@ class SplitTunnelingActivity : BaseActivity(), SplitTunnelingView { } override fun onTransitionEnd(transition: Transition) { - mSplitViewLog.info("Show split tunnel mode transition finished...") - //ConnSettingsPresenter.onManualLayoutSetupCompleted(); transition.removeListener(this) } diff --git a/mobile/src/main/java/com/windscribe/mobile/splittunneling/SplitTunnelingPresenterImpl.kt b/mobile/src/main/java/com/windscribe/mobile/splittunneling/SplitTunnelingPresenterImpl.kt index 3374a8917..b52d61451 100644 --- a/mobile/src/main/java/com/windscribe/mobile/splittunneling/SplitTunnelingPresenterImpl.kt +++ b/mobile/src/main/java/com/windscribe/mobile/splittunneling/SplitTunnelingPresenterImpl.kt @@ -29,7 +29,7 @@ class SplitTunnelingPresenterImpl @Inject constructor( ) : SplitTunnelingPresenter, InstalledAppsAdapter.InstalledAppListener { var installedAppsAdapter: InstalledAppsAdapter? = null private val mInstalledAppList: MutableList = ArrayList() - private val logger = LoggerFactory.getLogger("split_settings_p") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { //Dispose any composite disposable if (!interactor.getCompositeDisposable().isDisposed) { @@ -110,12 +110,10 @@ class SplitTunnelingPresenterImpl @Inject constructor( override fun onToggleButtonClicked() { interactor.getAppPreferenceInterface().setReconnectRequired(true) if (interactor.getAppPreferenceInterface().splitTunnelToggle) { - logger.info("Previous Split Tunnel Toggle Settings: True") interactor.getAppPreferenceInterface().splitTunnelToggle = false splitTunnelView.setupToggleImage(R.drawable.ic_toggle_button_off) splitTunnelView.hideTunnelSettingsLayout() } else { - logger.info("Previous Split Tunnel Toggle Settings: False") interactor.getAppPreferenceInterface().splitTunnelToggle = true splitTunnelView.setupToggleImage(R.drawable.ic_toggle_button_on) splitTunnelView.showTunnelSettingsLayout() diff --git a/mobile/src/main/java/com/windscribe/mobile/utils/UiUtil.kt b/mobile/src/main/java/com/windscribe/mobile/utils/UiUtil.kt index e5f607070..d2e691ea1 100644 --- a/mobile/src/main/java/com/windscribe/mobile/utils/UiUtil.kt +++ b/mobile/src/main/java/com/windscribe/mobile/utils/UiUtil.kt @@ -4,28 +4,22 @@ package com.windscribe.mobile.utils -import android.Manifest import android.annotation.SuppressLint import android.content.Context -import android.content.pm.PackageManager import android.content.res.Resources -import android.os.Build import android.view.ContextThemeWrapper import android.view.MotionEvent import android.view.View import android.widget.ImageView import android.widget.TextView -import androidx.appcompat.app.AppCompatActivity import androidx.constraintlayout.widget.ConstraintLayout -import androidx.core.content.ContextCompat import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat import com.windscribe.mobile.R -import com.windscribe.mobile.base.BaseActivity.Companion.REQUEST_BACKGROUND_PERMISSION import com.windscribe.vpn.Windscribe.Companion.appContext -import com.windscribe.vpn.alert.showAlertDialog import com.windscribe.vpn.commonutils.ThemeUtils import com.windscribe.vpn.constants.BillingConstants import com.windscribe.vpn.constants.UserStatusConstants +import java.util.regex.Pattern object UiUtil { @@ -35,40 +29,41 @@ object UiUtil { maxData / UserStatusConstants.GB_DATA.toFloat() ) -> appContext.resources.getColor(R.color.colorRed) + dataRemaining < BillingConstants.DATA_WARNING_PERCENTAGE * (maxData / UserStatusConstants.GB_DATA.toFloat()) -> appContext.resources.getColor(R.color.colorYellow) + else -> appContext.resources.getColor(R.color.colorWhite) } else appContext.resources.getColor(R.color.colorWhite) } - fun isBackgroundLocationPermissionGranted(context: Context): Boolean { - return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - (ContextCompat - .checkSelfPermission(context, Manifest.permission.ACCESS_BACKGROUND_LOCATION) - == PackageManager.PERMISSION_GRANTED) - } else { - true + fun getPriceWithCurrency(price: String?): Pair? { + if (price == null){ + return null } - } + val rawPrice = price.replace("\u00A0", " ").trim() + val pattern = Pattern.compile("([A-Za-z]{3}|[^\\d,\\.]+)?\\s?([\\d,.]+)") + val matcher = pattern.matcher(rawPrice) - fun showBackgroundLocationPermissionAlert(context: AppCompatActivity) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - showAlertDialog(context.getString(R.string.app_requires_background_location_permission)) { - context.requestPermissions( - arrayOf(Manifest.permission.ACCESS_BACKGROUND_LOCATION), - REQUEST_BACKGROUND_PERMISSION - ) + return if (matcher.find()) { + val currency = matcher.group(1)?.trim().orEmpty() + val priceString = matcher.group(2)?.replace(",", "") + priceString?.toDoubleOrNull()?.let { priceValue -> + Pair(currency, priceValue) } + } else { + null } } - fun locationPermissionAvailable(): Boolean { - return (ContextCompat - .checkSelfPermission(appContext, Manifest.permission.ACCESS_FINE_LOCATION) - == PackageManager.PERMISSION_GRANTED - ) && isBackgroundLocationPermissionGranted(appContext) + fun getStartCount(resources: Resources, width: Int, height: Int): Int { + val density = resources.displayMetrics.density + val referenceWidthPx = 163f * density + val referenceHeightPx = 182f * density + val starDensity = 60 / (referenceWidthPx * referenceHeightPx) + return (starDensity * width * height).toInt() } @SuppressLint("ClickableViewAccessibility") diff --git a/mobile/src/main/java/com/windscribe/mobile/welcome/WelcomePresenterImpl.kt b/mobile/src/main/java/com/windscribe/mobile/welcome/WelcomePresenterImpl.kt index 2a8d38b43..2e4e315ad 100644 --- a/mobile/src/main/java/com/windscribe/mobile/welcome/WelcomePresenterImpl.kt +++ b/mobile/src/main/java/com/windscribe/mobile/welcome/WelcomePresenterImpl.kt @@ -37,7 +37,7 @@ class WelcomePresenterImpl @Inject constructor( private val welcomeView: WelcomeView, private val interactor: ActivityInteractor ) : WelcomePresenter { - private val logger = LoggerFactory.getLogger("login-p") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { interactor.getCompositeDisposable().clear() diff --git a/mobile/src/main/java/com/windscribe/mobile/welcome/viewmodal/EmergencyConnectViewModal.kt b/mobile/src/main/java/com/windscribe/mobile/welcome/viewmodal/EmergencyConnectViewModal.kt index fe01b5977..44bbbba28 100644 --- a/mobile/src/main/java/com/windscribe/mobile/welcome/viewmodal/EmergencyConnectViewModal.kt +++ b/mobile/src/main/java/com/windscribe/mobile/welcome/viewmodal/EmergencyConnectViewModal.kt @@ -18,7 +18,7 @@ class EmergencyConnectViewModal( private val windVpnController: WindVpnController, private val vpnConnectionStateManager: VPNConnectionStateManager ) : ViewModel() { - private val logger = LoggerFactory.getLogger("e_connect_v") + private val logger = LoggerFactory.getLogger("emergency_connect") private var _uiState = MutableStateFlow(EmergencyConnectUIState.Disconnected) val uiState: StateFlow = _uiState private var _connectionProgressText = MutableStateFlow("Resolving e-connect domain..") @@ -26,14 +26,12 @@ class EmergencyConnectViewModal( private var connectingJob: Job? = null init { - logger.debug("Initializing Emergency connect view modal.") observeConnectionState() } private fun observeConnectionState() { viewModelScope.launch { vpnConnectionStateManager.state.collectLatest { - logger.debug("Connection state changed to ${it.status}") when (it.status) { Connecting -> _uiState.emit(EmergencyConnectUIState.Connecting) Connected -> _uiState.emit(EmergencyConnectUIState.Connected) @@ -70,7 +68,7 @@ class EmergencyConnectViewModal( }.onSuccess { logger.debug("Successfully connected to emergency server.") }.onFailure { - logger.debug("Failure to connect using emergency vpn profiles: $it") + logger.error("Failure to connect using emergency vpn profiles: $it") _uiState.emit(EmergencyConnectUIState.Disconnected) } } diff --git a/mobile/src/main/java/com/windscribe/mobile/windscribe/WindscribeActivity.kt b/mobile/src/main/java/com/windscribe/mobile/windscribe/WindscribeActivity.kt index 121f675f2..4d2ca69bb 100644 --- a/mobile/src/main/java/com/windscribe/mobile/windscribe/WindscribeActivity.kt +++ b/mobile/src/main/java/com/windscribe/mobile/windscribe/WindscribeActivity.kt @@ -83,6 +83,7 @@ import com.windscribe.vpn.state.DeviceStateManager import com.windscribe.vpn.state.DeviceStateManager.DeviceStateListener import com.windscribe.vpn.state.PreferenceChangeObserver import org.slf4j.LoggerFactory +import org.slf4j.Marker import javax.inject.Inject import javax.inject.Named @@ -361,7 +362,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, private var lastFlag = 0 - private val logger = LoggerFactory.getLogger("windscribe_a") + private val logger = LoggerFactory.getLogger("basic") override var uiConnectionState: ConnectionUiState? = null private set @@ -375,6 +376,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + logger.info("Loading home screen.") setActivityModule(ActivityModule(this, this)).inject(this) setContentLayout(R.layout.activity_windscribe, true) window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN) @@ -398,6 +400,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, presenter.registerNetworkInfoListener() presenter.handlePushNotification(intent.extras) presenter.observeUserData(this) + logger.info("Home screen loaded.") } override fun onStart() { @@ -405,7 +408,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, if (presenter.userHasAccess()) { presenter.onStart() if (intent != null && intent.action != null && (intent.action == NotificationConstants.DISCONNECT_VPN_INTENT)) { - logger.info("Disconnect intent received...") + logger.info("App launched from disconnect vpn intent.") presenter.onDisconnectIntentReceived() } deviceStateManager.addListener(this) @@ -416,6 +419,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { if (requestCode == FILE_PICK_REQUEST && resultCode == RESULT_OK && data != null) { + logger.debug("Picked custom config file.") presenter.loadConfigFile(data) } super.onActivityResult(requestCode, resultCode, data) @@ -423,6 +427,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, override fun onRestoreInstanceState(savedInstanceState: Bundle) { super.onRestoreInstanceState(savedInstanceState) + logger.debug("Home screen: onRestoreInstanceState.") setServerListView(true) } @@ -438,11 +443,12 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, override fun onStop() { super.onStop() - logger.info("Activity on stop method,un-registering network and vpn status listener") + logger.info("Home screen: onStop un-registering network and vpn status listener.") deviceStateManager.removeListener(this) } override fun onDestroy() { + logger.info("Home screen: onDestroy releasing resources.") locationFragmentViewPager?.currentItem?.let { presenter.saveLastSelectedTabIndex(it) } @@ -459,13 +465,14 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, } override fun checkNodeStatus() { - logger.info("User clicked on check node status button...") + logger.debug("User clicked on check node status button.") presenter.onCheckNodeStatusClick() } override fun exitSearchLayout() { val fragment = supportFragmentManager.findFragmentById(R.id.cl_windscribe_main) if (fragment is SearchFragment) { + logger.debug("Closing search layout.") fragment.setSearchView(false) } } @@ -480,6 +487,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, get() = flagDimensionsGuideView?.measuredWidth ?: 0 override fun gotoLoginRegistrationActivity() { + logger.debug("Moving to welcome screen.") val intent = WelcomeActivity.getStartIntent(this) intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_NO_HISTORY or Intent.FLAG_ACTIVITY_CLEAR_TASK @@ -488,10 +496,6 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, finish() } - override fun handleRateView() { - RateAppDialog.show(this) - } - override fun hideProgressView() { runOnUiThread { if (customDialog.isShowing) { @@ -509,6 +513,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, } override fun onAddConfigClick() { + logger.debug("User clicked on Add custom config.") presenter.onAddConfigLocation() } @@ -519,7 +524,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, @OnClick(R.id.auto_secure_toggle) fun onAutoSecureToggleClick() { - logger.info("User clicked on auto secure toggle") + logger.debug("User clicked on auto secure toggle") presenter.onAutoSecureToggleClick() } @@ -533,7 +538,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, @OnClick(R.id.collapse_expand_icon) fun onCollapseExpandClick() { - logger.info("User clicked on collapse/expand icon") + logger.debug("User clicked on collapse/expand icon") presenter.onCollapseExpandIconClick() } @@ -543,7 +548,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, @OnClick(R.id.on_off_button) fun onConnectButtonClick() { - logger.info("User clicked on connect button...") + logger.debug("User clicked on connect button.") presenter.onConnectClicked() onOffButton?.isEnabled = false // Disable connect button to avoid mismatched state between animations. @@ -589,7 +594,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, @OnClick(R.id.text_view_notification, R.id.img_windscribe_logo) fun onNotificationClick() { - logger.info("User clicked news feed icon...") + logger.debug("User clicked news feed icon.") presenter.onNewsFeedItemClick() } @@ -640,7 +645,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, @OnClick(R.id.preferred_protocol_toggle) fun onPreferredProtocolToggleClick() { - logger.info("User clicked on preferred protocol toggle") + logger.debug("User clicked on preferred protocol toggle") presenter.onPreferredProtocolToggleClick() } @@ -696,7 +701,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, @OnClick(R.id.img_server_list_all) fun onShowAllServerClick() { - logger.info("User clicked show all servers...") + logger.debug("User clicked show all servers...") if (locationFragmentViewPager?.currentItem != 0) { logger.debug("Setting pager item to 0: Server List Fragment") locationFragmentViewPager?.currentItem = 0 @@ -706,7 +711,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, @OnClick(R.id.img_config_loc_list) fun onShowConfigLocList() { - logger.info("User clicked show config loc list...") + logger.debug("User clicked show config loc list...") if (locationFragmentViewPager?.currentItem != 4) { // Change fragment to config list fragment logger.debug("Setting pager item to 4: Config Loc Fragment") @@ -717,7 +722,6 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, @OnClick(R.id.img_server_list_favorites) fun onShowFavoritesClicked() { - logger.debug("User clicked show favorites...") if (locationFragmentViewPager?.currentItem != 1) { // Change fragment to all server list fragment logger.debug("Setting pager item to 1: Favourites list fragment") @@ -728,7 +732,6 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, @OnClick(R.id.img_server_list_flix) fun onShowFlixListClick() { - logger.debug("User clicked show flix locations...") if (locationFragmentViewPager?.currentItem != 2) { // Change fragment to all server list fragment logger.debug("Setting pager item to 2: Flix List Fragment") @@ -739,7 +742,6 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, @OnClick(R.id.img_static_ip_list) fun onShowStaticIpList() { - logger.debug("User clicked show static ips...") if (locationFragmentViewPager?.currentItem != 3) { logger.debug("Setting pager item to 3: Static IP Fragment") locationFragmentViewPager?.currentItem = 3 @@ -748,7 +750,6 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, } override fun onStaticIpClick() { - logger.debug("User clicked on add static ip button...") presenter.onAddStaticIPClicked() } @@ -1202,8 +1203,8 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, } } - override fun setUpLayoutForNodeUnderMaintenance() { - NodeStatusDialog.show(this) + override fun setUpLayoutForNodeUnderMaintenance(isStaticLocation: Boolean) { + NodeStatusDialog.show(this, isStaticLocation) } override fun setupAccountStatusBanned() { @@ -1415,7 +1416,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, supportFragmentManager.beginTransaction() .replace(R.id.cl_windscribe_main, searchFragment).addToBackStack(null).commit() } catch (e: IllegalStateException) { - logger.info("Illegal state to add search layout.") + logger.error("Illegal state to add search layout.") } } @@ -1445,7 +1446,6 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, } override fun showListBarSelectTransition(resourceSelected: Int) { - logger.info("In server list menu selection transition...") runOnUiThread { constraintSetServerList.connect( R.id.img_server_list_selection_mask, @@ -1863,7 +1863,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, override fun onGlobalLayout() { it.viewTreeObserver.removeOnGlobalLayoutListener(this) if (!reload) { - logger.info("Activity layout drawing completed.") + logger.debug("Activity layout drawing completed.") presenter.init() } //Set adapters if they were created before view was ready. @@ -1955,7 +1955,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, OnPageChangeListener, override fun askForPowerWhiteListPermission() { val intent = Intent( Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, - Uri.parse("package:" + packageName) + Uri.parse("package:$packageName") ) addToPowerWhitelist.launch(intent) } diff --git a/mobile/src/main/java/com/windscribe/mobile/windscribe/WindscribePresenterImpl.kt b/mobile/src/main/java/com/windscribe/mobile/windscribe/WindscribePresenterImpl.kt index 9698d12f4..a42e7bdfc 100644 --- a/mobile/src/main/java/com/windscribe/mobile/windscribe/WindscribePresenterImpl.kt +++ b/mobile/src/main/java/com/windscribe/mobile/windscribe/WindscribePresenterImpl.kt @@ -130,20 +130,16 @@ class WindscribePresenterImpl @Inject constructor( private val flagIcons: Map = FlagIconResource.flagIcons private var networkInformation: NetworkInfo? = null private val onUserDataUpdate = AtomicBoolean() - private val logger = LoggerFactory.getLogger("windscribe_p") + private val logger = LoggerFactory.getLogger("basic") private var connectingFromServerList = false override fun onStart() {} override fun onDestroy() { interactor.getNetworkInfoManager().removeNetworkInfoListener(this) - logger.debug("Home activity on destroy. cleaning up") if (!interactor.getCompositeDisposable().isDisposed) { - logger.info("Disposing observer...") interactor.getCompositeDisposable().dispose() } - - // Set all objects to null streamingNodeAdapter = null favouriteAdapter = null staticRegionAdapter = null @@ -206,7 +202,7 @@ class WindscribePresenterImpl @Inject constructor( .subscribeWith(object : DisposableCompletableObserver() { override fun onComplete() { interactor.getPreferenceChangeObserver().postConfigListChange() - logger.error("Config deleted successfully") + logger.debug("Config deleted successfully") windscribeView.showToast("Config deleted successfully") } @@ -291,7 +287,6 @@ class WindscribePresenterImpl @Inject constructor( get() = interactor.getAppPreferenceInterface().isHapticFeedbackEnabled override fun loadConfigLocations() { - logger.debug("Loading config locations.") val serverListData = ServerListData() interactor.getCompositeDisposable().add( interactor.getAllPings().flatMap { pingTestResults: List -> @@ -324,7 +319,6 @@ class WindscribePresenterImpl @Inject constructor( } else if (selection == AZ_LIST_SELECTION_MODE) { Collections.sort(configFiles, ByConfigName()) } - logger.debug("Setting config location adapter") serverListData.setShowLatencyInMs(interactor.getAppPreferenceInterface().showLatencyInMS) serverListData.setShowLocationHealth( interactor.getAppPreferenceInterface().isShowLocationHealthEnabled @@ -342,7 +336,6 @@ class WindscribePresenterImpl @Inject constructor( ) } else { windscribeView.setConfigLocListAdapter(null) - logger.debug("No Configured Location found") configAdapter = null windscribeView.showConfigLocAdapterLoadError( interactor.getResourceString(R.string.no_custom_configs), 0 @@ -386,17 +379,14 @@ class WindscribePresenterImpl @Inject constructor( } private fun loadServerList(regions: MutableList, serverListHash: String?) { - logger.info("Loading server list from disk.") windscribeView.showRecyclerViewProgressBar() val serverListData = ServerListData() val oneTimeCompositeDisposable = CompositeDisposable() oneTimeCompositeDisposable.add( interactor.getAllPings().onErrorReturnItem(ArrayList()).flatMap { serverListData.pingTimes = it - logger.info("Loaded Latency data.") interactor.getFavourites() }.onErrorReturnItem(ArrayList()).flatMap { - logger.info("Loaded favourites data.") serverListData.favourites = it interactor.getLocationProvider().bestLocation }.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) @@ -405,7 +395,6 @@ class WindscribePresenterImpl @Inject constructor( windscribeView.hideRecyclerViewProgressBar() val error = if (e is WindScribeException) e.message else "Unknown error loading while loading server list." - logger.debug(error) windscribeView.showReloadError(error!!) if (!oneTimeCompositeDisposable.isDisposed) { oneTimeCompositeDisposable.dispose() @@ -413,7 +402,6 @@ class WindscribePresenterImpl @Inject constructor( } override fun onSuccess(cityAndRegion: CityAndRegion) { - logger.debug("Successfully loaded server list.") if (selectedLocation == null) { val coordinatesArray = cityAndRegion.city.coordinates.split(",".toRegex()).toTypedArray() @@ -455,7 +443,6 @@ class WindscribePresenterImpl @Inject constructor( @SuppressLint("NotifyDataSetChanged") fun loadStaticServers(regions: MutableList) { - logger.debug("Loading static servers.") interactor.getCompositeDisposable() .add( interactor.getAllPings().onErrorReturnItem(ArrayList()).flatMap { @@ -599,7 +586,6 @@ class WindscribePresenterImpl @Inject constructor( return@collectLatest } lastVPNState = vpnState.status - logger.info(String.format("New Connection State: %s", lastVPNState.name)) when (vpnState.status) { VPNState.Status.Connected -> { windscribeView.setRefreshLayout(false) @@ -676,7 +662,11 @@ class WindscribePresenterImpl @Inject constructor( } override fun onConnectClicked() { - logger.debug("Connection UI State: ${windscribeView.uiConnectionState?.javaClass?.simpleName} Last connection State: $lastVPNState") + logger.debug( + "Connection UI State: {} Last connection State: {}", + windscribeView.uiConnectionState?.javaClass?.simpleName, + lastVPNState + ) interactor.getAutoConnectionManager().stop() when (windscribeView.uiConnectionState) { is ConnectingState -> { @@ -796,12 +786,11 @@ class WindscribePresenterImpl @Inject constructor( if (windscribeView.networkLayoutState != NetworkLayoutState.CLOSED) { windscribeView.setNetworkLayout(networkInformation, NetworkLayoutState.CLOSED, true) } - logger.info("Opening main menu activity...") + logger.debug("Opening main menu activity...") windscribeView.openMenuActivity() } override fun onNetworkInfoUpdate(networkInfo: NetworkInfo?, userReload: Boolean) { - logger.debug("Network Info updated.") networkInformation = networkInfo if (networkInformation != null && userReload) { if (networkInformation?.isAutoSecureOn != true) { @@ -877,7 +866,7 @@ class WindscribePresenterImpl @Inject constructor( } override fun onNewsFeedItemClick() { - logger.info("Opening news feed activity...") + logger.debug("Opening news feed activity...") windscribeView.openNewsFeedActivity(false, -1) } @@ -1017,7 +1006,7 @@ class WindscribePresenterImpl @Inject constructor( override fun onError(e: Throwable) { windscribeView.hideRecyclerViewProgressBar() - logger.debug("Server list update failed.$e") + logger.error("Server list update failed.$e") windscribeView.showToast("Check your internet connection.") windscribeView.showReloadError("Error loading server list") } @@ -1059,23 +1048,19 @@ class WindscribePresenterImpl @Inject constructor( } override fun onShowAllServerListClicked() { - logger.info("Starting show all server list transition...") windscribeView.showListBarSelectTransition(R.id.img_server_list_all) } override fun onShowConfigLocListClicked() { - logger.info("Starting show flix location list transition...") windscribeView.showListBarSelectTransition(R.id.img_config_loc_list) resetConfigEditState() } override fun onShowFavoritesClicked() { - logger.info("Starting show favourite server list transition...") windscribeView.showListBarSelectTransition(R.id.img_server_list_favorites) } override fun onShowFlixListClicked() { - logger.info("Starting show flix location list transition...") windscribeView.showListBarSelectTransition(R.id.img_server_list_flix) } @@ -1094,7 +1079,6 @@ class WindscribePresenterImpl @Inject constructor( } override fun onShowStaticIpListClicked() { - logger.info("Starting show static ip list transition...") windscribeView.showListBarSelectTransition(R.id.img_static_ip_list) } @@ -1107,13 +1091,13 @@ class WindscribePresenterImpl @Inject constructor( connectToStaticIp(staticIpId) } - override fun onUnavailableRegion() { + override fun onUnavailableRegion(isStaticIP: Boolean) { windscribeView.exitSearchLayout() - windscribeView.setUpLayoutForNodeUnderMaintenance() + windscribeView.setUpLayoutForNodeUnderMaintenance(isStaticIP) } override fun onUpgradeClicked() { - logger.info("Opening upgrade activity...") + logger.debug("Opening upgrade activity...") windscribeView.openUpgradeActivity() } @@ -1476,7 +1460,7 @@ class WindscribePresenterImpl @Inject constructor( }.observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()) .subscribeWith(object : DisposableCompletableObserver() { override fun onComplete() { - logger.error("Config added successfully to database.") + logger.debug("Config added successfully to database.") interactor.getActivityScope().launch { withContext(interactor.getMainScope().coroutineContext) { interactor.getLatencyRepository().updateConfigLatencies() @@ -1496,7 +1480,6 @@ class WindscribePresenterImpl @Inject constructor( } private fun addNotificationChangeListener() { - logger.debug("Registering notification listener.") interactor.getCompositeDisposable().add( interactor.getNotifications(interactor.getAppPreferenceInterface().userName) .subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) @@ -1514,7 +1497,6 @@ class WindscribePresenterImpl @Inject constructor( } override fun onNext(popupNotificationTables: List) { - logger.debug("Notification data changed.") updateNotificationCount() checkForPopNotification(popupNotificationTables) } @@ -1618,7 +1600,6 @@ class WindscribePresenterImpl @Inject constructor( * @Param ID * */ private fun connectToCity(cityId: Int) { - logger.debug("Getting city data.") interactor.getCompositeDisposable().add( interactor.getCityAndRegionByID(cityId).subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) @@ -1655,7 +1636,7 @@ class WindscribePresenterImpl @Inject constructor( interactor.getAutoConnectionManager().connectInForeground() } } else { - logger.debug("User can not connect to location right now.") + logger.error("User can not connect to location right now.") } } }) @@ -1688,7 +1669,6 @@ class WindscribePresenterImpl @Inject constructor( } private fun connectToStaticIp(staticId: Int) { - logger.debug("Getting static ip data.") interactor.getCompositeDisposable().add( interactor.getStaticRegionByID(staticId).subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) @@ -1720,7 +1700,7 @@ class WindscribePresenterImpl @Inject constructor( interactor.getAutoConnectionManager().connectInForeground() } } else { - logger.debug("User can not connect to location right now.") + logger.error("User can not connect to location right now.") } } }) @@ -1737,23 +1717,21 @@ class WindscribePresenterImpl @Inject constructor( private fun setIpAddress() { if (windscribeView.isConnectedToNetwork) { - logger.info("Getting ip address from Api call.") interactor.getCompositeDisposable().add( interactor.getApiCallManager().checkConnectivityAndIpAddress() .subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) .subscribe({ response -> response.dataClass?.let { - logger.info("Setting up user ip address...") if (validIpAddress(it.userIp)) { windscribeView.setIpAddress(getModifiedIpAddress(it.userIp)) } } response.errorClass?.let { - logger.info("Server returned error response when getting user ip.") + logger.error("Server returned error response when getting user ip.") windscribeView.setIpAddress("---.---.---.---") } }, { - logger.debug("Network call to get ip failed ${it.message}") + logger.error("Network call to get ip failed ${it.message}") windscribeView.setIpAddress("---.---.---.---") }) ) @@ -1771,7 +1749,6 @@ class WindscribePresenterImpl @Inject constructor( ipAddress = ipAddress.replace("000".toRegex(), "") ipAddress = ipAddress.replace("00".toRegex(), "") } else { - logger.info("Saving Ipv4 address...") ipAddress = ipResponse } interactor.getAppPreferenceInterface() @@ -1813,7 +1790,7 @@ class WindscribePresenterImpl @Inject constructor( } private fun onLastSelectedLocationLoadFailed(throwable: Throwable) { - logger.debug( + logger.error( "Error getting connected profile.StackTrace: " + instance.convertThrowableToString( throwable ) @@ -1861,21 +1838,14 @@ class WindscribePresenterImpl @Inject constructor( count++ } } - logger.debug("updating notification count to $count") windscribeView.showNotificationCount(count) } private fun onNotificationResponseError() { - logger.debug("Error updating notification count: setting notification count to 0") + logger.error("Error updating notification count: setting notification count to 0") windscribeView.showNotificationCount(0) } - private fun onUserSessionError(e: Throwable) { - logger.debug( - "Error retrieving user session data from storage" + instance.convertThrowableToString(e) - ) - } - /* * Reset adapters on data change * */ @@ -1909,7 +1879,6 @@ class WindscribePresenterImpl @Inject constructor( private fun setAllServerView( regionAndCities: List, serverListData: ServerListData ) { - logger.debug("Setting server list adapters.") // All Server list val normalGroups: MutableList = ArrayList() // Streaming server list @@ -1959,12 +1928,10 @@ class WindscribePresenterImpl @Inject constructor( if (normalGroups.size <= 1) { windscribeView.showReloadError("Error loading server list") } - logger.debug("Server list Group count: ${normalGroups.size}") windscribeView.hideRecyclerViewProgressBar() } private fun setFavouriteServerView(serverListData: ServerListData) { - logger.info("Setting favourite adapter.") val favIds = IntArray(serverListData.favourites.size) for (i in serverListData.favourites.indices) { favIds[i] = serverListData.favourites[i].id @@ -1974,7 +1941,7 @@ class WindscribePresenterImpl @Inject constructor( .subscribeOn(Schedulers.io()) .subscribeWith(object : DisposableSingleObserver?>() { override fun onError(e: Throwable) { - logger.info("Error setting favourite adapter.") + logger.error("Error setting favourite adapter.") windscribeView.setFavouriteAdapter(null) windscribeView.showFavouriteAdapterLoadError( interactor.getResourceString(R.string.no_favourites) @@ -1998,13 +1965,11 @@ class WindscribePresenterImpl @Inject constructor( Collections.sort(cities, ByCityName()) } if (cities.isNotEmpty()) { - logger.info("Setting favourite adapter with " + cities.size + " items.") favouriteAdapter = FavouriteAdapter( cities, serverListData, this@WindscribePresenterImpl ) windscribeView.setFavouriteAdapter(favouriteAdapter!!) } else { - logger.info("Setting empty favourite adapter") favouriteAdapter = null windscribeView.setFavouriteAdapter(null) windscribeView.showFavouriteAdapterLoadError( @@ -2020,11 +1985,9 @@ class WindscribePresenterImpl @Inject constructor( val ipAddress = interactor.getAppPreferenceInterface() .getResponseString(PreferencesKeyConstants.USER_IP) if (ipAddress != null && interactor.getVpnConnectionStateManager().isVPNActive()) { - logger.info("Vpn is connected setting ip from stored data...") windscribeView.setIpAddress(ipAddress) } if (!interactor.getVpnConnectionStateManager().isVPNActive() || ipAddress == null) { - logger.info("Either no cached ip found or vpn is disconnected requesting an ip update from Api") windscribeView.setIpAddress("---.---.---.---") setIpAddress() } @@ -2145,9 +2108,9 @@ class WindscribePresenterImpl @Inject constructor( } private fun setUserStatus(user: User) { - logger.debug("$user") + logger.debug("{}", user) if (user.maxData != -1L) { - user.dataLeft?.let { + user.dataLeft.let { val dataRemaining = interactor.getDataLeftString(R.string.data_left, it) windscribeView.setupLayoutForFreeUser( dataRemaining, @@ -2216,7 +2179,6 @@ class WindscribePresenterImpl @Inject constructor( override suspend fun showShareLinkDialog() { interactor.getUserRepository().user.value?.let { delay(4000) - logger.debug("Share link criteria: Free user: ${it.isPro.not()} Days registered since:${it.daysRegisteredSince} Already shown: ${interactor.getAppPreferenceInterface().alreadyShownShareAppLink}") if (it.isGhost.not() && it.isPro.not() && it.daysRegisteredSince > 30 && interactor.getAppPreferenceInterface().getConnectionCount() >= 10 && interactor.getAppPreferenceInterface().alreadyShownShareAppLink.not()) { windscribeView.showShareLinkDialog() } @@ -2269,10 +2231,10 @@ class WindscribePresenterImpl @Inject constructor( logger.debug("Updating ip address to $updatedIpAddress") windscribeView.setIpAddress(updatedIpAddress) } else { - logger.debug("Invalid ip returned from Api $ip") + logger.error("Invalid ip returned from Api $ip") } } ?: kotlin.run { - logger.debug("Failed to get ip from APi.") + logger.error("Failed to get ip from API.") } }) } @@ -2304,8 +2266,7 @@ class WindscribePresenterImpl @Inject constructor( .filter { count -> val showCount = interactor.getAppPreferenceInterface().getPowerWhiteListDialogCount() count > 1 && !isIgnoringBatteryOptimizations(appContext) && showCount < 3 - }.collectLatest { connectionCount -> - logger.debug("Connection count: $connectionCount") + }.collectLatest { if (!isIgnoringBatteryOptimizations(appContext) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { windscribeView.launchBatteryOptimizationActivity() } diff --git a/mobile/src/main/java/com/windscribe/mobile/windscribe/WindscribeView.kt b/mobile/src/main/java/com/windscribe/mobile/windscribe/WindscribeView.kt index 1674b468a..46ea359ad 100644 --- a/mobile/src/main/java/com/windscribe/mobile/windscribe/WindscribeView.kt +++ b/mobile/src/main/java/com/windscribe/mobile/windscribe/WindscribeView.kt @@ -28,7 +28,6 @@ interface WindscribeView { val networkLayoutState: NetworkLayoutState? val uiConnectionState: ConnectionUiState? fun gotoLoginRegistrationActivity() - fun handleRateView() fun hideProgressView() fun hideRecyclerViewProgressBar() val isBannedLayoutShown: Boolean @@ -66,7 +65,7 @@ interface WindscribeView { fun setRefreshLayout(refreshing: Boolean) fun setStaticRegionAdapter(staticRegionAdapter: StaticRegionAdapter) fun setStreamingNodeAdapter(streamingNodeAdapter: StreamingNodeAdapter) - fun setUpLayoutForNodeUnderMaintenance() + fun setUpLayoutForNodeUnderMaintenance(isStaticLocation: Boolean) fun setupAccountStatusBanned() fun setupAccountStatusExpired(resetDate: String) fun setupLayoutConnected(state: ConnectedState) diff --git a/mobile/src/main/res/drawable-hdpi/upgrade_hero.png b/mobile/src/main/res/drawable-hdpi/upgrade_hero.png new file mode 100644 index 000000000..c77615f3a Binary files /dev/null and b/mobile/src/main/res/drawable-hdpi/upgrade_hero.png differ diff --git a/mobile/src/main/res/drawable-hdpi/upgrade_hero_grid.png b/mobile/src/main/res/drawable-hdpi/upgrade_hero_grid.png new file mode 100644 index 000000000..aec1dae47 Binary files /dev/null and b/mobile/src/main/res/drawable-hdpi/upgrade_hero_grid.png differ diff --git a/mobile/src/main/res/drawable-hdpi/upgrade_welcome.png b/mobile/src/main/res/drawable-hdpi/upgrade_welcome.png new file mode 100644 index 000000000..352c84df8 Binary files /dev/null and b/mobile/src/main/res/drawable-hdpi/upgrade_welcome.png differ diff --git a/mobile/src/main/res/drawable-mdpi/upgrade_hero.png b/mobile/src/main/res/drawable-mdpi/upgrade_hero.png new file mode 100644 index 000000000..c77615f3a Binary files /dev/null and b/mobile/src/main/res/drawable-mdpi/upgrade_hero.png differ diff --git a/mobile/src/main/res/drawable-mdpi/upgrade_hero_grid.png b/mobile/src/main/res/drawable-mdpi/upgrade_hero_grid.png new file mode 100644 index 000000000..aec1dae47 Binary files /dev/null and b/mobile/src/main/res/drawable-mdpi/upgrade_hero_grid.png differ diff --git a/mobile/src/main/res/drawable-mdpi/upgrade_welcome.png b/mobile/src/main/res/drawable-mdpi/upgrade_welcome.png new file mode 100644 index 000000000..352c84df8 Binary files /dev/null and b/mobile/src/main/res/drawable-mdpi/upgrade_welcome.png differ diff --git a/mobile/src/main/res/drawable-xhdpi/upgrade_hero.png b/mobile/src/main/res/drawable-xhdpi/upgrade_hero.png new file mode 100644 index 000000000..c77615f3a Binary files /dev/null and b/mobile/src/main/res/drawable-xhdpi/upgrade_hero.png differ diff --git a/mobile/src/main/res/drawable-xhdpi/upgrade_hero_grid.png b/mobile/src/main/res/drawable-xhdpi/upgrade_hero_grid.png new file mode 100644 index 000000000..aec1dae47 Binary files /dev/null and b/mobile/src/main/res/drawable-xhdpi/upgrade_hero_grid.png differ diff --git a/mobile/src/main/res/drawable-xhdpi/upgrade_welcome.png b/mobile/src/main/res/drawable-xhdpi/upgrade_welcome.png new file mode 100644 index 000000000..352c84df8 Binary files /dev/null and b/mobile/src/main/res/drawable-xhdpi/upgrade_welcome.png differ diff --git a/mobile/src/main/res/drawable-xxhdpi/upgrade_hero.png b/mobile/src/main/res/drawable-xxhdpi/upgrade_hero.png new file mode 100644 index 000000000..d12056508 Binary files /dev/null and b/mobile/src/main/res/drawable-xxhdpi/upgrade_hero.png differ diff --git a/mobile/src/main/res/drawable-xxhdpi/upgrade_hero_grid.png b/mobile/src/main/res/drawable-xxhdpi/upgrade_hero_grid.png new file mode 100644 index 000000000..541044ef6 Binary files /dev/null and b/mobile/src/main/res/drawable-xxhdpi/upgrade_hero_grid.png differ diff --git a/mobile/src/main/res/drawable-xxhdpi/upgrade_welcome.png b/mobile/src/main/res/drawable-xxhdpi/upgrade_welcome.png new file mode 100644 index 000000000..5a818a358 Binary files /dev/null and b/mobile/src/main/res/drawable-xxhdpi/upgrade_welcome.png differ diff --git a/mobile/src/main/res/drawable-xxxhdpi/upggrade_welcome.png b/mobile/src/main/res/drawable-xxxhdpi/upggrade_welcome.png new file mode 100644 index 000000000..97a1a103d Binary files /dev/null and b/mobile/src/main/res/drawable-xxxhdpi/upggrade_welcome.png differ diff --git a/mobile/src/main/res/drawable-xxxhdpi/upgrade_hero.png b/mobile/src/main/res/drawable-xxxhdpi/upgrade_hero.png new file mode 100644 index 000000000..3b6c626cc Binary files /dev/null and b/mobile/src/main/res/drawable-xxxhdpi/upgrade_hero.png differ diff --git a/mobile/src/main/res/drawable-xxxhdpi/upgrade_hero_grid.png b/mobile/src/main/res/drawable-xxxhdpi/upgrade_hero_grid.png new file mode 100644 index 000000000..d5dbfbc80 Binary files /dev/null and b/mobile/src/main/res/drawable-xxxhdpi/upgrade_hero_grid.png differ diff --git a/mobile/src/main/res/drawable/checked_radio_circle.xml b/mobile/src/main/res/drawable/checked_radio_circle.xml new file mode 100644 index 000000000..9b73a45cd --- /dev/null +++ b/mobile/src/main/res/drawable/checked_radio_circle.xml @@ -0,0 +1,9 @@ + + + diff --git a/mobile/src/main/res/drawable/discord.xml b/mobile/src/main/res/drawable/discord.xml new file mode 100644 index 000000000..b339d3eab --- /dev/null +++ b/mobile/src/main/res/drawable/discord.xml @@ -0,0 +1,10 @@ + + + diff --git a/mobile/src/main/res/drawable/discount_background.xml b/mobile/src/main/res/drawable/discount_background.xml new file mode 100644 index 000000000..54e20cc79 --- /dev/null +++ b/mobile/src/main/res/drawable/discount_background.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/mobile/src/main/res/drawable/ic_close_no_background.xml b/mobile/src/main/res/drawable/ic_close_no_background.xml new file mode 100644 index 000000000..150f0c6b3 --- /dev/null +++ b/mobile/src/main/res/drawable/ic_close_no_background.xml @@ -0,0 +1,10 @@ + + + diff --git a/mobile/src/main/res/drawable/ic_star.xml b/mobile/src/main/res/drawable/ic_star.xml new file mode 100644 index 000000000..4064fb225 --- /dev/null +++ b/mobile/src/main/res/drawable/ic_star.xml @@ -0,0 +1,17 @@ + + + + diff --git a/mobile/src/main/res/drawable/promo_background.xml b/mobile/src/main/res/drawable/promo_background.xml new file mode 100644 index 000000000..ba0c026fa --- /dev/null +++ b/mobile/src/main/res/drawable/promo_background.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/mobile/src/main/res/drawable/rb_checked.xml b/mobile/src/main/res/drawable/rb_checked.xml new file mode 100644 index 000000000..01cbd8083 --- /dev/null +++ b/mobile/src/main/res/drawable/rb_checked.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/mobile/src/main/res/drawable/reddit.xml b/mobile/src/main/res/drawable/reddit.xml new file mode 100644 index 000000000..61400ea4c --- /dev/null +++ b/mobile/src/main/res/drawable/reddit.xml @@ -0,0 +1,11 @@ + + + diff --git a/mobile/src/main/res/drawable/upgrade_logo.xml b/mobile/src/main/res/drawable/upgrade_logo.xml new file mode 100644 index 000000000..f168c06fe --- /dev/null +++ b/mobile/src/main/res/drawable/upgrade_logo.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/mobile/src/main/res/drawable/x.xml b/mobile/src/main/res/drawable/x.xml new file mode 100644 index 000000000..d7c1def3d --- /dev/null +++ b/mobile/src/main/res/drawable/x.xml @@ -0,0 +1,10 @@ + + + diff --git a/mobile/src/main/res/drawable/youtube.xml b/mobile/src/main/res/drawable/youtube.xml new file mode 100644 index 000000000..711133433 --- /dev/null +++ b/mobile/src/main/res/drawable/youtube.xml @@ -0,0 +1,11 @@ + + + diff --git a/mobile/src/main/res/layout/activity_upgrade.xml b/mobile/src/main/res/layout/activity_upgrade.xml index c4806b919..783bafed5 100644 --- a/mobile/src/main/res/layout/activity_upgrade.xml +++ b/mobile/src/main/res/layout/activity_upgrade.xml @@ -1,14 +1,328 @@ - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mobile/src/main/res/layout/activity_upgrade_success.xml b/mobile/src/main/res/layout/activity_upgrade_success.xml new file mode 100644 index 000000000..7f1f2c95d --- /dev/null +++ b/mobile/src/main/res/layout/activity_upgrade_success.xml @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mobile/src/main/res/values/attrs.xml b/mobile/src/main/res/values/attrs.xml index 23e6dfd1f..009fc82b3 100644 --- a/mobile/src/main/res/values/attrs.xml +++ b/mobile/src/main/res/values/attrs.xml @@ -105,6 +105,7 @@ + diff --git a/mobile/src/main/res/values/colors.xml b/mobile/src/main/res/values/colors.xml index bf9f34e5a..962f2ee4d 100644 --- a/mobile/src/main/res/values/colors.xml +++ b/mobile/src/main/res/values/colors.xml @@ -66,5 +66,14 @@ #343434 #0e1927 + + #090E19 + #CC090E19 + #00C3E5EE + #24C3E5EE + #C3E5EE + #00DDFF87 + #00DDFF87 + #CADFF2 diff --git a/mobile/src/main/res/values/dimens.xml b/mobile/src/main/res/values/dimens.xml index c1a694a9b..ac5749cd3 100644 --- a/mobile/src/main/res/values/dimens.xml +++ b/mobile/src/main/res/values/dimens.xml @@ -5,6 +5,7 @@ + 1dp 2dp 8dp 10dp diff --git a/mobile/src/main/res/values/styles.xml b/mobile/src/main/res/values/styles.xml index d8669b16e..8e14b37d9 100644 --- a/mobile/src/main/res/values/styles.xml +++ b/mobile/src/main/res/values/styles.xml @@ -653,6 +653,13 @@ bold + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tv/build.gradle b/tv/build.gradle index 6b968f8da..21e5beecf 100644 --- a/tv/build.gradle +++ b/tv/build.gradle @@ -26,8 +26,8 @@ android { applicationId rootProject.AppId minSdkVersion rootProject.appMinSdk targetSdkVersion rootProject.appTargetSdk - versionName System.getenv().getOrDefault("VERSION_NAME", "3.81") - versionCode 1618 + versionName System.getenv().getOrDefault("VERSION_NAME", "3.82") + versionCode 1622 vectorDrawables.useSupportLibrary = true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/tv/proguard-rules.pro b/tv/proguard-rules.pro index 42d7cb892..6987dcec6 100644 --- a/tv/proguard-rules.pro +++ b/tv/proguard-rules.pro @@ -66,3 +66,4 @@ -keep class org.pcap4j.packet.factory.** { *; } # Keep classes from minidns-client -keep class org.minidns.** { *; } +-keep class com.windscribe.vpn.commonutils.LowerCaseLevelConverter { *; } diff --git a/tv/src/google/java/com/windscribe/tv/upgrade/UpgradeActivity.kt b/tv/src/google/java/com/windscribe/tv/upgrade/UpgradeActivity.kt index 5030e80b8..1169141a1 100644 --- a/tv/src/google/java/com/windscribe/tv/upgrade/UpgradeActivity.kt +++ b/tv/src/google/java/com/windscribe/tv/upgrade/UpgradeActivity.kt @@ -50,7 +50,7 @@ class UpgradeActivity : BaseActivity(), UpgradeView, BillingFragmentCallback { lateinit var amazonBillingManager: AmazonBillingManager @Inject lateinit var googleBillingManager: GoogleBillingManager - private val logger = LoggerFactory.getLogger("upgrade_a") + private val logger = LoggerFactory.getLogger("basic") private var selectedProductDetails: ProductDetails? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/tv/src/google/java/com/windscribe/tv/upgrade/UpgradePresenterImpl.kt b/tv/src/google/java/com/windscribe/tv/upgrade/UpgradePresenterImpl.kt index 3a7881e31..55a01397c 100644 --- a/tv/src/google/java/com/windscribe/tv/upgrade/UpgradePresenterImpl.kt +++ b/tv/src/google/java/com/windscribe/tv/upgrade/UpgradePresenterImpl.kt @@ -64,7 +64,7 @@ class UpgradePresenterImpl @Inject constructor( private var mPurchase: Purchase? = null private var notificationAction: PushNotificationAction? = null private var mobileBillingPlans: List = ArrayList() - private val logger = LoggerFactory.getLogger("upgrade_p") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { logger.info("Stopping billing connection...") // Start the background service to verify purchase before destroying diff --git a/tv/src/main/java/com/windscribe/tv/confirmemail/ConfirmEmailPresenterImp.kt b/tv/src/main/java/com/windscribe/tv/confirmemail/ConfirmEmailPresenterImp.kt index aa2fe543f..065ed9a07 100644 --- a/tv/src/main/java/com/windscribe/tv/confirmemail/ConfirmEmailPresenterImp.kt +++ b/tv/src/main/java/com/windscribe/tv/confirmemail/ConfirmEmailPresenterImp.kt @@ -17,7 +17,7 @@ class ConfirmEmailPresenterImp @Inject constructor( private var confirmEmailView: ConfirmEmailView, private var interactor: ActivityInteractor ) : ConfirmEmailPresenter { - private val logger = LoggerFactory.getLogger("confirm-email-i") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { if (!interactor.getCompositeDisposable().isDisposed) { interactor.getCompositeDisposable().dispose() diff --git a/tv/src/main/java/com/windscribe/tv/email/AddEmailActivity.kt b/tv/src/main/java/com/windscribe/tv/email/AddEmailActivity.kt index 54e005ff6..8567c5a9f 100644 --- a/tv/src/main/java/com/windscribe/tv/email/AddEmailActivity.kt +++ b/tv/src/main/java/com/windscribe/tv/email/AddEmailActivity.kt @@ -54,7 +54,7 @@ class AddEmailActivity : BaseActivity(), AddEmailView { @BindView(R.id.title) var title: TextView? = null - private val logger = LoggerFactory.getLogger("add_email_a") + private val logger = LoggerFactory.getLogger("basic") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setActivityModule(ActivityModule(this, this)).inject(this) diff --git a/tv/src/main/java/com/windscribe/tv/email/AddEmailPresenterImpl.kt b/tv/src/main/java/com/windscribe/tv/email/AddEmailPresenterImpl.kt index b23c7b49a..7a1bd202a 100644 --- a/tv/src/main/java/com/windscribe/tv/email/AddEmailPresenterImpl.kt +++ b/tv/src/main/java/com/windscribe/tv/email/AddEmailPresenterImpl.kt @@ -17,10 +17,9 @@ class AddEmailPresenterImpl @Inject constructor( private var addEmailView: AddEmailView, private var interactor: ActivityInteractor ) : AddEmailPresenter { - private val logger = LoggerFactory.getLogger("add_email_p") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { if (!interactor.getCompositeDisposable().isDisposed) { - logger.info("Disposing network observer...") interactor.getCompositeDisposable().dispose() } } diff --git a/tv/src/main/java/com/windscribe/tv/news/NewsFeedActivity.kt b/tv/src/main/java/com/windscribe/tv/news/NewsFeedActivity.kt index 2ff3ccade..cc682aa3d 100644 --- a/tv/src/main/java/com/windscribe/tv/news/NewsFeedActivity.kt +++ b/tv/src/main/java/com/windscribe/tv/news/NewsFeedActivity.kt @@ -52,7 +52,7 @@ class NewsFeedActivity : BaseActivity(), NewsFeedView { lateinit var presenter: NewsFeedPresenter private var newsFeedAdapter: NewsFeedAdapter? = null - private val logger = LoggerFactory.getLogger("news_feed_a") + private val logger = LoggerFactory.getLogger("basic") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/tv/src/main/java/com/windscribe/tv/news/NewsFeedPresenterImpl.kt b/tv/src/main/java/com/windscribe/tv/news/NewsFeedPresenterImpl.kt index 6ff763c33..8f59a4d2b 100644 --- a/tv/src/main/java/com/windscribe/tv/news/NewsFeedPresenterImpl.kt +++ b/tv/src/main/java/com/windscribe/tv/news/NewsFeedPresenterImpl.kt @@ -26,7 +26,7 @@ class NewsFeedPresenterImpl @Inject constructor( ) : NewsFeedPresenter, NewsFeedAdapter.NewsFeedListener { private var newsFeedAdapter: NewsFeedAdapter? = null private var notificationList: List? = null - private val logger = LoggerFactory.getLogger("news_feed_p") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { if (!interactor.getCompositeDisposable().isDisposed) { interactor.getCompositeDisposable().dispose() @@ -38,39 +38,14 @@ class NewsFeedPresenterImpl @Inject constructor( interactor.getAppPreferenceInterface().setShowNewsFeedAlert(false) } interactor.getCompositeDisposable().add( - interactor.getAppPreferenceInterface().notifications - .onErrorResumeNext { - interactor.getApiCallManager().getNotifications(null) - .flatMap { - Single - .fromCallable { - it.dataClass?.let { - logger.info("Received data from api call. Saving in storage...") - interactor.getAppPreferenceInterface() - .saveResponseStringData( - PreferencesKeyConstants.NEWS_FEED_RESPONSE, - Gson().toJson(it) - ) - return@fromCallable it - } ?: kotlin.run { - logger.debug("Server returned null response!") - it.errorClass?.let { - throw Exception(it.errorMessage) - } - } - } - }.doOnError { - logger.debug( - "Error getting notification data. Error: " + instance.convertThrowableToString( - it - ) - ) - newsFeedView.showLoadingError("Error loading news feed data...") - } - } + interactor.getNotifications() + .onErrorResumeNext( + interactor.getNotificationUpdater().update() + .andThen(interactor.getNotifications()) + ) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) - .subscribeWith(object : DisposableSingleObserver() { + .subscribeWith(object : DisposableSingleObserver>() { override fun onError(e: Throwable) { logger.debug( "Error getting notification data. Error: " + instance.convertThrowableToString( @@ -79,10 +54,9 @@ class NewsFeedPresenterImpl @Inject constructor( ) newsFeedView.showLoadingError("Error loading news feed data...") } - - override fun onSuccess(newsFeedNotification: NewsFeedNotification) { + override fun onSuccess(newsFeedNotification: List) { logger.info("Received notification data successfully...") - notificationList = newsFeedNotification.notifications + notificationList = newsFeedNotification newsFeedAdapter = NewsFeedAdapter( notificationList @@ -95,7 +69,7 @@ class NewsFeedPresenterImpl @Inject constructor( newsFeedView.setItemSelected(if (showPopUp) popUpId else it[0].notificationId) newsFeedView.setNewsFeedContentText(it[0].notificationMessage) it[0].action?.let { action -> - logger.debug("Action: $action") + logger.debug("Action: {}", action) newsFeedView.setActionLabel(action) } } diff --git a/tv/src/main/java/com/windscribe/tv/serverlist/adapters/StaticIpAdapter.kt b/tv/src/main/java/com/windscribe/tv/serverlist/adapters/StaticIpAdapter.kt index 4a434e4cf..d1894491e 100644 --- a/tv/src/main/java/com/windscribe/tv/serverlist/adapters/StaticIpAdapter.kt +++ b/tv/src/main/java/com/windscribe/tv/serverlist/adapters/StaticIpAdapter.kt @@ -46,16 +46,22 @@ class StaticIpAdapter( ContextCompat.getColor(itemView.context, R.color.colorWhite40), PorterDuff.Mode.MULTIPLY ) - btnConnect.setOnClickListener { listener.onStaticIpClick(region) } + btnConnect.setOnClickListener { + if (region.status == 0) { + listener.onDisabledClick() + } else { + listener.onStaticIpClick(region) + } + } itemView.onFocusChangeListener = View.OnFocusChangeListener { _: View?, hasFocus: Boolean -> selectedBackground(hasFocus) - setHighlightText(hasFocus) + setHighlightText(hasFocus, region) } btnConnect.onFocusChangeListener = View.OnFocusChangeListener { _: View?, hasFocus: Boolean -> selectedBackground(hasFocus) - setHighlightText(hasFocus) + setHighlightText(hasFocus, region) } } @@ -75,13 +81,15 @@ class StaticIpAdapter( } } - private fun setHighlightText(hasFocus: Boolean) { - if (hasFocus) { + private fun setHighlightText(hasFocus: Boolean, region: StaticRegion) { + if (region.status != null && region.status == 0) { + highlightTextView.text = highlightTextView.resources.getString(R.string.unavailable) + } else { highlightTextView.text = highlightTextView.resources.getString(R.string.connect) + } + if (hasFocus) { highlightTextView.visibility = View.VISIBLE } else { - highlightTextView.text = - highlightTextView.resources.getString(R.string.connect) highlightTextView.visibility = View.INVISIBLE } } diff --git a/tv/src/main/java/com/windscribe/tv/serverlist/detail/DetailActivity.kt b/tv/src/main/java/com/windscribe/tv/serverlist/detail/DetailActivity.kt index 0aa79f1e7..9aee83c4d 100644 --- a/tv/src/main/java/com/windscribe/tv/serverlist/detail/DetailActivity.kt +++ b/tv/src/main/java/com/windscribe/tv/serverlist/detail/DetailActivity.kt @@ -48,7 +48,7 @@ class DetailActivity : BaseActivity(), DetailView { @Inject lateinit var presenter: DetailPresenter - private val logger = LoggerFactory.getLogger("detail:a") + private val logger = LoggerFactory.getLogger("basic") private var fragmentTag = 0 override fun onCreate(savedInstanceState: Bundle?) { diff --git a/tv/src/main/java/com/windscribe/tv/serverlist/detail/DetailsPresenterImp.kt b/tv/src/main/java/com/windscribe/tv/serverlist/detail/DetailsPresenterImp.kt index 1f9627d88..d1564364e 100644 --- a/tv/src/main/java/com/windscribe/tv/serverlist/detail/DetailsPresenterImp.kt +++ b/tv/src/main/java/com/windscribe/tv/serverlist/detail/DetailsPresenterImp.kt @@ -26,7 +26,7 @@ class DetailsPresenterImp( private val detailView: DetailView, private val interactor: ActivityInteractor ) : DetailPresenter, DetailListener { - private val logger = LoggerFactory.getLogger("detail:p") + private val logger = LoggerFactory.getLogger("basic") private var detailViewAdapter: DetailViewAdapter? = null override fun onDestroy() { logger.debug("Destroying detail presenter") @@ -157,7 +157,6 @@ class DetailsPresenterImp( } override fun onSuccess(favourites: List) { - logger.debug("Added to favourites.") detailView.showToast(interactor.getResourceString(R.string.added_to_favourites)) detailViewAdapter?.setFavourites(favourites) } diff --git a/tv/src/main/java/com/windscribe/tv/serverlist/overlay/OverlayActivity.kt b/tv/src/main/java/com/windscribe/tv/serverlist/overlay/OverlayActivity.kt index 9be4c4b44..637bf94cd 100644 --- a/tv/src/main/java/com/windscribe/tv/serverlist/overlay/OverlayActivity.kt +++ b/tv/src/main/java/com/windscribe/tv/serverlist/overlay/OverlayActivity.kt @@ -127,7 +127,7 @@ class OverlayActivity : BaseActivity(), OverlayView, OverlayListener { private var isHeaderOpen = false private var maxHeader: ConstraintSet? = null private var minHeader: ConstraintSet? = null - private val logger = LoggerFactory.getLogger("overlay:a") + private val logger = LoggerFactory.getLogger("basic") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setActivityModule(ActivityModule(this, this)).inject(this) @@ -398,6 +398,7 @@ class OverlayActivity : BaseActivity(), OverlayView, OverlayListener { @OnClick(R.id.header_item_all) fun onHeaderAllClick() { + overlayParent?.setCurrentFragment(0) if (currentFragment is AllOverlayFragment) { return } @@ -413,11 +414,11 @@ class OverlayActivity : BaseActivity(), OverlayView, OverlayListener { headerFavItemText?.alpha = 0.40f headerWindItemText?.alpha = 0.40f headerStaticItemText?.alpha = 0.40f - overlayParent?.setCurrentFragment(0) } @OnClick(R.id.header_item_fav) fun onHeaderFavClick() { + overlayParent?.setCurrentFragment(1) if (currentFragment is FavouriteFragment) { return } @@ -433,11 +434,11 @@ class OverlayActivity : BaseActivity(), OverlayView, OverlayListener { headerFavItemText?.alpha = 1.0f headerWindItemText?.alpha = 0.40f headerStaticItemText?.alpha = 0.40f - overlayParent?.setCurrentFragment(1) } @OnClick(R.id.header_item_static) fun onHeaderStaticClick() { + overlayParent?.setCurrentFragment(3) if (currentFragment is StaticIpFragment) { return } @@ -453,11 +454,11 @@ class OverlayActivity : BaseActivity(), OverlayView, OverlayListener { headerFavItemText?.alpha = 0.40f headerWindItemText?.alpha = 0.40f headerStaticItemText?.alpha = 1.0f - overlayParent?.setCurrentFragment(3) } @OnClick(R.id.header_item_wind) fun onHeaderWindClick() { + overlayParent?.setCurrentFragment(2) if (currentFragment is WindOverlayFragment) { return } @@ -473,7 +474,6 @@ class OverlayActivity : BaseActivity(), OverlayView, OverlayListener { headerFavItemText?.alpha = 0.40f headerWindItemText?.alpha = 1.0f headerStaticItemText?.alpha = 0.40f - overlayParent?.setCurrentFragment(2) } private val currentFragment: Fragment? diff --git a/tv/src/main/java/com/windscribe/tv/serverlist/overlay/OverlayPresenterImp.kt b/tv/src/main/java/com/windscribe/tv/serverlist/overlay/OverlayPresenterImp.kt index c0081f93f..750faafbb 100644 --- a/tv/src/main/java/com/windscribe/tv/serverlist/overlay/OverlayPresenterImp.kt +++ b/tv/src/main/java/com/windscribe/tv/serverlist/overlay/OverlayPresenterImp.kt @@ -37,7 +37,7 @@ class OverlayPresenterImp @Inject constructor( private var serverAdapter: ServerAdapter? = null private var staticIpAdapter: StaticIpAdapter? = null private var windAdapter: ServerAdapter? = null - private val logger = LoggerFactory.getLogger("overlay:p") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { logger.debug("Destroying Overlay presenter.") if (!interactor.getCompositeDisposable().isDisposed) { @@ -108,7 +108,6 @@ class OverlayPresenterImp @Inject constructor( private fun resetAllAdapter(regions: MutableList) { overlayView.setState(LoadState.Loading, R.drawable.ic_all_icon, R.string.load_loading, 1) - logger.info("****Loading server list from local storage****") val dataDetails = ServerListData() val oneTimeCompositeDisposable = CompositeDisposable() oneTimeCompositeDisposable.add( diff --git a/tv/src/main/java/com/windscribe/tv/settings/SettingsPresenterImp.kt b/tv/src/main/java/com/windscribe/tv/settings/SettingsPresenterImp.kt index cb4a05580..eb14b8d07 100644 --- a/tv/src/main/java/com/windscribe/tv/settings/SettingsPresenterImp.kt +++ b/tv/src/main/java/com/windscribe/tv/settings/SettingsPresenterImp.kt @@ -67,7 +67,7 @@ class SettingsPresenterImp @Inject constructor( ) : SettingsPresenter, InstalledAppsAdapter.InstalledAppListener { private val installedAppList: MutableList = ArrayList() private var installedAppsAdapter: InstalledAppsAdapter? = null - private val logger = LoggerFactory.getLogger("setting_presenter") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { logger.info("Disposing observer...") interactor.getAutoConnectionManager().reset() diff --git a/tv/src/main/java/com/windscribe/tv/splash/SplashActivity.kt b/tv/src/main/java/com/windscribe/tv/splash/SplashActivity.kt index f1accb895..641c6183a 100644 --- a/tv/src/main/java/com/windscribe/tv/splash/SplashActivity.kt +++ b/tv/src/main/java/com/windscribe/tv/splash/SplashActivity.kt @@ -18,7 +18,7 @@ import javax.inject.Inject class SplashActivity : BaseActivity(), SplashView { @Inject lateinit var presenter: SplashPresenter - private val logger = LoggerFactory.getLogger("splash_a") + private val logger = LoggerFactory.getLogger("basic") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setActivityModule(ActivityModule(this, this)).inject(this) diff --git a/tv/src/main/java/com/windscribe/tv/splash/SplashPresenterImpl.kt b/tv/src/main/java/com/windscribe/tv/splash/SplashPresenterImpl.kt index b74f313a8..96b348b40 100644 --- a/tv/src/main/java/com/windscribe/tv/splash/SplashPresenterImpl.kt +++ b/tv/src/main/java/com/windscribe/tv/splash/SplashPresenterImpl.kt @@ -22,11 +22,10 @@ class SplashPresenterImpl @Inject constructor( private var splashView: SplashView, private var interactor: ActivityInteractor ) : SplashPresenter { - private val logger = LoggerFactory.getLogger("splash_p") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { if (!interactor.getCompositeDisposable().isDisposed) { - logger.info("Disposing network observer...") interactor.getCompositeDisposable().dispose() } } @@ -40,7 +39,6 @@ class SplashPresenterImpl @Inject constructor( .getResponseString(PreferencesKeyConstants.NEW_INSTALLATION) if (PreferencesKeyConstants.I_NEW == installation) { // Record new install - logger.info("Recording new installation of the app") interactor.getAppPreferenceInterface() .saveResponseStringData( PreferencesKeyConstants.NEW_INSTALLATION, @@ -123,7 +121,6 @@ class SplashPresenterImpl @Inject constructor( } fun decideActivity() { - logger.info("Checking if user already logged in...") val sessionHash = interactor.getAppPreferenceInterface().sessionHash if (sessionHash != null) { logger.info("Session auth hash present. User is already logged in...") @@ -133,8 +130,6 @@ class SplashPresenterImpl @Inject constructor( } splashView.navigateToHome() } else { - // Goto Login/Registration Activity - logger.info("Session auth hash not present. User not logged in...") splashView.navigateToLogin() } } diff --git a/tv/src/main/java/com/windscribe/tv/welcome/WelcomePresenterImpl.kt b/tv/src/main/java/com/windscribe/tv/welcome/WelcomePresenterImpl.kt index d258e3a9a..82e01413c 100644 --- a/tv/src/main/java/com/windscribe/tv/welcome/WelcomePresenterImpl.kt +++ b/tv/src/main/java/com/windscribe/tv/welcome/WelcomePresenterImpl.kt @@ -39,7 +39,7 @@ class WelcomePresenterImpl @Inject constructor( ) : WelcomePresenter { private var isRegistration = false private val compositeDisposable = CompositeDisposable() - private val logger = LoggerFactory.getLogger("login-p") + private val logger = LoggerFactory.getLogger("basic") override fun onDestroy() { compositeDisposable.clear() interactor.getCompositeDisposable().clear() diff --git a/tv/src/main/java/com/windscribe/tv/windscribe/WindscribeActivity.kt b/tv/src/main/java/com/windscribe/tv/windscribe/WindscribeActivity.kt index 61199c4c8..7eba6f166 100644 --- a/tv/src/main/java/com/windscribe/tv/windscribe/WindscribeActivity.kt +++ b/tv/src/main/java/com/windscribe/tv/windscribe/WindscribeActivity.kt @@ -190,7 +190,6 @@ class WindscribeActivity : BaseActivity(), WindscribeView, DeviceStateListener, // Life cycle override fun onStart() { super.onStart() - mainLogger.info("Activity on start method,registering network and vpn status listener") if (intent != null && intent.action != null && intent.action == NotificationConstants.DISCONNECT_VPN_INTENT) { mainLogger.info("Disconnect intent received...") windscribePresenter.onDisconnectIntentReceived() @@ -334,17 +333,14 @@ class WindscribeActivity : BaseActivity(), WindscribeView, DeviceStateListener, onFadeOut(flagIconResource) } icon = flagIconResource - mainLogger.info("Setting country flag." + resources.getResourceName(flagIconResource)) } // Connect btn override fun setGlowVisibility(visibility: Int) { - mainLogger.info("Setting glow visibility changed") runOnUiThread { connectGlow?.visibility = visibility } } override fun setIpAddress(ipAddress: String) { - mainLogger.info("Setting ip address") ipAddressLabel?.text = ipAddress } @@ -387,7 +383,6 @@ class WindscribeActivity : BaseActivity(), WindscribeView, DeviceStateListener, override fun setupLayoutConnecting() { runOnUiThread { - mainLogger.info("Setting layout for connecting state.") setGlowVisibility(View.GONE) setConnectionStateText(VPNState.Status.Connecting) imgConnected?.visibility = View.GONE @@ -409,7 +404,6 @@ class WindscribeActivity : BaseActivity(), WindscribeView, DeviceStateListener, it.cancel() } } - mainLogger.info("Setting layout for disconnected state.") setConnectionStateText(VPNState.Status.Disconnected) btnVpn?.clearAnimation() state = 0 @@ -426,21 +420,18 @@ class WindscribeActivity : BaseActivity(), WindscribeView, DeviceStateListener, override fun setupLayoutDisconnecting() { setGlowVisibility(View.GONE) runOnUiThread { - mainLogger.info("Setting layout for disconnecting state.") setConnectionStateText(VPNState.Status.Disconnecting) state = 0 } } override fun setupLayoutForFreeUser(dataLeft: String, color: Int) { - mainLogger.debug("Setting layout for free user.") dataLeftLabel?.text = dataLeft dataLeftLabel?.setTextColor(color) btnUpgrade?.visibility = View.VISIBLE } override fun setupLayoutForProUser() { - mainLogger.info("Setting layout for pro user.") btnUpgrade?.visibility = View.GONE } @@ -472,7 +463,6 @@ class WindscribeActivity : BaseActivity(), WindscribeView, DeviceStateListener, override fun startSessionServiceScheduler() { appContext.workManager.updateSession() - mainLogger.debug("starting a session service") } override fun startVpnConnectedAnimation( @@ -538,7 +528,6 @@ class WindscribeActivity : BaseActivity(), WindscribeView, DeviceStateListener, textColorFinal: Int, listenerState: ConnectionStateAnimationListener ) { - mainLogger.debug("Starting vpn connecting state animation.") runOnUiThread { state = 1 setConnectionStateText(VPNState.Status.Connecting) @@ -646,7 +635,6 @@ class WindscribeActivity : BaseActivity(), WindscribeView, DeviceStateListener, @OnClick(id.btn_settings) fun onSettingClick() { windscribePresenter.onMenuButtonClicked() - mainLogger.debug("Setting button clicked.") } @OnFocusChange(id.vpn) @@ -713,7 +701,7 @@ class WindscribeActivity : BaseActivity(), WindscribeView, DeviceStateListener, companion object { const val ERROR_TAG = "login_error_tag" - private const val TAG = "windscribe_a" + private const val TAG = "basic" @JvmStatic fun getStartIntent(context: Context?): Intent { diff --git a/tv/src/main/java/com/windscribe/tv/windscribe/WindscribePresenterImpl.kt b/tv/src/main/java/com/windscribe/tv/windscribe/WindscribePresenterImpl.kt index 94f55b776..fd75b7538 100644 --- a/tv/src/main/java/com/windscribe/tv/windscribe/WindscribePresenterImpl.kt +++ b/tv/src/main/java/com/windscribe/tv/windscribe/WindscribePresenterImpl.kt @@ -54,7 +54,7 @@ class WindscribePresenterImpl @Inject constructor( var interactor: ActivityInteractor ) : WindscribePresenter, ConnectionStateAnimationListener { - private val logger = LoggerFactory.getLogger("windscribe_p") + private val logger = LoggerFactory.getLogger("basic") private var canQuit = false private val serverListUpdate = AtomicBoolean() private var selectedLocation: LastSelectedLocation? = null @@ -63,7 +63,6 @@ class WindscribePresenterImpl @Inject constructor( override suspend fun observeVPNState() { interactor.getVpnConnectionStateManager().state.collect { vpnState: VPNState -> if (vpnState.status === lastVPNState) return@collect - logger.info("Setting Connection UI: ${lastVPNState.name}") lastVPNState = vpnState.status when (vpnState.status) { VPNState.Status.Connected -> { @@ -138,7 +137,6 @@ class WindscribePresenterImpl @Inject constructor( } override fun connectWithSelectedLocation(cityID: Int) { - logger.debug("Getting city data.") interactor.getAppPreferenceInterface().globalUserConnectionPreference = true interactor.getCompositeDisposable().add( interactor.getCityAndRegionByID(cityID) @@ -195,7 +193,6 @@ class WindscribePresenterImpl @Inject constructor( val ipAddress = interactor.getAppPreferenceInterface() .getResponseString(PreferencesKeyConstants.USER_IP) if (ipAddress != null && interactor.getVpnConnectionStateManager().isVPNActive()) { - logger.info("Setting up user ip address...") windscribeView.setIpAddress(ipAddress) } if (!interactor.getVpnConnectionStateManager().isVPNActive()) { @@ -256,7 +253,6 @@ class WindscribePresenterImpl @Inject constructor( override fun onConnectedAnimationCompleted() { interactor.getAppPreferenceInterface() - logger.info("Vpn connected animation completed. Setting IP Address") windscribeView.showSplitViewIcon(interactor.getAppPreferenceInterface().lastConnectedUsingSplit) } @@ -377,7 +373,6 @@ class WindscribePresenterImpl @Inject constructor( } private fun setPartialOverlayView() { - logger.debug("Loading server list.") windscribeView.showPartialViewProgress(true) val regions: MutableList = ArrayList() val dataDetails = ServerListData() @@ -385,18 +380,15 @@ class WindscribePresenterImpl @Inject constructor( oneTimeCompositeDisposable.add( interactor.getAllRegion() .flatMap { - logger.info("Loaded server regions.") regions.clear() regions.addAll(it) interactor.getAllPings() }.onErrorReturnItem(ArrayList()) .flatMap { - logger.info("Loaded ping times.") dataDetails.pingTimes = it interactor.getFavourites() }.onErrorReturnItem(ArrayList()) .flatMap { - logger.info("Loaded favourites items.") dataDetails.favourites = it interactor.getLocationProvider().bestLocation }.flatMap { @@ -437,7 +429,6 @@ class WindscribePresenterImpl @Inject constructor( } override fun onSuccess(regionsList: List) { - logger.debug("Successfully loaded server list.") windscribeView.showPartialViewProgress(false) updateLocationData(selectedLocation, true) if (regions.isNotEmpty()) { @@ -467,7 +458,6 @@ class WindscribePresenterImpl @Inject constructor( .observeOn(AndroidSchedulers.mainThread()) .subscribeWith(object : DisposableSingleObserver() { override fun onError(e: Throwable) { - logger.debug("No last connected location found.") updateLocationData(null, false) } @@ -481,7 +471,6 @@ class WindscribePresenterImpl @Inject constructor( } private fun addNotificationChangeListener() { - logger.debug("Registering notification listener.") interactor.getCompositeDisposable().add( interactor.getNotifications(interactor.getAppPreferenceInterface().userName) .subscribeOn(Schedulers.io()) @@ -499,7 +488,6 @@ class WindscribePresenterImpl @Inject constructor( } override fun onNext(popupNotificationTables: List) { - logger.debug("Notification data changed.") checkForPopNotification(popupNotificationTables) } }) @@ -575,7 +563,6 @@ class WindscribePresenterImpl @Inject constructor( private fun setIPAddress() { if (WindUtilities.isOnline()) { - logger.info("Getting ip address from Api.") interactor.getCompositeDisposable().add( interactor.getApiCallManager() .checkConnectivityAndIpAddress() @@ -590,7 +577,6 @@ class WindscribePresenterImpl @Inject constructor( windscribeView.setIpAddress("---.---.---.---") } } ?: kotlin.run { - logger.info("Setting up user ip address...") windscribeView.setIpAddress("---.---.---.---") } }, { @@ -628,7 +614,6 @@ class WindscribePresenterImpl @Inject constructor( get() { when (interactor.getUserRepository().user.value?.accountStatus) { User.AccountStatus.Okay -> { - logger.debug("Account status was okay") return true } User.AccountStatus.Expired -> { @@ -669,7 +654,6 @@ class WindscribePresenterImpl @Inject constructor( if (selectedLocation != null) { isLocationNotAvailableToUser(false) interactor.getAppPreferenceInterface().globalUserConnectionPreference = true - logger.info("VPN connection attempt started...") interactor.getMainScope().launch { interactor.getAutoConnectionManager().connectInForeground() } diff --git a/wgtunnel/.cxx/Debug/423925u4/armeabi-v7a/.ninja_log b/wgtunnel/.cxx/Debug/423925u4/armeabi-v7a/.ninja_log index c10983274..72d579d4e 100644 --- a/wgtunnel/.cxx/Debug/423925u4/armeabi-v7a/.ninja_log +++ b/wgtunnel/.cxx/Debug/423925u4/armeabi-v7a/.ninja_log @@ -1,25 +1,29 @@ # ninja log v5 +0 43 0 /Users/gindersingh/Documents/Apps/gitlab/androidapp/wgtunnel/.cxx/Debug/423925u4/armeabi-v7a/CMakeFiles/libwg-go.so cbda010411d13620 +628 698 1721768158771043444 CMakeFiles/libwg.so.dir/wireguard-tools/src/genkey.c.o 246c2cf6048d5a7e +629 747 1721768158819802605 CMakeFiles/libwg.so.dir/wireguard-tools/src/ipc.c.o 571957cf6b82c63e +0 43 0 CMakeFiles/libwg-go.so cbda010411d13620 +684 722 1721768158796413730 CMakeFiles/libwg.so.dir/wireguard-tools/src/showconf.c.o 493425f3a48e0040 +0 36 1739478609038867797 build.ninja 23d0787ab7a9e8a6 +0 3 0 clean 57ed0b16f6bed1ec +629 684 1721768158755439958 CMakeFiles/libwg.so.dir/wireguard-tools/src/wg.c.o 2cdedd0f333e2da7 +628 712 1721768158785591726 CMakeFiles/libwg.so.dir/wireguard-tools/src/show.c.o 4594181ad84a1e3b +628 710 1721768158783508942 CMakeFiles/libwg.so.dir/wireguard-tools/src/config.c.o ab3d286953f6164b +628 694 1721768158767310916 CMakeFiles/libwg.so.dir/wireguard-tools/src/encoding.c.o c28ab0fd679982ea +747 1153 1721768159228580537 /Users/gindersingh/Documents/Apps/gitlab/androidapp/wgtunnel/build/intermediates/cxx/Debug/423925u4/obj/armeabi-v7a/libwg.so afe6a390d5ea2212 +628 721 1721768158793643323 CMakeFiles/libwg.so.dir/wireguard-tools/src/curve25519.c.o aa1c522082976e15 +685 721 1721768158794168696 CMakeFiles/libwg.so.dir/wireguard-tools/src/terminal.c.o fed4b7bc9e51369b +629 693 1721768158766793876 CMakeFiles/libwg.so.dir/wireguard-tools/src/setconf.c.o fecacb42f240f995 +629 690 1721768158761103438 CMakeFiles/libwg.so.dir/wireguard-tools/src/pubkey.c.o c9dc4903a9e92eed 1 269 0 CMakeFiles/elf-cleaner 19c5da058f63e672 629 691 1721768158760873814 CMakeFiles/libwg.so.dir/wireguard-tools/src/set.c.o 1f3a7b923afbc0cb -628 685 1721768158756702828 CMakeFiles/libwg.so.dir/ndk-compat/compat.c.o 7a36cdc93f611cc9 1 269 0 /Users/gindersingh/Documents/Apps/gitlab/androidapp/wgtunnel/.cxx/Debug/423925u4/armeabi-v7a/CMakeFiles/elf-cleaner 19c5da058f63e672 -629 690 1721768158761103438 CMakeFiles/libwg.so.dir/wireguard-tools/src/pubkey.c.o c9dc4903a9e92eed -629 693 1721768158766793876 CMakeFiles/libwg.so.dir/wireguard-tools/src/setconf.c.o fecacb42f240f995 -685 721 1721768158794168696 CMakeFiles/libwg.so.dir/wireguard-tools/src/terminal.c.o fed4b7bc9e51369b -747 1153 1721768159228580537 /Users/gindersingh/Documents/Apps/gitlab/androidapp/wgtunnel/build/intermediates/cxx/Debug/423925u4/obj/armeabi-v7a/libwg.so afe6a390d5ea2212 -628 721 1721768158793643323 CMakeFiles/libwg.so.dir/wireguard-tools/src/curve25519.c.o aa1c522082976e15 -628 694 1721768158767310916 CMakeFiles/libwg.so.dir/wireguard-tools/src/encoding.c.o c28ab0fd679982ea -628 710 1721768158783508942 CMakeFiles/libwg.so.dir/wireguard-tools/src/config.c.o ab3d286953f6164b -628 712 1721768158785591726 CMakeFiles/libwg.so.dir/wireguard-tools/src/show.c.o 4594181ad84a1e3b -629 684 1721768158755439958 CMakeFiles/libwg.so.dir/wireguard-tools/src/wg.c.o 2cdedd0f333e2da7 -0 4 0 clean 57ed0b16f6bed1ec -4 38 1730873171273236190 build.ninja 23d0787ab7a9e8a6 -684 722 1721768158796413730 CMakeFiles/libwg.so.dir/wireguard-tools/src/showconf.c.o 493425f3a48e0040 -0 43 0 CMakeFiles/libwg-go.so cbda010411d13620 -629 747 1721768158819802605 CMakeFiles/libwg.so.dir/wireguard-tools/src/ipc.c.o 571957cf6b82c63e -628 698 1721768158771043444 CMakeFiles/libwg.so.dir/wireguard-tools/src/genkey.c.o 246c2cf6048d5a7e -0 43 0 /Users/gindersingh/Documents/Apps/gitlab/androidapp/wgtunnel/.cxx/Debug/423925u4/armeabi-v7a/CMakeFiles/libwg-go.so cbda010411d13620 -0 36 1730873171273236190 build.ninja 23d0787ab7a9e8a6 +628 685 1721768158756702828 CMakeFiles/libwg.so.dir/ndk-compat/compat.c.o 7a36cdc93f611cc9 +2 80 1739478609038867797 build.ninja 23d0787ab7a9e8a6 +0 7 0 clean 57ed0b16f6bed1ec +0 5 0 clean 57ed0b16f6bed1ec +0 5 0 clean 57ed0b16f6bed1ec 0 5 0 clean 57ed0b16f6bed1ec 0 6 0 clean 57ed0b16f6bed1ec -0 3 0 clean 57ed0b16f6bed1ec +0 5 0 clean 57ed0b16f6bed1ec +0 4 0 clean 57ed0b16f6bed1ec diff --git a/wgtunnel/tools/libwg-go/go.mod b/wgtunnel/tools/libwg-go/go.mod index ac9867b9b..4241293dd 100644 --- a/wgtunnel/tools/libwg-go/go.mod +++ b/wgtunnel/tools/libwg-go/go.mod @@ -12,11 +12,11 @@ replace github.com/mr-karan/doggo => github.com/Windscribe/doggo v0.0.0-20220919 replace github.com/rs/zerolog => github.com/Windscribe/zerolog v0.0.0-20241206130353-cc6e8ef5397c -replace github.com/gorilla/websocket => github.com/Windscribe/wstunnel/websocket v0.0.0-20240826061744-234a5b466a28 +replace github.com/gorilla/websocket => github.com/Windscribe/wstunnel/websocket v0.0.0-20250204211052-c191d6e13771 require ( github.com/Control-D-Inc/ctrld v1.3.11 - github.com/Windscribe/wstunnel v0.0.0-20240826061744-234a5b466a28 + github.com/Windscribe/wstunnel v1.0.2-0.20250204211052-c191d6e13771 github.com/spf13/cobra v1.8.1 golang.org/x/sys v0.28.0 golang.zx2c4.com/wireguard v0.0.0-00010101000000-000000000000 diff --git a/wgtunnel/tools/libwg-go/go.sum b/wgtunnel/tools/libwg-go/go.sum index e9faaa0af..7bd0f8c38 100644 --- a/wgtunnel/tools/libwg-go/go.sum +++ b/wgtunnel/tools/libwg-go/go.sum @@ -46,10 +46,10 @@ github.com/Windscribe/ctrld v1.3.11-android h1:1KZp0d4PiuCi6+Huc+2rlr0wfY1OuxGes github.com/Windscribe/ctrld v1.3.11-android/go.mod h1:MKw4e72Ao9PKQDkGGTkmSprnlYSAVYCFtoMBTDD1woM= github.com/Windscribe/wireguard v1.0.3 h1:8CKOCJZW8R5f+UcdIyz6U0yVMIRXLDJ6F8xinsCbzoo= github.com/Windscribe/wireguard v1.0.3/go.mod h1:whfbyDBt09xhCYQWtO2+3UVjlaq6/9hDZrjg2ZE6SyA= -github.com/Windscribe/wstunnel v0.0.0-20240826061744-234a5b466a28 h1:AH1kMjqJpQEglv7QIUgzhxen9FJ2WmEB4z64U9C6s+Q= -github.com/Windscribe/wstunnel v0.0.0-20240826061744-234a5b466a28/go.mod h1:Br1cd2+peGu39CTPsBF1d36AtYKbc8waBU2NQlss3Wg= -github.com/Windscribe/wstunnel/websocket v0.0.0-20240826061744-234a5b466a28 h1:MIcKSDRar1TyLMKe+XdIL2+mZ8PCh49XpHtvs2gG8gE= -github.com/Windscribe/wstunnel/websocket v0.0.0-20240826061744-234a5b466a28/go.mod h1:TRuYNgKZOeo4OFmQPWLVp7AhisMpNtYeKn4KuCP7Z+E= +github.com/Windscribe/wstunnel v1.0.2-0.20250204211052-c191d6e13771 h1:iECpNyyoXxY6DWEqMVXEyPTb0KEa/nU/GKMFda++kzM= +github.com/Windscribe/wstunnel v1.0.2-0.20250204211052-c191d6e13771/go.mod h1:Br1cd2+peGu39CTPsBF1d36AtYKbc8waBU2NQlss3Wg= +github.com/Windscribe/wstunnel/websocket v0.0.0-20250204211052-c191d6e13771 h1:NBrYZFWQ+mccHvJg/eBgFGsU/3mgwkBFwI1J6j3dikQ= +github.com/Windscribe/wstunnel/websocket v0.0.0-20250204211052-c191d6e13771/go.mod h1:TRuYNgKZOeo4OFmQPWLVp7AhisMpNtYeKn4KuCP7Z+E= github.com/Windscribe/zerolog v0.0.0-20241206130353-cc6e8ef5397c h1:UqFsxmwiCh/DBvwJB0m7KQ2QFDd6DdUkosznfMppdhE= github.com/Windscribe/zerolog v0.0.0-20241206130353-cc6e8ef5397c/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa h1:LHTHcTQiSGT7VVbI0o4wBRNQIgn917usHWOd6VAffYI=