From 0281b9c5c53582cfb566524f631f3ca346b77124 Mon Sep 17 00:00:00 2001 From: vadym Date: Tue, 7 Jul 2020 01:31:32 -0700 Subject: [PATCH 1/4] 1. open MainActivity after Notification click, task #12 --- app/src/main/AndroidManifest.xml | 2 ++ .../github/chronosx88/yggdrasil/YggdrasilTunService.kt | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ee57592..18c1ee0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -16,11 +16,13 @@ tools:ignore="GoogleAppIndexingWarning"> diff --git a/app/src/main/java/io/github/chronosx88/yggdrasil/YggdrasilTunService.kt b/app/src/main/java/io/github/chronosx88/yggdrasil/YggdrasilTunService.kt index 96e95ad..b0e593a 100644 --- a/app/src/main/java/io/github/chronosx88/yggdrasil/YggdrasilTunService.kt +++ b/app/src/main/java/io/github/chronosx88/yggdrasil/YggdrasilTunService.kt @@ -1,9 +1,6 @@ package io.github.chronosx88.yggdrasil -import android.app.Notification -import android.app.NotificationChannel -import android.app.NotificationManager -import android.app.PendingIntent +import android.app.* import android.content.Context import android.content.Intent import android.net.ConnectivityManager @@ -292,8 +289,13 @@ class YggdrasilTunService : VpnService() { // https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html#NotificationCompat.Builder(android.content.Context) "" } + var intent = Intent(this, MainActivity::class.java) + var stackBuilder = TaskStackBuilder.create(this) + stackBuilder.addNextIntentWithParentStack(intent) + var pi = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT) val b = NotificationCompat.Builder(this, channelId) b.setOngoing(true) + .setContentIntent(pi) .setContentTitle(getString(R.string.app_name)) .setContentText(text) .setSmallIcon(R.mipmap.ic_launcher) From c83147197d0327c6a718a4902395677087abfbc6 Mon Sep 17 00:00:00 2001 From: vadym Date: Tue, 7 Jul 2020 01:32:30 -0700 Subject: [PATCH 2/4] 1. bump version --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index eac470b..af555d2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "io.github.chronosx88.yggdrasil" minSdkVersion 21 targetSdkVersion 29 - versionCode 2 - versionName "1.2" + versionCode 3 + versionName "1.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" project.ext.set("archivesBaseName", project.getParent().name+"-"+versionName) } From b9529d5d629d061a3b42a916118a30c6c7e296d8 Mon Sep 17 00:00:00 2001 From: vadym Date: Sun, 19 Jul 2020 08:56:45 -0700 Subject: [PATCH 3/4] 2. new DNS only number issue --- app/src/main/res/layout/new_dns_dialog.xml | 2 +- build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/new_dns_dialog.xml b/app/src/main/res/layout/new_dns_dialog.xml index 3223ec4..464b9f4 100644 --- a/app/src/main/res/layout/new_dns_dialog.xml +++ b/app/src/main/res/layout/new_dns_dialog.xml @@ -21,7 +21,7 @@ android:id="@+id/ipInput" android:layout_width="match_parent" android:layout_height="wrap_content" - android:digits="0,1,2,3,4,5,6,7,8,9,:" + android:digits="0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,:" android:hint="IPv6" android:inputType="textNoSuggestions" android:textColor="@color/white" diff --git a/build.gradle b/build.gradle index ec73f9e..8c88b8c 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.0.0' + classpath 'com.android.tools.build:gradle:4.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files From e732c1bc2d1d96297a792b3c0d591f56697ffc39 Mon Sep 17 00:00:00 2001 From: vadym Date: Sun, 19 Jul 2020 09:31:12 -0700 Subject: [PATCH 4/4] 1. new peers after notification click update issue --- .../chronosx88/yggdrasil/MainActivity.kt | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt b/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt index e525341..839faef 100644 --- a/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt +++ b/app/src/main/java/io/github/chronosx88/yggdrasil/MainActivity.kt @@ -100,7 +100,9 @@ class MainActivity : AppCompatActivity() { currentPeers = deserializeStringSet2PeerInfoSet(preferences.getStringSet(CURRENT_PEERS, HashSet())!!) val adapter = PeerInfoListAdapter(this, currentPeers.sortedWith(compareBy { it.ping })) peersListView.adapter = adapter - + if(isStarted && this.currentPeers.isEmpty()) { + updatePeers() + } val copyAddressButton = findViewById