fix: biliSendCommAntifraud

related #275

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-18 15:48:12 +08:00
parent 571f358280
commit e7a7c945de
4 changed files with 38 additions and 19 deletions

View File

@@ -4,6 +4,7 @@ import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
import com.ryanheise.audioservice.AudioServiceActivity
import android.content.ComponentName
import android.content.Intent
import android.content.res.Configuration
import android.os.Build
@@ -21,6 +22,37 @@ class MainActivity : AudioServiceActivity() {
methodChannel.setMethodCallHandler { call, result ->
if (call.method == "back") {
back()
} else if (call.method == "biliSendCommAntifraud") {
val action = call.argument<Int>("action") ?: 0
val oid = call.argument<Number>("oid") ?: 0L
val type = call.argument<Int>("type") ?: 0
val rpid = call.argument<Number>("rpid") ?: 0L
val root = call.argument<Number>("root") ?: 0L
val parent = call.argument<Number>("parent") ?: 0L
val ctime = call.argument<Number>("ctime") ?: 0L
val commentText = call.argument<String>("comment_text") ?: ""
val pictures = call.argument<String?>("pictures")
val sourceId = call.argument<String>("source_id") ?: ""
val uid = call.argument<Number>("uid") ?: 0L
val cookies = call.argument<List<String>>("cookies") ?: emptyList<String>()
val intent = Intent().apply {
component = ComponentName("icu.freedomIntrovert.biliSendCommAntifraud", "icu.freedomIntrovert.biliSendCommAntifraud.ByXposedLaunchedActivity")
putExtra("action", action)
putExtra("oid", oid.toLong())
putExtra("type", type)
putExtra("rpid", rpid.toLong())
putExtra("root", root.toLong())
putExtra("parent", parent.toLong())
putExtra("ctime", ctime.toLong())
putExtra("comment_text", commentText)
if(pictures != null)
putExtra("pictures", pictures)
putExtra("source_id", sourceId)
putExtra("uid", uid.toLong())
putStringArrayListExtra("cookies", ArrayList(cookies))
}
startActivity(intent)
} else {
result.notImplemented()
}

View File

@@ -13,7 +13,6 @@ import 'package:PiliPlus/pages/video/detail/reply_new/reply_page.dart';
import 'package:PiliPlus/utils/extension.dart';
import 'package:PiliPlus/utils/global_data.dart';
import 'package:PiliPlus/utils/utils.dart';
import 'package:android_intent_plus/android_intent.dart';
import 'package:easy_debounce/easy_throttle.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
@@ -337,14 +336,12 @@ abstract class ReplyController extends CommonController {
try {
List<Cookie> cookies = await Request.cookieManager.cookieJar
.loadForRequest(Uri.parse(HttpString.apiBaseUrl));
final List<String> cookieString = cookies
final String cookieString = cookies
.map((Cookie cookie) => '${cookie.name}=${cookie.value}')
.toList();
AndroidIntent intent = AndroidIntent(
package: 'icu.freedomIntrovert.biliSendCommAntifraud',
componentName:
'icu.freedomIntrovert.biliSendCommAntifraud.ByXposedLaunchedActivity',
arguments: {
.join(';');
Utils.channel.invokeMethod(
'biliSendCommAntifraud',
{
'action': 0,
'oid': oid,
'type': replyType,
@@ -356,10 +353,9 @@ abstract class ReplyController extends CommonController {
if (pictures.isNotEmpty == true) 'pictures': jsonEncode(pictures),
'source_id': sourceId,
'uid': mid,
'cookies': cookieString,
'cookies': [cookieString],
},
);
intent.launch();
} catch (e) {
debugPrint('biliSendCommAntifraud: $e');
}

View File

@@ -22,14 +22,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.7.0"
android_intent_plus:
dependency: "direct main"
description:
name: android_intent_plus
sha256: dfc1fd3a577205ae8f11e990fb4ece8c90cceabbee56fcf48e463ecf0bd6aae3
url: "https://pub.dev"
source: hosted
version: "5.3.0"
animations:
dependency: "direct main"
description:

View File

@@ -182,7 +182,6 @@ dependencies:
flex_seed_scheme: ^3.4.1
live_photo_maker: ^0.0.6
fl_chart: ^0.69.2
android_intent_plus: ^5.3.0
dependency_overrides:
screen_brightness: ^2.0.1