-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2、新增Hook失败推送 3、优化黑胶hook逻辑,不再所有人都显示黑胶
- Loading branch information
Showing
15 changed files
with
300 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
299 changes: 157 additions & 142 deletions
299
app/src/main/java/com/raincat/dolby_beta/helper/ClassHelper.java
Large diffs are not rendered by default.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
app/src/main/java/com/raincat/dolby_beta/helper/MessageHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.raincat.dolby_beta.helper; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
|
||
import com.raincat.dolby_beta.Hook; | ||
|
||
/** | ||
* <pre> | ||
* author : RainCat | ||
* e-mail : nining377@gmail.com | ||
* time : 2021/10/25 | ||
* desc : 通知帮助类 | ||
* version: 1.0 | ||
* </pre> | ||
*/ | ||
|
||
public class MessageHelper { | ||
public static void sendNotification(Context context, int code) { | ||
if (!SettingHelper.getInstance().getSetting(SettingHelper.warn_key)) | ||
return; | ||
Intent intent = new Intent(Hook.msg_send_notification); | ||
intent.putExtra("code", cookieClassNotFoundCode); | ||
switch (code) { | ||
case cookieClassNotFoundCode: | ||
intent.putExtra("title", "错误"); | ||
intent.putExtra("message", cookieClassNotFoundMessage); | ||
break; | ||
case transferClassNotFoundCode: | ||
intent.putExtra("title", "错误"); | ||
intent.putExtra("message", transferClassNotFoundMessage); | ||
break; | ||
case coreClassNotFoundCode: | ||
intent.putExtra("title", "错误"); | ||
intent.putExtra("message", coreClassNotFoundMessage); | ||
break; | ||
case tabClassNotFoundCode: | ||
intent.putExtra("title", "错误"); | ||
intent.putExtra("message", tabClassNotFoundMessage); | ||
break; | ||
case sidebarClassNotFoundCode: | ||
intent.putExtra("title", "错误"); | ||
intent.putExtra("message", sidebarClassNotFoundMessage); | ||
break; | ||
} | ||
context.sendBroadcast(intent); | ||
} | ||
|
||
private final static String normalMessage = "请确保已使用官方版网易云。"; | ||
|
||
public final static int cookieClassNotFoundCode = 1000; | ||
private final static String cookieClassNotFoundMessage = "找不到Cookie类,这将导致签到、打卡、收藏等功能失效," + normalMessage; | ||
|
||
public final static int transferClassNotFoundCode = 1001; | ||
private final static String transferClassNotFoundMessage = "找不到DownloadTransfer类,这将导致下载校验功能失效," + normalMessage; | ||
|
||
public final static int coreClassNotFoundCode = 1002; | ||
private final static String coreClassNotFoundMessage = "找不到核心类,这将导致音源代理功能失效," + normalMessage; | ||
|
||
public final static int tabClassNotFoundCode = 1003; | ||
private final static String tabClassNotFoundMessage = "找不到Tab类,这将导致Tab精简功能失效," + normalMessage; | ||
|
||
public final static int sidebarClassNotFoundCode = 1004; | ||
private final static String sidebarClassNotFoundMessage = "找不到Sidebar类,这将导致侧边栏精简功能失效," + normalMessage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
app/src/main/java/com/raincat/dolby_beta/view/setting/WarnView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.raincat.dolby_beta.view.setting; | ||
|
||
import android.content.Context; | ||
import android.util.AttributeSet; | ||
|
||
import com.raincat.dolby_beta.helper.SettingHelper; | ||
import com.raincat.dolby_beta.view.BaseDialogItem; | ||
|
||
/** | ||
* <pre> | ||
* author : RainCat | ||
* e-mail : nining377@gmail.com | ||
* time : 2021/10/26 | ||
* desc : 通知栏警告 | ||
* version: 1.0 | ||
* </pre> | ||
*/ | ||
|
||
public class WarnView extends BaseDialogItem { | ||
public WarnView(Context context, AttributeSet attrs, int defStyle) { | ||
super(context, attrs, defStyle); | ||
} | ||
|
||
public WarnView(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
} | ||
|
||
public WarnView(Context context) { | ||
super(context); | ||
} | ||
|
||
@Override | ||
public void init(Context context, AttributeSet attrs) { | ||
super.init(context, attrs); | ||
title = SettingHelper.warn_title; | ||
sub = SettingHelper.warn_sub; | ||
key = SettingHelper.warn_key; | ||
setData(true, SettingHelper.getInstance().getSetting(key)); | ||
|
||
setOnClickListener(view -> { | ||
SettingHelper.getInstance().setSetting(key, !checkBox.isChecked()); | ||
sendBroadcast(SettingHelper.refresh_setting); | ||
}); | ||
} | ||
} |