mirror of
https://github.com/MaintainTeam/LastPipeBender.git
synced 2025-02-28 21:38:20 +03:00
Wrap logs in BuildConfig.DEBUG
This commit is contained in:
parent
f856bd9306
commit
2b183a0576
2 changed files with 27 additions and 9 deletions
|
@ -4,6 +4,7 @@ import android.os.Handler
|
|||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import org.schabi.newpipe.App
|
||||
import org.schabi.newpipe.BuildConfig
|
||||
import org.schabi.newpipe.extractor.NewPipe
|
||||
import org.schabi.newpipe.extractor.services.youtube.PoTokenProvider
|
||||
import org.schabi.newpipe.extractor.services.youtube.PoTokenResult
|
||||
|
@ -84,7 +85,14 @@ object PoTokenProviderImpl : PoTokenProvider {
|
|||
}
|
||||
}
|
||||
|
||||
Log.e(TAG, "success($videoId) $playerPot,web.gvs+$streamingPot;visitor_data=$visitorData")
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.d(
|
||||
TAG,
|
||||
"poToken for $videoId: playerPot=$playerPot, " +
|
||||
"streamingPot=$streamingPot, visitor_data=$visitorData"
|
||||
)
|
||||
}
|
||||
|
||||
return PoTokenResult(visitorData, playerPot, streamingPot)
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import io.reactivex.rxjava3.core.Single
|
|||
import io.reactivex.rxjava3.core.SingleEmitter
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
import org.schabi.newpipe.BuildConfig
|
||||
import org.schabi.newpipe.DownloaderImpl
|
||||
import java.time.Instant
|
||||
|
||||
|
@ -100,7 +101,9 @@ class PoTokenWebView private constructor(
|
|||
*/
|
||||
@JavascriptInterface
|
||||
fun onJsInitializationError(error: String) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.e(TAG, "Initialization error from JavaScript: $error")
|
||||
}
|
||||
onInitializationErrorCloseAndCancel(PoTokenException(error))
|
||||
}
|
||||
|
||||
|
@ -110,12 +113,16 @@ class PoTokenWebView private constructor(
|
|||
*/
|
||||
@JavascriptInterface
|
||||
fun onRunBotguardResult(botguardResponse: String) {
|
||||
Log.e(TAG, "botguardResponse: $botguardResponse")
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.d(TAG, "botguardResponse: $botguardResponse")
|
||||
}
|
||||
makeJnnPaGoogleapisRequest(
|
||||
"https://jnn-pa.googleapis.com/\$rpc/google.internal.waa.v1.Waa/GenerateIT",
|
||||
"[ \"$REQUEST_KEY\", \"$botguardResponse\" ]",
|
||||
) { responseBody ->
|
||||
Log.e(TAG, "GenerateIT response: $responseBody")
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.d(TAG, "GenerateIT response: $responseBody")
|
||||
}
|
||||
webView.evaluateJavascript(
|
||||
"""(async function() {
|
||||
try {
|
||||
|
@ -194,7 +201,9 @@ class PoTokenWebView private constructor(
|
|||
*/
|
||||
@JavascriptInterface
|
||||
fun onObtainPoTokenError(identifier: String, error: String) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.e(TAG, "obtainPoToken error from JavaScript: $error")
|
||||
}
|
||||
popPoTokenEmitter(identifier)?.onError(PoTokenException(error))
|
||||
}
|
||||
|
||||
|
@ -204,8 +213,9 @@ class PoTokenWebView private constructor(
|
|||
*/
|
||||
@JavascriptInterface
|
||||
fun onObtainPoTokenResult(identifier: String, poToken: String) {
|
||||
Log.e(TAG, "identifier=$identifier")
|
||||
Log.e(TAG, "poToken=$poToken")
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.d(TAG, "Generated poToken: identifier=$identifier poToken=$poToken")
|
||||
}
|
||||
popPoTokenEmitter(identifier)?.onSuccess(poToken)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue