Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nining377/dolby_beta
Browse files Browse the repository at this point in the history
� Conflicts:
�	app/build.gradle
  • Loading branch information
nining377 committed Jul 10, 2022
2 parents 9a2a532 + de94355 commit 79d63d0
Show file tree
Hide file tree
Showing 27 changed files with 279 additions and 71 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*.aar
*.ap_
*.aab
release/
debug/

# Files for the ART/Dalvik VM
*.dex
Expand Down
6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- 模块被嵌入到网易云音乐的设置中
- 由于Android R对可执行文件的进一步限制,摒弃了2.X手动选择脚本与Node的方式
- 当前版本以稳定为主,杜比大喇叭β将能无缝适配最新版网易云音乐,如有问题请提交issue
- 因本人不使用太极,所以不保证太极等非root框架可以顺利运行,欢迎Fork适配
- 因本人不使用太极,所以不保证太极等非root框架可以顺利运行,如非必要请使用内嵌版本

*网易云在7.X版本后对非会员暗降了音质,由标准128K、较高192K、极高320K降低为标准96K、较高128K、极高256K,导致匹配逻辑出现问题,鉴于后续版本都在添加无用功能,推荐只听音乐的云村居民使用431或者600版本以获得最佳体验。*

Expand All @@ -28,13 +28,17 @@

