Make compatible with F-Droid (#42)

* Make compatible with F-Droid
* Fix title bar empty
This commit is contained in:
dwuku
2018-10-02 15:13:12 +00:00
committed by Mygod
parent 5f5bb063c0
commit d131d5d46b
30 changed files with 193 additions and 166 deletions

View File

@@ -5,11 +5,10 @@ import android.net.ConnectivityManager
import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.util.Log
import androidx.annotation.RequiresApi
import be.mygod.vpnhotspot.App.Companion.app
import com.android.dx.stock.ProxyBuilder
import com.crashlytics.android.Crashlytics
import timber.log.Timber
/**
* Heavily based on:
@@ -32,8 +31,6 @@ object TetheringManager {
fun onTetheringFailed() { }
}
private const val TAG = "TetheringManager"
/**
* This is a sticky broadcast since almost forever.
*
@@ -121,7 +118,7 @@ object TetheringManager {
val proxy = ProxyBuilder.forClass(classOnStartTetheringCallback)
.dexCache(app.cacheDir)
.handler { proxy, method, args ->
if (args.isNotEmpty()) Crashlytics.log(Log.WARN, TAG, "Unexpected args for ${method.name}: $args")
if (args.isNotEmpty()) Timber.w("Unexpected args for ${method.name}: $args")
when (method.name) {
"onTetheringStarted" -> {
callback.onTetheringStarted()
@@ -132,7 +129,7 @@ object TetheringManager {
null
}
else -> {
Crashlytics.log(Log.WARN, TAG, "Unexpected method, calling super: $method")
Timber.w("Unexpected method, calling super: $method")
ProxyBuilder.callSuper(proxy, method, args)
}
}