Commit fb722d6c authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Code cleanup

parent e8bacaee
......@@ -2,12 +2,10 @@ package com.frostnerd.smokescreen
import androidx.test.InstrumentationRegistry
import androidx.test.runner.AndroidJUnit4
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
......
......@@ -15,8 +15,6 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.frostnerd.smokescreen.util.preferences.AppSettings
import com.frostnerd.smokescreen.util.preferences.AppSettingsSharedPreferences
import com.frostnerd.smokescreen.util.preferences.fromSharedPreferences
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
/*
* Copyright (C) 2019 Daniel Wolf (Ch4t4r)
......
......@@ -14,13 +14,10 @@ import com.frostnerd.navigationdraweractivity.items.createMenu
import com.frostnerd.navigationdraweractivity.items.singleInstanceFragment
import com.frostnerd.smokescreen.*
import com.frostnerd.smokescreen.database.AppDatabase
import com.frostnerd.smokescreen.database.getDatabase
import com.frostnerd.smokescreen.dialog.NewServerDialog
import com.frostnerd.smokescreen.fragment.MainFragment
import com.frostnerd.smokescreen.fragment.QueryLogFragment
import com.frostnerd.smokescreen.fragment.SettingsFragment
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
/*
* Copyright (C) 2019 Daniel Wolf (Ch4t4r)
......
......@@ -2,10 +2,6 @@ package com.frostnerd.smokescreen.activity
import android.content.Context
import android.content.Intent
import android.content.pm.ShortcutInfo
import android.content.pm.ShortcutManager
import android.graphics.drawable.Icon
import android.os.Build
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.pm.ShortcutInfoCompat
......@@ -13,7 +9,6 @@ import androidx.core.content.pm.ShortcutManagerCompat
import androidx.core.graphics.drawable.IconCompat
import com.frostnerd.encrypteddnstunnelproxy.HttpsDnsServerInformation
import com.frostnerd.general.StringUtil
import com.frostnerd.lifecyclemanagement.BaseActivity
import com.frostnerd.smokescreen.R
import com.frostnerd.smokescreen.service.DnsVpnService
......@@ -56,8 +51,8 @@ class ShortcutActivity : AppCompatActivity() {
val targetIntent = Intent(context, ShortcutActivity::class.java)
targetIntent.action = "${context.packageName}.dummy_action"
targetIntent.putExtra(BackgroundVpnConfigureActivity.extraKeyPrimaryUrl, primaryServerUrl)
targetIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
targetIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
targetIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
targetIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
if (secondaryServerUrl != null) targetIntent.putExtra(
BackgroundVpnConfigureActivity.extraKeySecondaryUrl,
secondaryServerUrl
......
package com.frostnerd.smokescreen.database.converters
import androidx.room.TypeConverter
import com.google.gson.reflect.TypeToken
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
/*
......
package com.frostnerd.smokescreen.database.entities
import android.util.Base64
import androidx.room.*
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.PrimaryKey
import androidx.room.TypeConverters
import com.frostnerd.smokescreen.database.converters.DnsTypeConverter
import com.frostnerd.smokescreen.database.converters.StringListConverter
import com.frostnerd.smokescreen.database.recordFromBase64
......
package com.frostnerd.smokescreen.database.repository
import android.content.Context
import androidx.room.Insert
import com.frostnerd.smokescreen.database.converters.StringListConverter
import com.frostnerd.smokescreen.database.dao.DnsQueryDao
import com.frostnerd.smokescreen.database.entities.DnsQuery
......@@ -9,7 +8,6 @@ import kotlinx.coroutines.*
import java.io.BufferedWriter
import java.io.File
import java.io.FileWriter
import java.lang.StringBuilder
/*
* Copyright (C) 2019 Daniel Wolf (Ch4t4r)
......
......@@ -7,10 +7,12 @@ import android.view.View
import android.widget.LinearLayout
import android.widget.RadioButton
import com.frostnerd.dnstunnelproxy.DEFAULT_DNSERVER_CAPABILITIES
import com.frostnerd.encrypteddnstunnelproxy.*
import com.frostnerd.encrypteddnstunnelproxy.AbstractHttpsDNSHandle
import com.frostnerd.encrypteddnstunnelproxy.HttpsDnsServerConfiguration
import com.frostnerd.encrypteddnstunnelproxy.HttpsDnsServerInformation
import com.frostnerd.encrypteddnstunnelproxy.ServerConfiguration
import com.frostnerd.lifecyclemanagement.BaseDialog
import com.frostnerd.smokescreen.R
import com.frostnerd.smokescreen.database.getDatabase
import com.frostnerd.smokescreen.getPreferences
import com.frostnerd.smokescreen.util.preferences.UserServerConfiguration
import kotlinx.android.synthetic.main.dialog_server_configuration.*
......
package com.frostnerd.smokescreen.fragment.querylogfragment
import android.os.Build
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
......@@ -9,8 +8,6 @@ import androidx.fragment.app.Fragment
import com.frostnerd.smokescreen.R
import com.frostnerd.smokescreen.database.entities.DnsQuery
import kotlinx.android.synthetic.main.fragment_querylog_detail.*
import java.text.DateFormat
import java.util.*
/*
......
package com.frostnerd.smokescreen.fragment.querylogfragment
import android.content.Context
import android.os.Build
import android.os.Bundle
import android.view.LayoutInflater
......
......@@ -3,7 +3,6 @@ package com.frostnerd.smokescreen.util.preferences
import android.content.SharedPreferences
import com.frostnerd.encrypteddnstunnelproxy.HttpsDnsServerInformation
import com.frostnerd.encrypteddnstunnelproxy.HttpsDnsServerInformationTypeAdapter
import com.frostnerd.encrypteddnstunnelproxy.ServerConfiguration
import com.frostnerd.preferenceskt.typedpreferences.TypedPreferences
import com.frostnerd.preferenceskt.typedpreferences.types.PreferenceTypeWithDefault
import com.google.gson.stream.JsonReader
......
......@@ -4,11 +4,7 @@ import com.frostnerd.dnstunnelproxy.DnsHandle
import com.frostnerd.dnstunnelproxy.DnsPacketProxy
import com.frostnerd.dnstunnelproxy.QueryListener
import com.frostnerd.dnstunnelproxy.SimpleDnsCache
import com.frostnerd.smokescreen.getPreferences
import com.frostnerd.smokescreen.log
import com.frostnerd.smokescreen.service.DnsVpnService
import com.frostnerd.vpntunnelproxy.FutureAnswer
import org.minidns.dnsmessage.DnsMessage
/*
* Copyright (C) 2019 Daniel Wolf (Ch4t4r)
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:paddingLeft="@dimen/dialog_horizontal_margin"
android:paddingRight="@dimen/dialog_horizontal_margin"
android:paddingTop="@dimen/dialog_vertical_margin"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
......
package com.frostnerd.smokescreen
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment