Migrate to open source firebase-crashlytics

This commit is contained in:
Mygod
2020-01-24 22:22:48 +08:00
parent b55ad234ac
commit 3cee5a4782
18 changed files with 67 additions and 125 deletions

View File

@@ -4,7 +4,7 @@ import android.annotation.SuppressLint
import android.net.wifi.WpsInfo
import android.net.wifi.p2p.WifiP2pGroup
import android.net.wifi.p2p.WifiP2pManager
import be.mygod.vpnhotspot.DebugHelper
import be.mygod.vpnhotspot.App.Companion.app
import com.android.dx.stock.ProxyBuilder
import timber.log.Timber
import java.lang.reflect.Proxy
@@ -30,7 +30,7 @@ object WifiP2pManagerHelper {
try {
setWifiP2pChannels.invoke(this, c, lc, oc, listener)
} catch (_: NoSuchMethodException) {
DebugHelper.logEvent("NoSuchMethod_setWifiP2pChannels")
app.logEvent("NoSuchMethod_setWifiP2pChannels")
listener.onFailure(UNSUPPORTED)
}
}
@@ -46,7 +46,7 @@ object WifiP2pManagerHelper {
WifiP2pManager::class.java.getDeclaredMethod("startWps",
WifiP2pManager.Channel::class.java, WpsInfo::class.java, WifiP2pManager.ActionListener::class.java)
} catch (_: NoSuchMethodException) {
DebugHelper.logEvent("NoSuchMethod_startWps")
app.logEvent("NoSuchMethod_startWps")
null
}
}
@@ -69,7 +69,7 @@ object WifiP2pManagerHelper {
try {
deletePersistentGroup.invoke(this, c, netId, listener)
} catch (_: NoSuchMethodException) {
DebugHelper.logEvent("NoSuchMethod_deletePersistentGroup")
app.logEvent("NoSuchMethod_deletePersistentGroup")
listener.onFailure(UNSUPPORTED)
}
}

View File

@@ -3,7 +3,6 @@ package be.mygod.vpnhotspot.net.wifi.configuration
import android.net.wifi.p2p.WifiP2pGroup
import android.os.Build
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.DebugHelper
import be.mygod.vpnhotspot.RepeaterService
import be.mygod.vpnhotspot.util.RootSession
import java.io.File
@@ -109,9 +108,9 @@ class P2pSupplicantConfiguration(private val group: WifiP2pGroup, ownerAddress:
}
Triple(result, target!!, shell.err.isNotEmpty())
} catch (e: RuntimeException) {
DebugHelper.setString(TAG, parser.lines.joinToString("\n"))
DebugHelper.setString("$TAG.ownerAddress", ownerAddress)
DebugHelper.setString("$TAG.p2pGroup", group.toString())
app.crashlytics.setCustomKey(TAG, parser.lines.joinToString("\n"))
app.crashlytics.setCustomKey("$TAG.ownerAddress", ownerAddress.toString())
app.crashlytics.setCustomKey("$TAG.p2pGroup", group.toString())
throw e
}
}