[杜比大喇叭β版](https://wwi.lanzoui.com/b0cqxgwje) 访问密码:brdb

[网易云音乐模块内嵌版(无需安装模块,适合不想用太极等框架的非root用户)](https://github.com/nining377/dolby_beta/issues/142)
[网易云音乐模块内嵌版①](https://wwu.lanzouw.com/b0crkhyzg) 访问密码:3qvw

[网易云音乐模块内嵌版②](https://www.123pan.com/s/8qHrVv-hk1r) 访问密码:Wp2p

[网易云音乐模块内嵌版制作教程](https://github.com/nining377/dolby_beta/issues/142)

## TODO

- 尽可能保证不因模块造成crash(改版网易云往往经过二次混淆,将得不到适配)
- 部分美化功能的添加
- 更稳定的代理方式
- ~~部分美化功能的添加~~(已完成)
- ~~更稳定的代理方式~~(已完成)

## 主要功能

Expand All @@ -52,4 +56,4 @@

## 许可

The MIT License
The MIT License
86 changes: 85 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,85 @@
/build
# Built application files
*.apk
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
!/app/libnode/bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/

# Google Services (e.g. APIs or Firebase)
# google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# Version control
vcs.xml

# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.raincat.dolby_beta"
minSdkVersion 21
targetSdkVersion 29
versionCode 350
versionName "3.5.0"
versionCode 353
versionName "3.5.3"

ndk {
abiFilters "arm64-v8a"
Expand Down Expand Up @@ -54,10 +54,10 @@ dependencies {
//xposed库
compileOnly 'de.robv.android.xposed:api:82'
compileOnly 'de.robv.android.xposed:api:82:sources'
implementation 'com.annimon:stream:1.2.1'
implementation 'com.annimon:stream:1.2.2'
implementation 'org.smali:dexlib2:2.3.4'
implementation 'com.google.guava:guava:28.2-android'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.google.code.gson:gson:2.8.9'

implementation project(':hotxposed')
}
Binary file modified app/src/main/assets/UnblockNeteaseMusic.zip
Binary file not shown.
Binary file removed app/src/main/assets/node
Binary file not shown.
12 changes: 9 additions & 3 deletions app/src/main/java/com/raincat/dolby_beta/Hook.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.raincat.dolby_beta.hook.ProxyHook;
import com.raincat.dolby_beta.hook.SettingHook;
import com.raincat.dolby_beta.hook.UserProfileHook;
import com.raincat.dolby_beta.hook.ListentogetherHook;
import com.raincat.dolby_beta.utils.Tools;

import java.io.File;
Expand Down Expand Up @@ -85,12 +86,17 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
if (!SettingHelper.getInstance().getSetting(SettingHelper.master_key))
return;
//音源代理
new ProxyHook(context, versionCode, false);
new ProxyHook(context, false);
//黑胶
if (SettingHelper.getInstance().isEnable(SettingHelper.black_key)) {
new BlackHook(context, versionCode);
deleteAdAndTinker();
}
//一起听
if (SettingHelper.getInstance().isEnable(SettingHelper.listen_key)) {
new ListentogetherHook(context, versionCode);

}
//不变灰
new GrayHook(context);
//自动签到
Expand Down Expand Up @@ -155,7 +161,7 @@ public void onReceive(Context c, Intent intent) {
}, intentFilter);
} else if (processName.equals(PACKAGE_NAME + ":play") && SettingHelper.getInstance().getSetting(SettingHelper.master_key)) {
//音源代理
new ProxyHook(context, versionCode, true);
new ProxyHook(context, true);
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(msg_hook_play_process);
context.registerReceiver(new BroadcastReceiver() {
Expand All @@ -177,7 +183,7 @@ public void onReceive(Context c, Intent intent) {
//关闭tinker
Class<?> tinkerClass = XposedHelpers.findClassIfExists("com.tencent.tinker.loader.app.TinkerApplication", lpparam.classLoader);
if (tinkerClass != null)
XposedHelpers.findAndHookConstructor(tinkerClass, int.class, String.class, new XC_MethodHook() {
XposedBridge.hookAllConstructors(tinkerClass, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
super.beforeHookedMethod(param);
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/raincat/dolby_beta/Hooklite.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
if (!SettingHelper.getInstance().getSetting(SettingHelper.master_key))
return;
//音源代理
new ProxyHook(context, versionCode, false);
new ProxyHook(context, false);
//黑胶
if (SettingHelper.getInstance().isEnable(SettingHelper.black_key)) {
new BlackHook(context, versionCode);
Expand Down Expand Up @@ -134,7 +134,7 @@ public void onReceive(Context c, Intent intent) {
}, intentFilter);
} else if (processName.equals(PACKAGE_NAME + ":play") && SettingHelper.getInstance().getSetting(SettingHelper.master_key)) {
//音源代理
new ProxyHook(context, versionCode, true);
new ProxyHook(context, true);
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(msg_hook_play_process);
context.registerReceiver(new BroadcastReceiver() {
Expand Down
29 changes: 29 additions & 0 deletions app/src/main/java/com/raincat/dolby_beta/helper/EAPIHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
import com.google.gson.Gson;
import com.ndktools.javamd5.core.MD5;
import com.raincat.dolby_beta.model.CloudHeader;
import com.raincat.dolby_beta.model.NeteaseSongListBean;
import com.raincat.dolby_beta.net.Http;
import com.raincat.dolby_beta.utils.NeteaseAES2;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
import java.util.regex.Pattern;
Expand All @@ -23,6 +25,33 @@
*/

public class EAPIHelper {
private static final Gson gson = new Gson();

/**
* 解除下载加密
*/
public static String modifyPlayer(String original) {
NeteaseSongListBean listBean = gson.fromJson(original, NeteaseSongListBean.class);

NeteaseSongListBean modifyListBean = new NeteaseSongListBean();
modifyListBean.setCode(200);
modifyListBean.setData(new ArrayList<>());
for (NeteaseSongListBean.DataBean dataBean : listBean.getData()) {
//flag与8非0为云盘歌曲
if ((dataBean.getFlag() & 0x8) == 0) {

dataBean.setFee(0);
dataBean.setFlag(0);
dataBean.setPayed(0);
dataBean.setFreeTrialInfo(null);
if (dataBean.getUrl() != null && dataBean.getUrl().contains("?"))
dataBean.setUrl(dataBean.getUrl().substring(0, dataBean.getUrl().indexOf("?")));
}
modifyListBean.getData().add(dataBean);
}
return gson.toJson(modifyListBean);
}

/**
* 收藏
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
*/

public class ExtraHelper {
//脚本运行情况
//脚本运行情况,运行中1,未运行0
public static final String SCRIPT_STATUS = "script_status";
//脚本运行重试
public static final String SCRIPT_RETRY = "script_retry";
//APP版本号
public static final String APP_VERSION = "app_version";

Expand Down Expand Up @@ -47,13 +45,14 @@ public static void setExtraDate(String key, Object value) {
ExtraDao.getInstance().saveExtra(key, value.toString());
}


/**
* 清除当前用户的数据
*/
public static void cleanUserData() {
setExtraDate(COOKIE, "-1");
setExtraDate(USER_ID, "-1");
setExtraDate(LOVE_PLAY_LIST, "-1");
setExtraDate(SIGN_TIME, "-1");
setExtraDate(SIGN_SONG_TIME, "-1");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public class SettingHelper {
public static final String black_title = "本地黑胶";
public static final String black_sub = "去广告、鲸云音效、个性换肤等(自定义启动图等需要访问网易服务器的设置不可用)";

public static final String listen_key = "β_listen_key";
public static final String listen_title = "解锁一起听蒙面查看权限";
public static final String listen_sub = "开启后可直接查看对方信息,无需对方解除蒙面(暂时只支持8.6.0-8.7.80)";

public static final String fix_comment_key = "β_fix_comment_key";
public static final String fix_comment_title = "修复评论区加载失败";
public static final String fix_comment_sub = "如平时不看评论区或评论区无问题请勿打钩";
Expand Down Expand Up @@ -71,10 +75,6 @@ public class SettingHelper {
public static final String proxy_master_key = "β_proxy_master_key";
public static final String proxy_master_title = "代理开关";

public static final String proxy_compatibility_key = "β_proxy_compatibility_key";
public static final String proxy_compatibility_title = "兼容模式";
public static final String proxy_compatibility_sub = "当正常模式无法启动脚本时可以尝试使用兼容模式,该模式下对运存需求较高,Android 12和API29需要使用此模式";

public static final String proxy_server_key = "β_proxy_server_key";
public static final String proxy_server_title = "服务器代理模式";
public static final String proxy_server_sub = "如果您不想使用高占用的node,有自己的服务器代理可使用此方式并填写自己的服务器地址与端口,且使用服务器对应音质";
Expand All @@ -101,7 +101,7 @@ public class SettingHelper {

public static final String proxy_original_key = "β_proxy_original_key";
public static final String proxy_original_title = "代理源(空格隔开)";
public static final String proxy_original_default = "kuwo qq pyncmd kugou";
public static final String proxy_original_default = "kuwo pyncmd";

public static final String proxy_cover_key = "β_proxy_cover_key";
public static final String proxy_cover_title = "重新释放脚本";
Expand Down Expand Up @@ -168,13 +168,13 @@ public void refreshSetting(Context context) {
settingMap.put(dex_key, sharedPreferences.getBoolean(dex_key, true));
settingMap.put(warn_key, sharedPreferences.getBoolean(warn_key, true));
settingMap.put(black_key, sharedPreferences.getBoolean(black_key, true));
settingMap.put(listen_key, sharedPreferences.getBoolean(listen_key, false));
settingMap.put(fix_comment_key, sharedPreferences.getBoolean(fix_comment_key, false));
settingMap.put(update_key, sharedPreferences.getBoolean(update_key, true));
settingMap.put(sign_key, sharedPreferences.getBoolean(sign_key, true));
settingMap.put(sign_song_key, sharedPreferences.getBoolean(sign_song_key, false));

settingMap.put(proxy_master_key, sharedPreferences.getBoolean(proxy_master_key, true));
settingMap.put(proxy_compatibility_key, sharedPreferences.getBoolean(proxy_compatibility_key, true));
settingMap.put(proxy_server_key, sharedPreferences.getBoolean(proxy_server_key, false));
settingMap.put(proxy_priority_key, sharedPreferences.getBoolean(proxy_priority_key, false));
settingMap.put(proxy_flac_key, sharedPreferences.getBoolean(proxy_flac_key, false));
Expand Down Expand Up @@ -268,8 +268,7 @@ public void setHttpProxy(String http) {
sharedPreferences.edit().putString(SettingHelper.http_proxy_key, http).apply();
}

public String gethttpProxy() {
public String getHttpProxy() {
return sharedPreferences.getString(SettingHelper.http_proxy_key, SettingHelper.http_proxy_default);

}
}
1 change: 1 addition & 0 deletions app/src/main/java/com/raincat/dolby_beta/hook/CdnHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;

/**
* <pre>
Expand Down
Loading

0 comments on commit 79d63d0

Please sign in to comment.