Skip to content

Commit

Permalink
v9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
qidian55 committed May 5, 2024
1 parent 1bad89d commit eee7788
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ bv4/

mybv/build/
mybv/dist/
mybv/java/out.dex
*.class

diff*.txt
Expand Down
4 changes: 2 additions & 2 deletions mybv/java/classes/mybl/DanmakuClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void onClose(int arg0, String arg1, boolean arg2) {}
public void onError(Exception arg0) {}

@Override
public void onMessage(ByteBuffer arg0) { DanmakuClient.parse(arg0.array()); }
public void onMessage(ByteBuffer arg0) { if(DanmakuClient.player!=null)DanmakuClient.parse(arg0.array()); }

@Override
public void onMessage(String arg0) {}
Expand Down Expand Up @@ -162,7 +162,7 @@ public static void parse(byte[] data) {
if (version == 2) {
parse(decompress_zlib(result));
}
if (version == 0) {
if (version == 0 && operation != 3) {
JSONObject info = new JSONObject(new String(result));
if(!info.optString("cmd").equals("DANMU_MSG"))continue;
JSONObject extra = new JSONObject(info.optJSONArray("info").getJSONArray(0).getJSONObject(15).optString("extra"));
Expand Down
Binary file removed mybv/java/out.dex
Binary file not shown.
42 changes: 24 additions & 18 deletions mybv/smali/mybl/DanmakuClient.smali
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@

move-result v4

if-lez v4, :cond_1fa
if-lez v4, :cond_1fe

.line 155
invoke-virtual {v7}, Ljava/io/DataInputStream;->readInt()I
Expand All @@ -268,6 +268,8 @@
.line 158
invoke-virtual {v7}, Ljava/io/DataInputStream;->readInt()I

move-result v8

.line 159
invoke-virtual {v7}, Ljava/io/DataInputStream;->readInt()I

Expand All @@ -282,7 +284,7 @@
.line 162
const/4 v5, 0x2

if-ne v6, v5, :cond_34
if-ne v6, v5, :cond_35

.line 163
invoke-static {v4}, Lmybl/DanmakuClient;->decompress_zlib([B)[B
Expand All @@ -292,9 +294,13 @@
invoke-static {v5}, Lmybl/DanmakuClient;->parse([B)V

.line 165
:cond_34
:cond_35
if-nez v6, :cond_c

const/4 v5, 0x3

if-eq v8, v5, :cond_c

.line 166
new-instance v8, Lorg/json/JSONObject;

Expand Down Expand Up @@ -363,10 +369,10 @@
move-result v6

.line 171
if-nez v6, :cond_78
if-nez v6, :cond_7c

.line 172
:cond_78
:cond_7c
const-string v6, "dm_type"

invoke-virtual {v4, v6}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I
Expand Down Expand Up @@ -481,20 +487,20 @@
invoke-virtual {v14, v4, v5, v6, v15}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V

.line 183
if-eqz v11, :cond_18c
if-eqz v11, :cond_190

.line 184
invoke-virtual {v11}, Lorg/json/JSONObject;->keys()Ljava/util/Iterator;

move-result-object v15

.line 185
:cond_e8
:cond_ec
invoke-interface {v15}, Ljava/util/Iterator;->hasNext()Z

move-result v4

if-eqz v4, :cond_18c
if-eqz v4, :cond_190

.line 186
invoke-interface {v15}, Ljava/util/Iterator;->next()Ljava/lang/Object;
Expand Down Expand Up @@ -615,10 +621,10 @@
.line 192
const/4 v5, 0x0

:goto_157
:goto_15b
move/from16 v0, v16

if-ge v5, v0, :cond_e8
if-ge v5, v0, :cond_ec

.line 193
new-instance v18, Landroid/text/style/ImageSpan;
Expand Down Expand Up @@ -669,13 +675,13 @@
.line 192
add-int/lit8 v5, v5, 0x1

goto :goto_157
goto :goto_15b

.line 198
:cond_18c
:cond_190
const/4 v4, 0x1

if-ne v9, v4, :cond_1e8
if-ne v9, v4, :cond_1ec

.line 199
new-instance v4, Ljava/net/URL;
Expand Down Expand Up @@ -784,7 +790,7 @@
invoke-virtual {v14, v5, v4, v6, v8}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V

.line 204
:cond_1e8
:cond_1ec
iput-object v14, v13, Ltv/danmaku/videoplayer/core/danmaku/comment/DrawableItem;->mSpannableString:Landroid/text/SpannableStringBuilder;

.line 205
Expand All @@ -796,20 +802,20 @@
const-wide/16 v4, 0x64

invoke-static {v4, v5}, Ljava/lang/Thread;->sleep(J)V
:try_end_1f4
.catch Ljava/lang/Exception; {:try_start_c .. :try_end_1f4} :catch_1f6
:try_end_1f8
.catch Ljava/lang/Exception; {:try_start_c .. :try_end_1f8} :catch_1fa

goto/16 :goto_c

.line 210
:catch_1f6
:catch_1fa
move-exception v4

.line 211
invoke-virtual {v4}, Ljava/lang/Exception;->printStackTrace()V

.line 214
:cond_1fa
:cond_1fe
return-void
.end method

Expand Down
5 changes: 5 additions & 0 deletions mybv/smali/mybl/DanmakuWebSocketClient.smali
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,17 @@

.prologue
.line 47
sget-object v0, Lmybl/DanmakuClient;->player:Ltv/danmaku/videoplayer/core/danmaku/IDanmakuPlayer;

if-eqz v0, :cond_b

invoke-virtual {p1}, Ljava/nio/ByteBuffer;->array()[B

move-result-object v0

invoke-static {v0}, Lmybl/DanmakuClient;->parse([B)V

:cond_b
return-void
.end method

Expand Down

0 comments on commit eee7788

Please sign in to comment.