Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #59 from yggdrasil-network/develop
Browse files Browse the repository at this point in the history
2.0.19
  • Loading branch information
ChronosXYZ authored Jan 15, 2022
2 parents e170d07 + 799e1fd commit 02694ab
Show file tree
Hide file tree
Showing 44 changed files with 211 additions and 192 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@
/app/src/main/assets/yggdrasil-0.3.8-linux-arm64
/app/src/main/assets/yggdrasil-0.3.8-linux-armhf
/.idea/

acra.properties
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "yggdrasil/yggdrasil-extras"]
path = yggdrasil/yggdrasil-extras
url = https://github.com/yggdrasil-network/yggdrasil-extras
16 changes: 0 additions & 16 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

3 changes: 3 additions & 0 deletions acra.properties.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ACRA_BACKEND_URL=""
ACRA_LOGIN=""
ACRA_PASSWORD=""
29 changes: 19 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

def acraSecretsPropertiesFile = rootProject.file("acra.properties")
def acraSecretsProperties = new Properties()
acraSecretsProperties.load(new FileInputStream(acraSecretsPropertiesFile))

android {
compileSdkVersion 29
compileSdkVersion 31
defaultConfig {
applicationId "io.github.chronosx88.yggdrasil"
minSdkVersion 15
targetSdkVersion 29
versionCode 23
versionName "2.0.3"
targetSdkVersion 31

versionCode 37
versionName "2.0.19"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
setProperty("archivesBaseName", project.getParent().name+"-"+versionName)

buildConfigField("String", "ACRA_BACKEND_URL", acraSecretsProperties['ACRA_BACKEND_URL'])
buildConfigField("String", "ACRA_LOGIN", acraSecretsProperties['ACRA_LOGIN'])
buildConfigField("String", "ACRA_PASSWORD", acraSecretsProperties['ACRA_PASSWORD'])
}
signingConfigs {
release {
Expand Down Expand Up @@ -68,19 +77,19 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(path: ':yggdrasil')

implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8'
implementation 'com.google.android.material:material:1.4.0-rc01'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
implementation 'com.google.android.material:material:1.5.0-alpha04'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.hbb20:ccp:2.4.0'
implementation 'com.vincentbrison.openlibraries.android:dualcache:3.1.1'
implementation 'com.vincentbrison.openlibraries.android:dualcache-jsonserializer:3.1.1'

testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.chronosx88.yggdrasil
package org.yggdrasil.app.crispa

import androidx.test.InstrumentationRegistry
import androidx.test.runner.AndroidJUnit4
Expand Down
33 changes: 18 additions & 15 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,46 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="io.github.chronosx88.yggdrasil">
package="org.yggdrasil.app.crispa">

<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".YggApplication"
android:name="org.yggdrasil.app.crispa.YggApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name=".AboutActivity"
android:parentActivityName=".MainActivity"
android:name="org.yggdrasil.app.crispa.AboutActivity"
android:parentActivityName="org.yggdrasil.app.crispa.MainActivity"
android:label="@string/title_activity_about"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".PeerListActivity"
android:parentActivityName=".MainActivity"
android:name="org.yggdrasil.app.crispa.PeerListActivity"
android:parentActivityName="org.yggdrasil.app.crispa.MainActivity"
android:label="@string/title_activity_peer_list"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".DNSListActivity"
android:parentActivityName=".MainActivity"
android:name="org.yggdrasil.app.crispa.DNSListActivity"
android:parentActivityName="org.yggdrasil.app.crispa.MainActivity"
android:label="@string/title_activity_dns_list"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".CopyLocalNodeInfoActivity"
android:parentActivityName=".MainActivity"
android:name="org.yggdrasil.app.crispa.CopyLocalNodeInfoActivity"
android:parentActivityName="org.yggdrasil.app.crispa.MainActivity"
android:label="@string/title_activity_copy_local_node_info"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<service
android:name=".YggdrasilTunService"
android:name="org.yggdrasil.app.crispa.YggdrasilTunService"
android:stopWithTask="true"
android:enabled="true"
android:exported="true"
android:permission="android.permission.BIND_VPN_SERVICE">
Expand All @@ -49,10 +51,11 @@
</intent-filter>
</service>

<activity android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait">
<activity android:name="org.yggdrasil.app.crispa.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.chronosx88.yggdrasil
package org.yggdrasil.app.crispa

import android.os.Bundle
import android.text.Html
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.github.chronosx88.yggdrasil
package org.yggdrasil.app.crispa

import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import androidx.preference.PreferenceManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import io.github.chronosx88.yggdrasil.models.config.NodeInfoListAdapter
import org.yggdrasil.app.crispa.models.NodeInfo
import org.yggdrasil.app.crispa.models.config.NodeInfoListAdapter

class CopyLocalNodeInfoActivity: AppCompatActivity() {

Expand All @@ -18,8 +18,8 @@ class CopyLocalNodeInfoActivity: AppCompatActivity() {
PreferenceManager.getDefaultSharedPreferences(this.baseContext)
val ipv6Address = intent.extras!!.getString(MainActivity.IPv6, "")
val publicKey = preferences.getString(MainActivity.publicKey, "")
var nodeInfoListView = findViewById<ListView>(R.id.nodeInfoList)
val nodeInfoList = listOf<NodeInfo>(NodeInfo("IP address", ipv6Address!!), NodeInfo("Public Key", publicKey!!));
var nodeInfoListView = findViewById<RecyclerView>(R.id.node_info_list)
val nodeInfoList = listOf(NodeInfo("IP address", ipv6Address!!), NodeInfo("Public Key", publicKey!!));
val adapter =
NodeInfoListAdapter(
this,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.chronosx88.yggdrasil
package org.yggdrasil.app.crispa

import android.app.Activity
import android.content.Intent
Expand All @@ -9,11 +9,11 @@ import android.widget.*
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.floatingactionbutton.FloatingActionButton
import io.github.chronosx88.yggdrasil.models.DNSInfo
import io.github.chronosx88.yggdrasil.models.config.SelectDNSInfoListAdapter
import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.deserializeStringList2DNSInfoSet
import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.ping
import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.serializeDNSInfoSet2StringList
import org.yggdrasil.app.crispa.models.DNSInfo
import org.yggdrasil.app.crispa.models.config.SelectDNSInfoListAdapter
import org.yggdrasil.app.crispa.models.config.Utils.Companion.deserializeStringList2DNSInfoSet
import org.yggdrasil.app.crispa.models.config.Utils.Companion.ping
import org.yggdrasil.app.crispa.models.config.Utils.Companion.serializeDNSInfoSet2StringList
import kotlinx.coroutines.*
import java.net.InetAddress
import kotlin.concurrent.thread
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.chronosx88.yggdrasil
package org.yggdrasil.app.crispa

import android.app.Activity
import android.app.ActivityManager
Expand All @@ -14,17 +14,17 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.SwitchCompat
import androidx.preference.PreferenceManager
import dalvik.system.DexFile
import io.github.chronosx88.yggdrasil.models.DNSInfo
import io.github.chronosx88.yggdrasil.models.PeerInfo
import io.github.chronosx88.yggdrasil.models.config.DNSInfoListAdapter
import io.github.chronosx88.yggdrasil.models.config.PeerInfoListAdapter
import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.deserializePeerStringList2PeerInfoSet
import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.deserializeStringList2DNSInfoSet
import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.deserializeStringList2PeerInfoSet
import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.deserializeStringSet2DNSInfoSet
import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.deserializeStringSet2PeerInfoSet
import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.serializeDNSInfoSet2StringList
import io.github.chronosx88.yggdrasil.models.config.Utils.Companion.serializePeerInfoSet2StringList
import org.yggdrasil.app.crispa.models.DNSInfo
import org.yggdrasil.app.crispa.models.PeerInfo
import org.yggdrasil.app.crispa.models.config.DNSInfoListAdapter
import org.yggdrasil.app.crispa.models.config.PeerInfoListAdapter
import org.yggdrasil.app.crispa.models.config.Utils.Companion.deserializePeerStringList2PeerInfoSet
import org.yggdrasil.app.crispa.models.config.Utils.Companion.deserializeStringList2DNSInfoSet
import org.yggdrasil.app.crispa.models.config.Utils.Companion.deserializeStringList2PeerInfoSet
import org.yggdrasil.app.crispa.models.config.Utils.Companion.deserializeStringSet2DNSInfoSet
import org.yggdrasil.app.crispa.models.config.Utils.Companion.deserializeStringSet2PeerInfoSet
import org.yggdrasil.app.crispa.models.config.Utils.Companion.serializeDNSInfoSet2StringList
import org.yggdrasil.app.crispa.models.config.Utils.Companion.serializePeerInfoSet2StringList
import kotlin.concurrent.thread


Expand Down Expand Up @@ -398,6 +398,9 @@ class MainActivity : AppCompatActivity() {

//TODO reimplement it
private fun isYggServiceRunning(context: Context): Boolean {
if(this.intent.hasExtra(YggdrasilTunService.IS_VPN_SERVICE_STOPPED)){
return !this.intent.getBooleanExtra(YggdrasilTunService.IS_VPN_SERVICE_STOPPED, true)
}
val manager =
context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
for (service in manager.getRunningServices(Int.MAX_VALUE)) {
Expand Down
Loading

0 comments on commit 02694ab

Please sign in to comment.