Skip to content

Commit

Permalink
v3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Moriafly committed Apr 2, 2021
1 parent 3b4086d commit 6c8a0bc
Show file tree
Hide file tree
Showing 23 changed files with 101 additions and 108 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
.externalNativeBuild
.cxx

app/src/main/java/com/dirror/music/ui/activity/Ignore.kt
app/src/main/java/com/dirror/music/widget/lyricBackground/LyricsBackgroundView.java
app/libs/
app/src/main/res/drawable-v24/

app/src/main/cpp/cry.c
"app/release/\346\265\201\345\205\211\346\233\262.apk"
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ GNU 通用公共许可协议 [GNU GENERAL PUBLIC LICENSE Version 3](http://www.g

详见 [LICENSE](https://github.com/Moriafly/dirror-music/blob/master/LICENSE)

# 应用下载

https://github.com/Moriafly/DsoMusic/releases

# 音源

网易云音乐来源(但不限于):https://github.com/Binaryify/NeteaseCloudMusicApi
Expand Down Expand Up @@ -69,10 +65,10 @@ https://blog.csdn.net/Moriafly/article/details/109708728
- [x] 新歌速递
- [x] 热搜列表(详细)
- [x] 通知 - 私信
- [x] 喜欢音乐
- [ ] 喜欢音乐(3.0 移除)
- [x] 默认搜索关键词
- [x] banner
- [x] 手机登录
- [ ] 手机登录(3.0 移除)
- [x] 发送/删除评论
- [x] 获取用户信息
- [x] 搜索
Expand Down
20 changes: 3 additions & 17 deletions UPDATE.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
流光曲 版本
3.0.0(包含空里流霜不觉飞、流光曲版本)

####

流光效果
切换歌曲封面有了渐变动画,更加自然

####

加载图片动画优化
移除 Glide
移除手机号登录、云盘、每日推荐
界面改动

####

空里流霜不觉飞 版本

####
支持本地歌曲和歌单中搜索歌曲
播放界面长按封面可以查看大图

####
界面优化
动画优化,提升交互体验
移除一些不必要按钮

####
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ android {
applicationId "com.dirror.music"
minSdkVersion 21
targetSdkVersion 30
versionCode 701
versionName "流光曲"
versionCode 705
versionName "3.0.0"

multiDexEnabled true

Expand Down Expand Up @@ -113,7 +113,7 @@ dependencies {
kapt 'androidx.room:room-compiler:2.2.5'
// LyricViewX
implementation 'com.github.Moriafly:LyricViewX:1.1.6'
implementation 'com.github.Moriafly:DsoKotlinExtensions:1.0.0-dev03'
implementation 'com.github.Moriafly:DsoKotlinExtensions:1.0.0-dev04'
// 漂亮的开关
implementation 'com.bitvale:switcher:1.1.1'
// coil 图片加载库
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 700,
"versionName": "濠电偟绻濈粈渚�宕㈠鍏犲湱锟斤綆鍘惧Σ锟�",
"versionCode": 705,
"versionName": "3.0.0",
"outputFile": "app-release.apk"
}
]
Expand Down
Binary file removed app/release/空里流霜不觉飞.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<activity android:name=".ui.activity.LoginByPhoneActivity" />
<activity
android:name=".ui.home.MainActivity"
android:exported="true"
android:exported="false"
android:launchMode="singleTask"
android:theme="@style/AppTheme.FullScreen" />
<activity
Expand Down
15 changes: 14 additions & 1 deletion app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,17 @@ target_link_libraries( # Specifies the target library.

# Links the target library to the log library
# included in the NDK.
${log-dso} )
${log-dso} )

add_library(
cry
SHARED
cry.c)

find_library(
log-cry
log )

target_link_libraries(
cry
${log-cry} )
38 changes: 0 additions & 38 deletions app/src/main/cpp/dso.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,4 @@ Java_com_dirror_music_util_sky_SkySecure_getAppNameMd5(JNIEnv *env, jobject thiz
return (*env)->NewStringUTF(env, "9884b247104cbdb489aeeaca91f49584");
}

/**
* Xposed 监测
* 存在返回 true
*/
JNIEXPORT jboolean JNICALL
Java_com_dirror_music_util_sky_SkySecure_checkXposed(JNIEnv *env, jobject thiz) {
// 找到 ClassLoader 类
jclass classloaderClass = (*env)->FindClass(env, "java/lang/ClassLoader");
// 找到 ClassLoader 类中的静态方法 getSystemClassLoader
jmethodID getSysLoaderMethod = (*env)->GetStaticMethodID(env, classloaderClass, "getSystemClassLoader",
"()Ljava/lang/ClassLoader;");
// 调用 ClassLoader中 的 getSystemClassLoader 方法,返回 ClassLoader对象
jobject classLoader = (*env)->CallStaticObjectMethod(env, classloaderClass, getSysLoaderMethod);
// DexClassLoader:能够加载自定义的 jar/apk/dex
// PathClassLoader:只能加载系统中已经安装过的 apk
jclass dexLoaderClass = (*env)->FindClass(env, "dalvik/system/DexClassLoader");
// 找到 ClassLoader中的方法 loadClass
jmethodID loadClass = (*env)->GetMethodID(env, dexLoaderClass, "loadClass",
"(Ljava/lang/String;)Ljava/lang/Class;");
// 调用 DexClassLoader 的 loadClass 方法,加载需要调用的类
jstring dir = (*env)->NewStringUTF(env, "de.robv.android.xposed.XposedBridge");
jclass targetClass = (jclass) (*env)->CallObjectMethod(env, classLoader, loadClass, dir);

if ((*env)->ExceptionCheck(env)) { // 检查 JNI 调用是否有引发异常
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env); // 清除引发的异常,在 Java 层不会打印异常的堆栈信息
return false;
}

if (targetClass != NULL) {
jfieldID disableHooksFiled = (*env)->GetStaticFieldID(env, targetClass, "disableHooks", "Z");
(*env)->SetStaticBooleanField(env, targetClass, disableHooksFiled, true);
jfieldID runtimeFiled = (*env)->GetStaticFieldID(env, targetClass, "runtime", "I");
(*env)->SetStaticIntField(env, targetClass, runtimeFiled, 2);
return true;
} else {
return false;
}
}
2 changes: 1 addition & 1 deletion app/src/main/java/com/dirror/music/MyApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import com.tencent.mmkv.MMKV
import com.umeng.analytics.MobclickAgent
import com.umeng.commonsdk.UMConfigure


