Skip to content

Commit 6869b47

Browse files
committed
修复:
1.修复高版本优先显示最热失效 2.把bean里的id更改为long类型,但没办法修复600部分评论加载失败 3.减少对返回数据解析的依赖,更改为hook具体类,更加稳定 美化: 1.可选隐藏播放页K歌图标 2.可选隐藏播放页中间大黑胶 3.可选播放页专辑图片停转
1 parent abeb04a commit 6869b47

16 files changed

Lines changed: 334 additions & 55 deletions

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
applicationId "com.raincat.dolby_beta"
99
minSdkVersion 21
1010
targetSdkVersion 29
11-
versionCode 336
12-
versionName "3.3.6"
11+
versionCode 337
12+
versionName "3.3.7"
1313

1414
externalNativeBuild {
1515
cmake {

app/src/main/java/com/raincat/dolby_beta/Hook.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.raincat.dolby_beta.hook.HideTabHook;
2727
import com.raincat.dolby_beta.hook.InternalDialogHook;
2828
import com.raincat.dolby_beta.hook.MagiskFixHook;
29+
import com.raincat.dolby_beta.hook.PlayerActivityHook;
2930
import com.raincat.dolby_beta.hook.ProxyHook;
3031
import com.raincat.dolby_beta.hook.SettingHook;
3132
import com.raincat.dolby_beta.hook.UserProfileHook;
@@ -113,6 +114,8 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
113114
new HideBannerHook(context, versionCode);
114115
//隐藏小红点
115116
new HideBubbleHook(context);
117+
//黑胶停转,隐藏K歌按钮
118+
new PlayerActivityHook(context);
116119
//打开评论后优先显示最热评论
117120
new CommentHotClickHook(context);
118121
new CdnHook(context, versionCode);

app/src/main/java/com/raincat/dolby_beta/Hooklite.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.raincat.dolby_beta.hook.HideTabHook;
2727
import com.raincat.dolby_beta.hook.InternalDialogHook;
2828
import com.raincat.dolby_beta.hook.MagiskFixHook;
29+
import com.raincat.dolby_beta.hook.PlayerActivityHook;
2930
import com.raincat.dolby_beta.hook.ProxyHook;
3031
import com.raincat.dolby_beta.hook.SettingHook;
3132
import com.raincat.dolby_beta.hook.UserProfileHook;
@@ -105,6 +106,8 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
105106
new HideBubbleHook(context);
106107
//打开评论后优先显示最热评论
107108
new CommentHotClickHook(context);
109+
//黑胶停转,隐藏K歌按钮
110+
new PlayerActivityHook(context);
108111
new CdnHook(context, versionCode);
109112

110113
mainProcessInit = true;

app/src/main/java/com/raincat/dolby_beta/db/CloudDao.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import android.database.Cursor;
66
import android.database.sqlite.SQLiteDatabase;
77

8-
98
/**
109
* <pre>
1110
* author : RainCat
@@ -35,7 +34,7 @@ public static synchronized CloudDao getInstance(Context context) {
3534
}
3635

3736
/**
38-
* 保存歌曲
37+
* 保存歌曲记录
3938
*/
4039
public void saveSong(int id, String value) {
4140
SQLiteDatabase db = dbHelper.getWritableDatabase();
@@ -49,7 +48,7 @@ public void saveSong(int id, String value) {
4948
}
5049

5150
/**
52-
* 获取某个歌曲
51+
* 获取某个歌曲记录
5352
*/
5453
public String getSong(int id) {
5554
String song = "";
@@ -59,7 +58,6 @@ public String getSong(int id) {
5958
if (cursor.moveToNext()) {
6059
song = cursor.getString(cursor.getColumnIndex(SONG_VALUE));
6160
}
62-
6361
deleteSong(id);
6462
cursor.close();
6563
}
@@ -68,7 +66,7 @@ public String getSong(int id) {
6866
}
6967

7068
/**
71-
* 删除一个人的某条歌曲
69+
* 删除一个人的某条歌曲记录
7270
*/
7371
private void deleteSong(int id) {
7472
SQLiteDatabase db = dbHelper.getWritableDatabase();
@@ -79,7 +77,7 @@ private void deleteSong(int id) {
7977
}
8078

8179
/**
82-
* 删除所有歌曲
80+
* 删除所有歌曲记录
8381
*/
8482
public void deleteAllSong() {
8583
SQLiteDatabase db = dbHelper.getWritableDatabase();

app/src/main/java/com/raincat/dolby_beta/helper/ClassHelper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
* version: 1.0
4747
* </pre>
4848
*/
49-
5049
public class ClassHelper {
5150
//类加载器
5251
private static ClassLoader classLoader = null;
@@ -358,7 +357,7 @@ public static Class<?> getClazz(Context context) {
358357
public static class CommentDataClass {
359358
private static Class<?> clazz;
360359

361-
public static Class<?> getClazz(Context context) {
360+
public static Class<?> getClazz() {
362361
if (clazz == null) {
363362
try {
364363
Pattern pattern = Pattern.compile("^com\\.netease\\.cloudmusic\\.module\\.comment2\\.[a-z]\\.[a-z]$");

app/src/main/java/com/raincat/dolby_beta/helper/ExtraHelper.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
*/
1717

1818
public class ExtraHelper {
19+
//脚本运行情况
20+
public static final String SCRIPT_STATUS = "script_status";
21+
//脚本运行重试
22+
public static final String SCRIPT_RETRY = "script_retry";
23+
//APP版本号
24+
public static final String APP_VERSION = "app_version";
25+
1926
//用户id
2027
public static final String USER_ID = "user_id";
2128
//cookie
@@ -26,12 +33,6 @@ public class ExtraHelper {
2633
public static final String SIGN_TIME = "sign_time";
2734
//打卡时间
2835
public static final String SIGN_SONG_TIME = "sign_song_time";
29-
//脚本运行情况
30-
public static final String SCRIPT_STATUS = "script_status";
31-
//脚本运行重试
32-
public static final String SCRIPT_RETRY = "script_retry";
33-
//APP版本号
34-
public static final String APP_VERSION = "app_version";
3536

3637
//初始化数据库
3738
public static void init(Context context) {

app/src/main/java/com/raincat/dolby_beta/helper/MessageHelper.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@ public static void sendNotification(Context context, int code) {
2020
if (!SettingHelper.getInstance().isEnable(SettingHelper.warn_key))
2121
return;
2222
Intent intent = new Intent(Hook.msg_send_notification);
23-
intent.putExtra("code", cookieClassNotFoundCode);
23+
intent.putExtra("title", "错误");
2424
switch (code) {
2525
case cookieClassNotFoundCode:
26-
intent.putExtra("title", "错误");
26+
intent.putExtra("code", cookieClassNotFoundCode);
2727
intent.putExtra("message", cookieClassNotFoundMessage);
2828
break;
2929
case transferClassNotFoundCode:
30-
intent.putExtra("title", "错误");
30+
intent.putExtra("code", transferClassNotFoundCode);
3131
intent.putExtra("message", transferClassNotFoundMessage);
3232
break;
3333
case coreClassNotFoundCode:
34-
intent.putExtra("title", "错误");
34+
intent.putExtra("code", coreClassNotFoundCode);
3535
intent.putExtra("message", coreClassNotFoundMessage);
3636
break;
3737
case tabClassNotFoundCode:
38-
intent.putExtra("title", "错误");
38+
intent.putExtra("code", tabClassNotFoundCode);
3939
intent.putExtra("message", tabClassNotFoundMessage);
4040
break;
4141
case sidebarClassNotFoundCode:
42-
intent.putExtra("title", "错误");
42+
intent.putExtra("code", sidebarClassNotFoundCode);
4343
intent.putExtra("message", sidebarClassNotFoundMessage);
4444
break;
4545
}

app/src/main/java/com/raincat/dolby_beta/helper/SettingHelper.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ public class SettingHelper {
104104
public static final String beauty_banner_hide_key = "β_beauty_banner_hide_key";
105105
public static final String beauty_banner_hide_title = "移除发现页与歌单广场Banner";
106106

107+
public static final String beauty_ksong_hide_key = "β_beauty_ksong_key";
108+
public static final String beauty_ksong_hide_title = "移除播放页K歌图标";
109+
110+
public static final String beauty_black_hide_key = "β_beauty_black_key";
111+
public static final String beauty_black_hide_title = "播放页专辑图片外面的黑胶隐藏";
112+
113+
public static final String beauty_rotation_key = "β_beauty_rotation_key";
114+
public static final String beauty_rotation_title = "播放页专辑图片停止转动";
115+
107116
public static final String beauty_comment_hot_key = "β_beauty_comment_hot_key";
108117
public static final String beauty_comment_hot_title = "评论区优先显示“最热”内容";
109118

@@ -151,6 +160,9 @@ public void refreshSetting(Context context) {
151160
settingMap.put(beauty_tab_hide_key, sharedPreferences.getBoolean(beauty_tab_hide_key, false));
152161
settingMap.put(beauty_bubble_hide_key, sharedPreferences.getBoolean(beauty_bubble_hide_key, false));
153162
settingMap.put(beauty_banner_hide_key, sharedPreferences.getBoolean(beauty_banner_hide_key, false));
163+
settingMap.put(beauty_ksong_hide_key, sharedPreferences.getBoolean(beauty_ksong_hide_key, false));
164+
settingMap.put(beauty_rotation_key, sharedPreferences.getBoolean(beauty_rotation_key, false));
165+
settingMap.put(beauty_black_hide_key, sharedPreferences.getBoolean(beauty_black_hide_key, false));
154166
settingMap.put(beauty_comment_hot_key, sharedPreferences.getBoolean(beauty_comment_hot_key, false));
155167
}
156168

app/src/main/java/com/raincat/dolby_beta/hook/CommentHotClickHook.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class CommentHotClickHook {
2727
public CommentHotClickHook(Context context) {
2828
if (!SettingHelper.getInstance().isEnable(SettingHelper.beauty_comment_hot_key))
2929
return;
30-
Class<?> commentDataClass = ClassHelper.CommentDataClass.getClazz(context);
30+
Class<?> commentDataClass = ClassHelper.CommentDataClass.getClazz();
3131
if (commentDataClass != null) {
3232
XposedBridge.hookAllConstructors(commentDataClass, new XC_MethodHook() {
3333
@Override

app/src/main/java/com/raincat/dolby_beta/hook/EAPIHook.java

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.raincat.dolby_beta.helper.EAPIHelper;
1313
import com.raincat.dolby_beta.helper.SettingHelper;
1414

15+
import org.json.JSONArray;
1516
import org.json.JSONObject;
1617

1718

@@ -63,16 +64,23 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
6364
} else if (path.contains("batch")) {
6465
if (original.contains("comment\\/banner\\/get")) {
6566
JSONObject jsonObject = new JSONObject(original);
66-
jsonObject.put("/api/content/exposure/comment/banner/get", "{\"code\":200}");
67+
if (!jsonObject.isNull("/api/content/exposure/comment/banner/get")) {
68+
JSONObject object = new JSONObject();
69+
object.put("code", 200);
70+
object.put("data", new JSONObject());
71+
jsonObject.put("/api/content/exposure/comment/banner/get", object);
72+
}
73+
if (!jsonObject.isNull("/api/v1/content/exposure/comment/banner/get")) {
74+
JSONObject object = jsonObject.getJSONObject("/api/v1/content/exposure/comment/banner/get");
75+
JSONObject data = object.getJSONObject("data");
76+
data.put("count", 0);
77+
data.put("offset", 999999999);
78+
data.put("records", new JSONArray());
79+
data.put("message", "");
80+
object.put("data", data);
81+
jsonObject.put("/api/v1/content/exposure/comment/banner/get", object);
82+
}
6783
original = jsonObject.toString();
68-
original = original.replace("\"{\\\"code\\\":200}\"", "{\"code\":200}");
69-
}
70-
if (original.contains("\\/api\\/v1\\/content\\/exposure\\/comment\\/banner\\/get")) {
71-
JSONObject jsonObject = new JSONObject(original);
72-
jsonObject.put("/api/v1/content/exposure/comment/banner/get", "{-\"code-\":200,-\"data-\":{-\"count-\":0,-\"offset-\":999999999,-\"records-\":[]},-\"message-\":-\"-\"}");
73-
original = jsonObject.toString();
74-
original = original.replace("-\\", "").replace("\"\\/api\\/v1\\/content\\/exposure\\/comment\\/banner\\/get\":\"", "\"\\/api\\/v1\\/content\\/exposure\\/comment\\/banner\\/get\":")
75-
.replace("\"message\":\"\"}\"", "\"message\":\"\"}");
7684
}
7785
} else if (path.contains("upload/cloud/info/v2")) {
7886
JSONObject jsonObject = new JSONObject(original);

0 commit comments

Comments
 (0)