From f887666ce3b047d70b3689be04a90f6c9596c03d Mon Sep 17 00:00:00 2001
From: cshenfu <men883234@gmail.com>
Date: 星期二, 10 十二月 2024 15:15:43 +0800
Subject: [PATCH] 区分小红书cookie

---
 app/src/main/java/com/shsening/autouploadvideos/action/ActionRedbook.kt |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/app/src/main/java/com/shsening/autouploadvideos/action/ActionRedbook.kt b/app/src/main/java/com/shsening/autouploadvideos/action/ActionRedbook.kt
index 5c11e4f..7c51459 100644
--- a/app/src/main/java/com/shsening/autouploadvideos/action/ActionRedbook.kt
+++ b/app/src/main/java/com/shsening/autouploadvideos/action/ActionRedbook.kt
@@ -1,4 +1,4 @@
-package com.shsening.autouploadvideos
+package com.shsening.autouploadvideos.action
 
 
 import android.app.Instrumentation
@@ -8,6 +8,8 @@
 import android.os.Bundle
 import android.os.Looper
 import androidx.appcompat.app.AppCompatActivity
+import com.shsening.autouploadvideos.UploadSessionActivity
+import com.shsening.autouploadvideos.WebviewUtils
 import com.shsening.autouploadvideos.action.PlatformActionInterface
 import com.shsening.autouploadvideos.utils.Utils
 
@@ -33,14 +35,6 @@
     private fun updatePostDescription(){
         WebviewUtils.addValueToInput(webView,"#publish-container > div > div.body > div.content > div.input.titleInput > div.d-input-wrapper.d-inline-block.c-input_inner > div > input",videoInfo.title)
         WebviewUtils.addValueToDiv(webView,"#quillEditor > div > p",videoInfo.description)
-        WebviewUtils.simpleElementClick(webView,"#topicBtn")
-        SystemClock.sleep(500)
-        WebviewUtils.simpleElementClick(webView,"#quill-mention-item-0")
-        WebviewUtils.simpleElementClick(webView,"#topicBtn")
-        SystemClock.sleep(500)
-        WebviewUtils.simpleElementClick(webView,"#quill-mention-item-1")
-
-//        WebviewUtils.simpleElementClick(webView,"#el-id-3410-26 > label:nth-child(1)")
         WebviewUtils.simpleElementClick(webView,"html > body > div:nth-of-type(1) > div > div:nth-of-type(2) > div > div:nth-of-type(2) > main > div:nth-of-type(3) > div > div > div:nth-of-type(1) > div > div > div > div:nth-of-type(2) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(10) > div > div:nth-of-type(5) > div:nth-of-type(2) > label:nth-of-type(2)")
         addValueToDatePickerInput(true,"html > body > div:nth-of-type(1) > div > div:nth-of-type(2) > div > div:nth-of-type(2) > main > div:nth-of-type(3) > div > div > div:nth-of-type(1) > div > div > div > div:nth-of-type(2) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(10) > div > div:nth-of-type(5) > div:nth-of-type(2) > div > div:nth-of-type(1) > div",videoInfo.datetime)
         // 鍦ㄤ富绾跨▼涓缃欢杩熸墽琛�
@@ -75,9 +69,12 @@
             webView.evaluateJavascript(jsCode_CheckVideoUploadFinished) { result ->
                 if (result == "true") {
                     // 绛夊緟瑙嗛妫�娴嬪拰鐢熸垚灏侀潰
+//                    WebviewUtils.simpleElementClick(webView,"#web > div > div > div > div.upload-content > div.upload-wrapper > div > input")
+                    println("33333333333333333333333333333333333333")
                     threadHandler.postDelayed({updatePostDescription()},3000)
 
                 } else {
+                    println("11111111111111111111111")
                     // 鍏冪礌涓嶅瓨鍦紝1绉掑悗鍐嶆妫�鏌�
                     webView.postDelayed({
                         checkVideoUploadFinished()
@@ -86,7 +83,6 @@
             }
         }, 1000) // 姣忕妫�鏌ヤ竴娆�
     }
-
     private fun checkVideoPublishFinished(){
         webView.postDelayed({
             webView.evaluateJavascript(jsCode_PublishVideo_Finished) { result ->
@@ -152,11 +148,9 @@
         val displayMetrics = activity.resources.displayMetrics
         val width = displayMetrics.widthPixels
         val height = displayMetrics.heightPixels
-
         val startX = width.toFloat() * 0.9f // 浠庡彸渚ф粦鍔�
         val endX = width.toFloat() * 0.1f // 婊戝姩鍒板乏渚�
         val y = height / 3f // Y 鍧愭爣鍦ㄥ睆骞曚腑闂�
-
         Thread {
             Utils.instrumentationSwipe(instrumentation, startX, y, endX, y)
             SystemClock.sleep(500)
@@ -164,6 +158,7 @@
             SystemClock.sleep(500)
             Utils.instrumentationClick(instrumentation, width / 2f, height * 2 / 4f)
             // back to main thread
+
             threadHandler.post {
                 checkVideoUploadFinished()
             }

--
Gitblit v1.9.1