/**
* 自定义 Application
* @author Moriafly
Expand All @@ -31,6 +30,7 @@ class MyApplication : Application() {
// 加载本地库
init {
System.loadLibrary("dso")
System.loadLibrary("cry")
}

lateinit var config: Config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,43 @@ import com.dirror.music.databinding.ActivityAgreementBinding
import com.dirror.music.manager.ActivityCollector
import com.dirror.music.ui.base.BaseActivity
import com.dirror.music.ui.home.MainActivity
import com.dirror.music.util.Config
import com.dirror.music.util.Secure
import com.dirror.music.util.*
import com.dirror.music.util.sky.SkySecure
import java.util.*

/**
* 忽略上传
*/
class AgreementActivity : BaseActivity() {

private lateinit var binding: ActivityAgreementBinding

private val calendar = Calendar.getInstance()
private val year = calendar.get(Calendar.YEAR)
private val month = calendar[Calendar.MONTH] + 1
private val day = calendar[Calendar.DAY_OF_MONTH]
private val trueKey = SkySecure.getMD5("${getVisionName()}${year}${month}${day}${getVisionCode()}").toUpperCase(Locale.ROOT)

override fun initBinding() {
binding = ActivityAgreementBinding.inflate(layoutInflater)
setContentView(binding.root)
}

override fun initView() {

}

override fun initListener() {
binding.btnAgree.setOnClickListener {
MyApplication.config.mmkv.encode(Config.SHOW_AGREEMENT, false)
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
val key = binding.etKey.text.toString()
if (key == "我同意") {
MyApplication.config.mmkv.encode(Config.SHOW_AGREEMENT, false)
val intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
} else {
toast("请重新输入")
}
}

binding.btnExit.setOnClickListener {
Expand All @@ -40,4 +59,6 @@ class AgreementActivity : BaseActivity() {
}
}

external fun cry(): String

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ package com.dirror.music.ui.activity
import android.content.Intent
import android.view.View
import androidx.activity.viewModels
import com.dirror.music.R
import com.dirror.music.api.API_AUTU
import com.dirror.music.databinding.ActivityLoginByPhoneBinding
import com.dirror.music.manager.ActivityCollector
import com.dirror.music.ui.base.BaseActivity
import com.dirror.music.ui.viewmodel.LoginCellphoneViewModel
import com.dirror.music.util.runOnMainThread
import com.dirror.music.util.sky.SkySecure
import com.dirror.music.util.toast
import com.dso.ext.md5

class LoginByPhoneActivity : BaseActivity() {

Expand All @@ -17,12 +21,12 @@ class LoginByPhoneActivity : BaseActivity() {
lateinit var binding: ActivityLoginByPhoneBinding

override fun initBinding() {
// if (SkySecure.getMD5(getString(R.string.app_name)) == SkySecure.getAppNameMd5()) {
if (getString(R.string.app_name).md5() == SkySecure.getAppNameMd5()) {
binding = ActivityLoginByPhoneBinding.inflate(layoutInflater)
setContentView(binding.root)
// } else {
// ActivityCollector.finishAll()
// }
} else {
ActivityCollector.finishAll()
}
}

override fun initListener() {
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/com/dirror/music/ui/base/BaseActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import com.dirror.music.databinding.MiniPlayerBinding
import com.dirror.music.manager.ActivityCollector
import com.dirror.music.ui.dialog.PlaylistDialog
import com.dirror.music.util.*
import com.dirror.music.util.extensions.parse
import com.dirror.music.util.sky.SkySecure

/**
* 基类 Activity
Expand All @@ -22,6 +24,9 @@ abstract class BaseActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ActivityCollector.addActivity(this)
if (SkySecure.checkXposed()) {
ActivityCollector.finishAll()
}
initBinding()
initData()
initView()
Expand Down Expand Up @@ -65,7 +70,7 @@ abstract class BaseActivity : AppCompatActivity() {
nullableController?.apply {
getPlayingSongData().observe(this@BaseActivity, { songData ->
songData?.let {
mini.tvTitle.text = songData.name + " - " + songData.artists?.let { parseArtist(it) }
mini.tvTitle.text = songData.name + " - " + songData.artists?.parse()
}
})
isPlaying().observe(this@BaseActivity, {
Expand Down
16 changes: 0 additions & 16 deletions app/src/main/java/com/dirror/music/ui/home/fragment/MyFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,6 @@ class MyFragment : BaseFragment() {
override fun initListener() {
binding.apply {
clUser.setOnClickListener {
// if (Build.VERSION.SDK_INT >= 26) {
// val solver = Animer.springiOSUIView(0.5f, 0.5f)
// val animer: Animer<*> = Animer<Any?, Any?>(binding.clUser, solver, Animer.Y)
// animer.start()
//
//
// Animation(requireContext())
//
// val anim = Animator.setInterpolator(
// PathInterpolator(0.42f,0f,0.58f,1f)
// .setDuration(1)
// }


AnimationUtil.click(it)
if (MyApplication.userManager.getCurrentUid() == 0L) {
MyApplication.activityManager.startLoginActivity(requireActivity())
Expand Down Expand Up @@ -122,7 +108,6 @@ class MyFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun initObserver() {
// binding.rvPlaylist.layoutManager = gridLayoutManager
mainViewModel.userId.observe(viewLifecycleOwner, {
// 清空歌单
myFragmentViewModel.clearPlaylist()
Expand Down Expand Up @@ -173,7 +158,6 @@ class MyFragment : BaseFragment() {
*/
private fun setPlaylist(playlist: ArrayList<PlaylistData>) {
runOnMainThread {

binding.rvPlaylist.adapter = activity?.let { it1 -> MyPlaylistAdapter(playlist, it1) }
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout-land/activity_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" >

<com.dirror.music.widget.lyricBackground.LyricsBackgroundLayerView
<com.dirror.music.widget.lyricBackground.LyricsBackgroundView
android:id="@+id/lyricsBackground"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down
13 changes: 11 additions & 2 deletions app/src/main/res/layout/activity_agreement.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,26 @@ Dso Music 软件内不提供歌曲下载,只提供在线音乐试听,请支
android:text="同意本协议后使用本软件一般不会再弹出本界面。
若你不同意本协议请不要使用本软件并卸载本软件、移除安装包等(未同意本协议传播本软件同按协议处理)。"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="6dp"
android:padding="16dp"
android:text="再次声明不支持下载什么的,和那些垃圾的恶意传播的公众号等天花乱坠的描述差别很大。若你感到很大的落差,本开发者表示抱歉,这只是一个我用来练手的开源项目,我不欠你什么。"
android:textColor="@color/colorTextForeground"
android:textStyle="bold" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:lineSpacingExtra="6dp"
android:textColor="@color/colorTextForeground"
android:text="为了防止一些恶意传播,不得已加入以下验证,希望理解"/>
android:text="若你同意以上协议并要继续使用,请输入“我同意”三个字"/>

<EditText
android:id="@+id/etKey"
android:hint="激活码"
android:hint="口令"
style="@style/default_edit_text"
/>

Expand Down
Loading

0 comments on commit 6c8a0bc

Please sign in to comment.