├── .gitignore
├── Gravity
├── 1.jpg
├── 2.jpg
├── 3.jpg
├── 4.jpg
├── 5.jpg
├── A8Speaker.apk
├── A8Speaker5.apk
├── Screenshot_2020_08_18_01_22_48_996_moe_lz233_meizugravity_controller.jpg
├── Screenshot_2020_08_18_01_22_51_963_moe_lz233_meizugravity_controller.jpg
├── Screenshot_2020_08_18_01_23_06_157_moe_lz233_meizugravity_controller.jpg
├── Screenshot_2020_08_18_01_23_08_443_moe_lz233_meizugravity_controller.jpg
├── banner.png
├── cloudmusic-1.png
├── cloudmusic-2.png
├── cloudmusic-3.png
├── ic_launcher-web.png
├── ic_launcher-web.psd
├── icon.ai
├── icon.svg
├── icon2.svg
├── key
│ ├── platform.pk8
│ ├── platform.x509.pem
│ ├── testkey.pk8
│ └── testkey.x509.pem
└── playstore-banner.png
├── LICENSE
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── font.otf
│ ├── java
│ └── moe
│ │ └── lz233
│ │ └── meizugravity
│ │ ├── App.kt
│ │ ├── activity
│ │ ├── AboutActivity.kt
│ │ ├── DashBoardActivity.java
│ │ ├── LauncherActivity.kt
│ │ ├── LrcActivity.java
│ │ ├── MainActivity.java
│ │ └── SettingsActivity.java
│ │ ├── adapter
│ │ └── LauncherAdapter.kt
│ │ ├── fragment
│ │ ├── ClockFragment.java
│ │ ├── CoolapkFragment.java
│ │ └── WeatherFragment.java
│ │ ├── meta
│ │ └── AppInfo.java
│ │ ├── receiver
│ │ └── BootBroadcastReceiver.java
│ │ ├── services
│ │ ├── CommandService.java
│ │ └── DashBoardService.java
│ │ ├── utils
│ │ ├── AppUtil.java
│ │ ├── AppsInfoUtil.java
│ │ ├── CoolapkAuthUtil.java
│ │ ├── DownloadUtil.java
│ │ ├── FileUtil.java
│ │ ├── GetUtil.java
│ │ └── WeatherUtil.java
│ │ └── view
│ │ └── ChanTextView.java
│ └── res
│ ├── drawable
│ ├── bgstyle.xml
│ ├── ic_apps.xml
│ ├── ic_dashboard.xml
│ ├── ic_info.xml
│ └── ic_settings.xml
│ ├── layout
│ ├── activity_about.xml
│ ├── activity_dash_board.xml
│ ├── activity_launcher.xml
│ ├── activity_lrc.xml
│ ├── activity_main.xml
│ ├── activity_settings.xml
│ ├── fragment_clock.xml
│ ├── fragment_coolapk.xml
│ ├── fragment_weather.xml
│ ├── item_app.xml
│ └── item_main.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxxhdpi
│ └── ic_launcher.png
│ ├── values-zh
│ ├── strings.xml
│ └── strings_weather.xml
│ └── values
│ ├── attrs.xml
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ ├── strings_weather.xml
│ └── styles.xml
├── build.gradle
├── controller
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── moe
│ │ └── lz233
│ │ └── meizugravity
│ │ └── controller
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── ic_launcher-playstore.png
│ ├── ic_launcher-web.png
│ ├── java
│ │ ├── ch
│ │ │ └── deletescape
│ │ │ │ └── lawnchair
│ │ │ │ ├── LawnchairUtils.kt
│ │ │ │ ├── util
│ │ │ │ └── ReflectionUtils.kt
│ │ │ │ └── views
│ │ │ │ ├── SpringEdgeEffect.kt
│ │ │ │ ├── SpringHorizontalScrollView.kt
│ │ │ │ ├── SpringNestedScrollView.kt
│ │ │ │ └── SpringRecyclerView.kt
│ │ ├── com
│ │ │ └── android
│ │ │ │ └── launcher3
│ │ │ │ └── touch
│ │ │ │ └── OverScroll.java
│ │ └── moe
│ │ │ └── lz233
│ │ │ └── meizugravity
│ │ │ └── controller
│ │ │ ├── Application.kt
│ │ │ ├── activity
│ │ │ ├── BaseActivity.java
│ │ │ └── MainActivity.java
│ │ │ ├── fragment
│ │ │ ├── BaseFragment.java
│ │ │ ├── GravityFragment.java
│ │ │ ├── KeyEventFragment.java
│ │ │ └── TouchPadFragment.kt
│ │ │ ├── service
│ │ │ └── AdbService.java
│ │ │ ├── util
│ │ │ ├── DownloadUtil.java
│ │ │ ├── FileUtil.java
│ │ │ ├── LogUtil.kt
│ │ │ ├── UriUtil.java
│ │ │ └── libadb
│ │ │ │ ├── AdbBase64.java
│ │ │ │ ├── AdbConnection.java
│ │ │ │ ├── AdbCrypto.java
│ │ │ │ ├── AdbProtocol.java
│ │ │ │ └── AdbStream.java
│ │ │ └── view
│ │ │ ├── AdjustImageView.java
│ │ │ └── TouchPadView.kt
│ └── res
│ │ ├── drawable
│ │ ├── gravity.webp
│ │ ├── ic_back.xml
│ │ ├── ic_close.xml
│ │ ├── ic_developer_mode.xml
│ │ ├── ic_enter.xml
│ │ ├── ic_graphic_eq.xml
│ │ ├── ic_keyboard_arrow_down.xml
│ │ ├── ic_keyboard_arrow_left.xml
│ │ ├── ic_keyboard_arrow_right.xml
│ │ ├── ic_keyboard_arrow_up.xml
│ │ ├── ic_launcher_background.xml
│ │ ├── ic_launcher_foreground.xml
│ │ ├── ic_menu.xml
│ │ ├── ic_more_vert.xml
│ │ ├── ic_play.xml
│ │ ├── ic_power.xml
│ │ ├── ic_rotate.xml
│ │ ├── ic_settings.xml
│ │ ├── ic_skip_next.xml
│ │ ├── ic_skip_previous.xml
│ │ ├── ic_volume_down.xml
│ │ └── ic_volume_up.xml
│ │ ├── layout-sw360dp
│ │ ├── fragment_gravity.xml
│ │ ├── fragment_keyevent.xml
│ │ └── fragment_touchpad.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── dialog_device_info.xml
│ │ ├── dialog_run_command.xml
│ │ ├── dialog_settings.xml
│ │ ├── fragment_gravity.xml
│ │ ├── fragment_keyevent.xml
│ │ └── fragment_touchpad.xml
│ │ ├── menu
│ │ └── menu_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── values-night
│ │ └── colors.xml
│ │ ├── values-zh-rHK
│ │ └── strings.xml
│ │ ├── values-zh-rMO
│ │ └── strings.xml
│ │ ├── values-zh-rTW
│ │ └── strings.xml
│ │ ├── values-zh
│ │ └── strings.xml
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── ic_launcher_background.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ │ └── xml
│ │ └── network_security_config.xml
│ └── test
│ └── java
│ └── moe
│ └── lz233
│ └── meizugravity
│ └── controller
│ └── ExampleUnitTest.java
├── design
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── font.otf
│ ├── java
│ ├── com
│ │ └── kd
│ │ │ └── easybarrage
│ │ │ ├── AnimationHelper.java
│ │ │ ├── Barrage.java
│ │ │ ├── BarrageTools.java
│ │ │ ├── BarrageView.java
│ │ │ ├── BorderTextView.java
│ │ │ └── DecelerateAccelerateInterpolator.java
│ ├── me
│ │ └── wcy
│ │ │ └── lrcview
│ │ │ ├── LrcEntry.java
│ │ │ ├── LrcUtils.java
│ │ │ └── LrcView.java
│ └── moe
│ │ └── lz233
│ │ └── meizugravity
│ │ └── design
│ │ ├── App.kt
│ │ ├── activity
│ │ └── BaseActivity.kt
│ │ ├── utils
│ │ ├── LogUtil.kt
│ │ ├── QRCodeUtil.java
│ │ ├── SystemPropertyUtil.java
│ │ ├── ToastUtil.java
│ │ ├── ViewPager2Util.java
│ │ └── ktx
│ │ │ └── Boolean.kt
│ │ └── view
│ │ ├── ChanSwitch.kt
│ │ └── ChanTextView.java
│ └── res
│ ├── drawable
│ ├── bgstyle.xml
│ ├── button_background.xml
│ ├── button_shape_1.xml
│ └── button_shape_2.xml
│ └── values
│ ├── attrs.xml
│ ├── colors.xml
│ ├── dimens.xml
│ └── strings.xml
├── docs
├── .gitignore
├── .vuepress
│ ├── config.js
│ └── public
│ │ └── images
│ │ └── fav.png
├── README.md
├── application.md
└── package.json
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── mediaplayer
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── libs
│ ├── armeabi-v7a
│ │ └── libflacJNI.so
│ └── x86
│ │ └── libflacJNI.so
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── zhy
│ │ └── mediaplayer_exo
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ └── java
│ │ └── com
│ │ ├── google
│ │ └── android
│ │ │ └── exoplayer2
│ │ │ └── ext
│ │ │ └── flac
│ │ │ ├── FlacBinarySearchSeeker.java
│ │ │ ├── FlacDecoder.java
│ │ │ ├── FlacDecoderException.java
│ │ │ ├── FlacDecoderJni.java
│ │ │ ├── FlacExtractor.java
│ │ │ ├── FlacLibrary.java
│ │ │ ├── LibflacAudioRenderer.java
│ │ │ └── package-info.java
│ │ └── zhy
│ │ └── mediaplayer_exo
│ │ └── playermanager
│ │ ├── MediaErrorListener.kt
│ │ ├── MediaPlayStateListaner.kt
│ │ ├── MediaPlayerExoPlayMode.kt
│ │ ├── MediaPlayerService.kt
│ │ ├── MediaProgressListener.kt
│ │ ├── MediaSwitchTrackChange.kt
│ │ ├── PlaylistItem.kt
│ │ ├── manager
│ │ └── MediaManager.kt
│ │ ├── meta
│ │ └── PlayListItem.kt
│ │ ├── musicbroadcast
│ │ └── MusicBroadcast.kt
│ │ └── service
│ │ └── MediaForegroundService.kt
│ └── test
│ └── java
│ └── com
│ └── zhy
│ └── mediaplayer_exo
│ └── ExampleUnitTest.kt
├── neteasecloudmusic
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── moe
│ │ └── lz233
│ │ └── meizugravity
│ │ └── cloudmusic
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── font.otf
│ ├── java
│ │ └── moe
│ │ │ └── lz233
│ │ │ └── meizugravity
│ │ │ └── cloudmusic
│ │ │ ├── App.kt
│ │ │ ├── logic
│ │ │ ├── dao
│ │ │ │ ├── BaseDao.kt
│ │ │ │ └── UserDao.kt
│ │ │ ├── model
│ │ │ │ ├── meta
│ │ │ │ │ ├── Album.kt
│ │ │ │ │ ├── Artist.kt
│ │ │ │ │ ├── Comment.kt
│ │ │ │ │ ├── Music.kt
│ │ │ │ │ ├── PlayList.kt
│ │ │ │ │ └── User.kt
│ │ │ │ └── response
│ │ │ │ │ ├── LoginResponse.kt
│ │ │ │ │ ├── PlaylistResponse.kt
│ │ │ │ │ ├── RecommendResponse.kt
│ │ │ │ │ ├── SongResponse.kt
│ │ │ │ │ └── UserResponse.kt
│ │ │ └── network
│ │ │ │ ├── CloudMusicNetwork.kt
│ │ │ │ ├── ServiceCreator.kt
│ │ │ │ ├── interceptor
│ │ │ │ ├── ExoPlayerInterceptor.kt
│ │ │ │ ├── HttpLogger.kt
│ │ │ │ └── RequestInterceptor.kt
│ │ │ │ └── service
│ │ │ │ ├── LoginService.kt
│ │ │ │ ├── PlaylistService.kt
│ │ │ │ ├── RecommendService.kt
│ │ │ │ ├── SongService.kt
│ │ │ │ └── UserService.kt
│ │ │ ├── ui
│ │ │ ├── about
│ │ │ │ └── AboutActivity.kt
│ │ │ ├── daily
│ │ │ │ ├── DailyActivity.kt
│ │ │ │ └── DailyAdapter.kt
│ │ │ ├── login
│ │ │ │ └── LoginActivity.kt
│ │ │ ├── main
│ │ │ │ └── MainActivity.kt
│ │ │ ├── musicmenu
│ │ │ │ └── MusicMenuActivity.kt
│ │ │ ├── mv
│ │ │ │ └── MvActivity.kt
│ │ │ ├── playing
│ │ │ │ └── PlayingActivity.kt
│ │ │ ├── playlist
│ │ │ │ ├── PlayListActivity.kt
│ │ │ │ └── PlayListAdapter.kt
│ │ │ ├── playlistdetail
│ │ │ │ ├── PlayListDetailAdapter.kt
│ │ │ │ └── PlaylistDetailActivity.kt
│ │ │ └── time
│ │ │ │ └── TimeActivity.kt
│ │ │ └── utils
│ │ │ ├── AESUtil.java
│ │ │ ├── AudioManager.kt
│ │ │ └── ktx
│ │ │ ├── Chain.kt
│ │ │ ├── List.kt
│ │ │ ├── ListView.kt
│ │ │ ├── Long.kt
│ │ │ └── String.kt
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── bgstyle.xml
│ │ ├── ic_account.xml
│ │ ├── ic_favorite.xml
│ │ ├── ic_image.xml
│ │ ├── ic_launcher_background.xml
│ │ └── ic_playlist.xml
│ │ ├── layout
│ │ ├── activity_about.xml
│ │ ├── activity_daily.xml
│ │ ├── activity_login.xml
│ │ ├── activity_main.xml
│ │ ├── activity_music_menu.xml
│ │ ├── activity_mv.xml
│ │ ├── activity_playing.xml
│ │ ├── activity_playlist.xml
│ │ ├── activity_playlist_detail.xml
│ │ ├── activity_time.xml
│ │ ├── dialog_logout.xml
│ │ ├── dialog_server.xml
│ │ ├── item_main.xml
│ │ ├── item_music.xml
│ │ ├── item_music_menu.xml
│ │ ├── item_playing.xml
│ │ ├── item_playlist.xml
│ │ ├── item_title.xml
│ │ └── view_exoplayer.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── themes.xml
│ └── test
│ └── java
│ └── moe
│ └── lz233
│ └── meizugravity
│ └── cloudmusic
│ └── ExampleUnitTest.kt
├── settings.gradle
├── shot
├── shot.bat
├── translate.bat
└── translate2.bat
/.gitignore:
--------------------------------------------------------------------------------
1 | *.aab
2 | *.apk
3 | *.iml
4 | .gradle
5 | /local.properties
6 | /.idea
7 | .DS_Store
8 | /build
9 | /captures
10 | .externalNativeBuild
11 | .cxx
12 |
--------------------------------------------------------------------------------
/Gravity/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/1.jpg
--------------------------------------------------------------------------------
/Gravity/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/2.jpg
--------------------------------------------------------------------------------
/Gravity/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/3.jpg
--------------------------------------------------------------------------------
/Gravity/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/4.jpg
--------------------------------------------------------------------------------
/Gravity/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/5.jpg
--------------------------------------------------------------------------------
/Gravity/A8Speaker.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/A8Speaker.apk
--------------------------------------------------------------------------------
/Gravity/A8Speaker5.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/A8Speaker5.apk
--------------------------------------------------------------------------------
/Gravity/Screenshot_2020_08_18_01_22_48_996_moe_lz233_meizugravity_controller.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/Screenshot_2020_08_18_01_22_48_996_moe_lz233_meizugravity_controller.jpg
--------------------------------------------------------------------------------
/Gravity/Screenshot_2020_08_18_01_22_51_963_moe_lz233_meizugravity_controller.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/Screenshot_2020_08_18_01_22_51_963_moe_lz233_meizugravity_controller.jpg
--------------------------------------------------------------------------------
/Gravity/Screenshot_2020_08_18_01_23_06_157_moe_lz233_meizugravity_controller.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/Screenshot_2020_08_18_01_23_06_157_moe_lz233_meizugravity_controller.jpg
--------------------------------------------------------------------------------
/Gravity/Screenshot_2020_08_18_01_23_08_443_moe_lz233_meizugravity_controller.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/Screenshot_2020_08_18_01_23_08_443_moe_lz233_meizugravity_controller.jpg
--------------------------------------------------------------------------------
/Gravity/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/banner.png
--------------------------------------------------------------------------------
/Gravity/cloudmusic-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/cloudmusic-1.png
--------------------------------------------------------------------------------
/Gravity/cloudmusic-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/cloudmusic-2.png
--------------------------------------------------------------------------------
/Gravity/cloudmusic-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/cloudmusic-3.png
--------------------------------------------------------------------------------
/Gravity/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/ic_launcher-web.png
--------------------------------------------------------------------------------
/Gravity/ic_launcher-web.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/ic_launcher-web.psd
--------------------------------------------------------------------------------
/Gravity/icon.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/icon.ai
--------------------------------------------------------------------------------
/Gravity/icon2.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Gravity/key/platform.pk8:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/key/platform.pk8
--------------------------------------------------------------------------------
/Gravity/key/platform.x509.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIEqDCCA5CgAwIBAgIJALOZgIbQVs/6MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYD
3 | VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4g
4 | VmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UE
5 | AxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAe
6 | Fw0wODA0MTUyMjQwNTBaFw0zNTA5MDEyMjQwNTBaMIGUMQswCQYDVQQGEwJVUzET
7 | MBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4G
8 | A1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9p
9 | ZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZI
10 | hvcNAQEBBQADggENADCCAQgCggEBAJx4BZKsDV04HN6qZezIpgBuNkgMbXIHsSAR
11 | vlCGOqvitV0Amt9xRtbyICKAx81Ne9smJDuKgGwms0sTdSOkkmgiSQTcAUk+fArP
12 | GgXIdPabA3tgMJ2QdNJCgOFrrSqHNDYZUer3KkgtCbIEsYdeEqyYwap3PWgAuer9
13 | 5W1Yvtjo2hb5o2AJnDeoNKbf7be2tEoEngeiafzPLFSW8s821k35CjuNjzSjuqtM
14 | 9TNxqydxmzulh1StDFP8FOHbRdUeI0+76TybpO35zlQmE1DsU1YHv2mi/0qgfbX3
15 | 6iANCabBtJ4hQC+J7RGQiTqrWpGA8VLoL4WkV1PPX8GQccXuyCcCAQOjgfwwgfkw
16 | HQYDVR0OBBYEFE/koLPdnLop9x1yh8Tnw48ghsKZMIHJBgNVHSMEgcEwgb6AFE/k
17 | oLPdnLop9x1yh8Tnw48ghsKZoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UE
18 | CBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMH
19 | QW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAG
20 | CSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJALOZgIbQVs/6MAwGA1Ud
21 | EwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBAFclUbjZOh9z3g9tRp+G2tZwFAAp
22 | PIigzXzXeLc9r8wZf6t25iEuVsHHYc/EL9cz3lLFCuCIFM78CjtaGkNGBU2Cnx2C
23 | tCsgSL+ItdFJKe+F9g7dEtctVWV+IuPoXQTIMdYT0Zk4u4mCJH+jISVroS0dao+S
24 | 6h2xw3Mxe6DAN/DRr/ZFrvIkl5+6bnoUvAJccbmBOM7z3fwFlhfPJIRc97QNY4L3
25 | J17XOElatuWTG5QhdlxJG3L7aOCA29tYwgKdNHyLMozkPvaosVUz7fvpib1qSN1L
26 | IC7alMarjdW4OZID2q4u1EYjLk/pvZYTlMYwDlE448/Shebk5INTjLixs1c=
27 | -----END CERTIFICATE-----
28 |
--------------------------------------------------------------------------------
/Gravity/key/testkey.pk8:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/key/testkey.pk8
--------------------------------------------------------------------------------
/Gravity/key/testkey.x509.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIEqDCCA5CgAwIBAgIJAJNurL4H8gHfMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYD
3 | VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4g
4 | VmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UE
5 | AxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAe
6 | Fw0wODAyMjkwMTMzNDZaFw0zNTA3MTcwMTMzNDZaMIGUMQswCQYDVQQGEwJVUzET
7 | MBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4G
8 | A1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9p
9 | ZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZI
10 | hvcNAQEBBQADggENADCCAQgCggEBANaTGQTexgskse3HYuDZ2CU+Ps1s6x3i/waM
11 | qOi8qM1r03hupwqnbOYOuw+ZNVn/2T53qUPn6D1LZLjk/qLT5lbx4meoG7+yMLV4
12 | wgRDvkxyGLhG9SEVhvA4oU6Jwr44f46+z4/Kw9oe4zDJ6pPQp8PcSvNQIg1QCAcy
13 | 4ICXF+5qBTNZ5qaU7Cyz8oSgpGbIepTYOzEJOmc3Li9kEsBubULxWBjf/gOBzAzU
14 | RNps3cO4JFgZSAGzJWQTT7/emMkod0jb9WdqVA2BVMi7yge54kdVMxHEa5r3b97s
15 | zI5p58ii0I54JiCUP5lyfTwE/nKZHZnfm644oLIXf6MdW2r+6R8CAQOjgfwwgfkw
16 | HQYDVR0OBBYEFEhZAFY9JyxGrhGGBaR0GawJyowRMIHJBgNVHSMEgcEwgb6AFEhZ
17 | AFY9JyxGrhGGBaR0GawJyowRoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UE
18 | CBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMH
19 | QW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAG
20 | CSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJAJNurL4H8gHfMAwGA1Ud
21 | EwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAHqvlozrUMRBBVEY0NqrrwFbinZa
22 | J6cVosK0TyIUFf/azgMJWr+kLfcHCHJsIGnlw27drgQAvilFLAhLwn62oX6snb4Y
23 | LCBOsVMR9FXYJLZW2+TcIkCRLXWG/oiVHQGo/rWuWkJgU134NDEFJCJGjDbiLCpe
24 | +ZTWHdcwauTJ9pUbo8EvHRkU3cYfGmLaLfgn9gP+pWA7LFQNvXwBnDa6sppCccEX
25 | 31I828XzgXpJ4O+mDL1/dBd+ek8ZPUP0IgdyZm5MTYPhvVqGCHzzTy3sIeJFymwr
26 | sBbmg2OAUNLEMO6nwmocSdN2ClirfxqCzJOLSDE4QyS9BAH6EhY6UFcOaE0=
27 | -----END CERTIFICATE-----
28 |
--------------------------------------------------------------------------------
/Gravity/playstore-banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/Gravity/playstore-banner.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 |
4 |
5 | #
「让这块屏幕干它该干的事。」
6 |
7 | [快速开始](https://gravity.project.ac.cn)
8 |
9 | 为了及时获得更新,请在右上角 watch 这个项目。
10 |
11 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'kotlin-android'
4 | }
5 |
6 | android {
7 | compileSdkVersion 32
8 |
9 | defaultConfig {
10 | Date date = new Date()
11 | applicationId "moe.lz233.meizugravity"
12 | minSdkVersion 19
13 | targetSdkVersion 32
14 | versionCode = date.format("yyyyMMdd").toInteger()
15 | versionName "0.3.1"
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled true
21 | zipAlignEnabled true
22 | shrinkResources true
23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 | compileOptions {
27 | sourceCompatibility JavaVersion.VERSION_11
28 | targetCompatibility JavaVersion.VERSION_11
29 | }
30 | buildFeatures {
31 | viewBinding true
32 | }
33 | packagingOptions {
34 | jniLibs {
35 | excludes += ['META-INF/**', 'kotlin/**', 'okhttp3/**', 'org/**', 'lib/arm64-v8a/**', 'lib/x86_64/**']
36 | }
37 | resources {
38 | excludes += ['META-INF/**', 'kotlin/**', 'okhttp3/**', 'org/**', '**.properties', '**.bin', 'lib/arm64-v8a/**', 'lib/x86_64/**']
39 | }
40 | }
41 | namespace 'moe.lz233.meizugravity'
42 | }
43 |
44 | dependencies {
45 | implementation fileTree(dir: "libs", include: ["*.jar"])
46 | implementation project(':design')
47 |
48 | implementation 'androidx.appcompat:appcompat:1.4.2'
49 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
50 | implementation 'androidx.legacy:legacy-support-v4:1.0.0'
51 |
52 | //3.12.13
53 | implementation 'com.squareup.okhttp3:okhttp:3.12.13'
54 | implementation 'commons-codec:commons-codec:20041127.091804'
55 | }
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/main/assets/font.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/app/src/main/assets/font.otf
--------------------------------------------------------------------------------
/app/src/main/java/moe/lz233/meizugravity/App.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity
2 |
3 | import moe.lz233.meizugravity.design.App
4 |
5 |
6 | class App : App(BuildConfig.APPLICATION_ID)
--------------------------------------------------------------------------------
/app/src/main/java/moe/lz233/meizugravity/activity/AboutActivity.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.activity
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import android.view.KeyEvent
7 | import moe.lz233.meizugravity.BuildConfig
8 | import moe.lz233.meizugravity.databinding.ActivityAboutBinding
9 | import moe.lz233.meizugravity.design.activity.BaseActivity
10 | import moe.lz233.meizugravity.design.utils.QRCodeUtil
11 |
12 | class AboutActivity : BaseActivity() {
13 |
14 | private val viewBuilding by lazy { ActivityAboutBinding.inflate(layoutInflater) }
15 |
16 | override fun onCreate(savedInstanceState: Bundle?) {
17 | super.onCreate(savedInstanceState)
18 | setContentView(viewBuilding.root)
19 | viewBuilding.aboutImageView.setImageBitmap(QRCodeUtil.createQRCodeBitmap("https://github.com/lz233/MeizuGravity", 100, 100))
20 | viewBuilding.versionTextView.text = "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})"
21 | }
22 |
23 | override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
24 | when (keyCode) {
25 | KeyEvent.KEYCODE_MENU -> finish()
26 | }
27 | return super.onKeyDown(keyCode, event)
28 | }
29 |
30 | companion object {
31 | fun actionStart(context: Context) = context.startActivity(Intent(context, AboutActivity::class.java))
32 | }
33 | }
--------------------------------------------------------------------------------
/app/src/main/java/moe/lz233/meizugravity/adapter/LauncherAdapter.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.adapter
2 |
3 | import android.app.Activity
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import android.widget.ArrayAdapter
8 | import android.widget.TextView
9 | import moe.lz233.meizugravity.R
10 | import moe.lz233.meizugravity.meta.AppInfo
11 |
12 | class LauncherAdapter(private val activity: Activity, appList: List) : ArrayAdapter(activity, R.layout.item_app, appList) {
13 | override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
14 | val view = convertView
15 | ?: LayoutInflater.from(activity).inflate(R.layout.item_app, parent, false)
16 | val appInfo = getItem(position)!!
17 | view.findViewById(R.id.appNameTextView).text = appInfo.appName
18 | view.findViewById(R.id.packageNameTextView).text = appInfo.packageName
19 | return view
20 | }
21 | }
--------------------------------------------------------------------------------
/app/src/main/java/moe/lz233/meizugravity/fragment/ClockFragment.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.fragment;
2 |
3 | import android.animation.LayoutTransition;
4 | import android.os.Bundle;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.LinearLayout;
9 |
10 | import androidx.fragment.app.Fragment;
11 |
12 | import org.json.JSONException;
13 | import org.json.JSONObject;
14 |
15 | import moe.lz233.meizugravity.R;
16 | import moe.lz233.meizugravity.utils.GetUtil;
17 | import moe.lz233.meizugravity.view.ChanTextView;
18 |
19 | public class ClockFragment extends Fragment {
20 | private LinearLayout clockLinearLayout;
21 | private ChanTextView hitokotoTextView;
22 |
23 | public ClockFragment() {
24 | }
25 |
26 | @Override
27 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
28 | ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_clock, container, false);
29 | //
30 | clockLinearLayout = rootView.findViewById(R.id.clockLinearLayout);
31 | hitokotoTextView = rootView.findViewById(R.id.hitokotoTextView);
32 | //
33 | clockLinearLayout.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
34 | new Thread(() -> new GetUtil().sendGet("https://netease-cloud-music-api-kvzk9t0k3-lz233.vercel.app/", null, result ->{})).start();
35 | new Thread(() -> new GetUtil().sendGet("https://v1.hitokoto.cn", null, result ->
36 | hitokotoTextView.post(() -> {
37 | try {
38 | hitokotoTextView.setText(new JSONObject(result).getString("hitokoto"));
39 | } catch (JSONException e) {
40 | e.printStackTrace();
41 | }
42 | }))).start();
43 | return rootView;
44 | }
45 | }
--------------------------------------------------------------------------------
/app/src/main/java/moe/lz233/meizugravity/meta/AppInfo.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.meta;
2 |
3 | public class AppInfo {
4 | private String appName;
5 | private String packageName;
6 |
7 | public String getPackageName() {
8 | return packageName;
9 | }
10 |
11 | public void setPackageName(String packageName) {
12 | this.packageName = packageName;
13 | }
14 |
15 | public String getAppName() {
16 | return appName;
17 | }
18 |
19 | public void setAppName(String appName) {
20 | this.appName = appName;
21 | }
22 | }
--------------------------------------------------------------------------------
/app/src/main/java/moe/lz233/meizugravity/receiver/BootBroadcastReceiver.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.receiver;
2 |
3 | import android.content.BroadcastReceiver;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.util.Log;
7 | import android.widget.Toast;
8 |
9 | import moe.lz233.meizugravity.services.CommandService;
10 | import moe.lz233.meizugravity.services.DashBoardService;
11 |
12 | public class BootBroadcastReceiver extends BroadcastReceiver {
13 |
14 | @Override
15 | public void onReceive(final Context context, Intent intent) {
16 | if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
17 | //context.startService(new Intent(context, KeyEventService.class));
18 | Log.i("ONRECEIVER", "BOOTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT");
19 | //Toast.makeText(context,"ACTION_BOOT_COMPLETED",Toast.LENGTH_LONG).show();
20 | context.startService(new Intent(context, DashBoardService.class));
21 | //context.startService(new Intent(context, CommandService.class));
22 | //Runtime.getRuntime().exec("")
23 | //AppUtil.runRootCommand("pm install -r /sdcard/A8Speaker.apk && cp /sdcard/A8Speaker2.apk /data/app/com.meizu.speaker-1.apk");
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/java/moe/lz233/meizugravity/services/DashBoardService.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.services;
2 |
3 | import android.app.Service;
4 | import android.content.Intent;
5 | import android.content.SharedPreferences;
6 | import android.os.IBinder;
7 |
8 | import moe.lz233.meizugravity.activity.DashBoardActivity;
9 |
10 | public class DashBoardService extends Service {
11 | private SharedPreferences sharedPreferences;
12 |
13 | public DashBoardService() {
14 | }
15 |
16 | @Override
17 | public void onCreate() {
18 | super.onCreate();
19 | //sharedPreferences = getSharedPreferences("setting",MODE_PRIVATE);
20 | if (sharedPreferences.getBoolean("autoSleep",true)) {
21 | new Thread(() -> {
22 | while (true) {
23 | try {
24 | //Thread.sleep(10000);
25 | Thread.sleep(sharedPreferences.getInt("overTime",300000));
26 | if (!sharedPreferences.getBoolean("isInDashBoard", false)) {
27 | Intent intent = new Intent(DashBoardService.this, DashBoardActivity.class);
28 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
29 | startActivity(intent);
30 | }
31 | } catch (InterruptedException e) {
32 | e.printStackTrace();
33 | }
34 | }
35 | }).start();
36 | }
37 | }
38 |
39 | @Override
40 | public IBinder onBind(Intent intent) {
41 | // TODO: Return the communication channel to the service.
42 | throw new UnsupportedOperationException("Not yet implemented");
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/moe/lz233/meizugravity/utils/AppUtil.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.utils;
2 |
3 | import android.content.Context;
4 |
5 | import java.text.ParseException;
6 | import java.text.SimpleDateFormat;
7 | import java.util.Date;
8 |
9 | public class AppUtil {
10 | public static int dp2px(Context context, float dipValue) {
11 | final float scale = context.getResources().getDisplayMetrics().density;
12 | return (int) (dipValue * scale + 0.5f);
13 | }
14 |
15 | public static String dateToStamp(String time) throws ParseException {
16 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
17 | Date date = simpleDateFormat.parse(time);
18 | long ts = date.getTime();
19 | return String.valueOf(ts);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/java/moe/lz233/meizugravity/utils/AppsInfoUtil.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.utils;
2 |
3 | import android.app.ActivityManager;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.pm.PackageManager;
7 | import android.content.pm.ResolveInfo;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | import moe.lz233.meizugravity.meta.AppInfo;
13 |
14 | public class AppsInfoUtil {
15 |
16 | private PackageManager packageManager;
17 | private List appInfos = new ArrayList();
18 |
19 | public AppsInfoUtil(Context mContext) {
20 | ActivityManager activityManager =
21 | (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
22 | packageManager = mContext.getPackageManager();
23 | }
24 |
25 | private void loadAppsInfo() {
26 | List apps = null;
27 | Intent filterIntent = new Intent(Intent.ACTION_MAIN, null);
28 | //Intent.CATEGORY_LAUNCHER主要的过滤条件
29 | filterIntent.addCategory(Intent.CATEGORY_LAUNCHER);
30 | apps = packageManager.queryIntentActivities(filterIntent, 0);
31 | for (ResolveInfo resolveInfo : apps) {
32 | AppInfo appInfo = new AppInfo();
33 | appInfo.setPackageName(resolveInfo.activityInfo.applicationInfo.packageName);
34 | appInfo.setAppName(resolveInfo.loadLabel(packageManager).toString());
35 | appInfos.add(appInfo);
36 | }
37 | }
38 |
39 | //外部获取信息的方法
40 | public List getAppList() {
41 | loadAppsInfo();
42 | return appInfos;
43 | }
44 | }
--------------------------------------------------------------------------------
/app/src/main/java/moe/lz233/meizugravity/utils/CoolapkAuthUtil.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.utils;
2 |
3 | import android.util.Log;
4 |
5 | import org.apache.commons.codec.binary.Base64;
6 | import org.apache.commons.codec.digest.DigestUtils;
7 |
8 | import java.nio.charset.StandardCharsets;
9 | import java.util.Calendar;
10 |
11 | public class CoolapkAuthUtil {
12 | public static String getAS() {
13 | String result = "";
14 | try {
15 | //String UUID = "140457a3-af3f-407c-9e70-18b6548757b7";
16 | String UUID = java.util.UUID.randomUUID().toString();
17 | Calendar calendar = Calendar.getInstance();
18 | int time = Integer.parseInt((AppUtil.dateToStamp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1) + "-" + calendar.get(Calendar.DATE) + " " + calendar.get(Calendar.HOUR_OF_DAY) + ":" + calendar.get(Calendar.MINUTE) + ":" + calendar.get(Calendar.SECOND)).substring(0, 10)));
19 | //int time = (int) Calendar.getInstance(TimeZone.getTimeZone("UTC+8")).getTimeInMillis();
20 | String hexTime = "0x" + Integer.toHexString(time);
21 | String MD5Time = DigestUtils.md5Hex(String.valueOf(time));
22 | String a = "token://com.coolapk.market/c67ef5943784d09750dcfbb31020f0ab?" + MD5Time + "$" + UUID + "&com.coolapk.market";
23 | String MD5a = DigestUtils.md5Hex(Base64.encodeBase64(a.getBytes(StandardCharsets.UTF_8)));
24 | result = MD5a + UUID + hexTime;
25 | Log.i("233", result);
26 | } catch (Exception e) {
27 | e.printStackTrace();
28 | }
29 | return result;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bgstyle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_apps.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_dashboard.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_info.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_settings.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_dash_board.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
19 |
20 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
20 |
21 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
21 |
22 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
21 |
22 |
28 |
29 |
30 |
31 |
35 |
36 |
39 |
40 |
45 |
46 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_clock.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
23 |
24 |
33 |
34 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_coolapk.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
23 |
24 |
29 |
30 |
35 |
36 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_app.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-zh/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Meizu Gravity +
4 | 仪表盘
5 | 设置
6 | 通过端口 2333 发送 GET 请求来修改设置。\n
7 | 例:192.168.43.192:2333/brightness=0.2\n\n
8 | 以下是可用的请求值:\n
9 | [boolean]autoSleep-调整DashBoard是否自动打开。\n
10 | [int]overTime-调整DashBoard打开的时间。\n
11 | [float]brightness-调整DashBoard的亮度。\n
12 | [string]location-用于显示当地的天气。\n
13 | [string]coolapkUid-用于显示指定的 Coolapk 用户信息。\n
14 | 关于
15 | 不支持当前设备。本应用仅支持 Meizu Gravity。
16 | 单击「Next 键」返回\n单击「Play 键」进入相应项目\n更多信息请参阅关于页面
17 | 「让这块屏幕干它该干的事。」\n\n
18 | 本项目的开发离不开以下项目:\n
19 | Android Open Source Project (Apache 2.0)\n
20 | AndroidX (Apache 2.0)\n
21 | AppCenter SDK Android (MIT)\n
22 | Zxing (Apache 2.0)\n
23 | Calligraphy (Apache 2.0)\n
24 | ViewPump (Apache 2.0)\n
25 | Commons Codec (Apache 2.0)\n
26 | OKHttp (Apache 2.0)\n
27 | Meizu Gravity APK (Non license)
28 | EEEE M月d日
29 | 跟随者
30 | 关注
31 | 暂无歌词
32 | 应用
33 |
--------------------------------------------------------------------------------
/app/src/main/res/values-zh/strings_weather.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 晴
4 | 多云
5 | 阴
6 | 轻度雾霾
7 | 中度雾霾
8 | 重度雾霾
9 | 小雨
10 | 中雨
11 | 大雨
12 | 暴雨
13 | 雾
14 | 小雪
15 | 中雪
16 | 大雪
17 | 暴雪
18 | 浮尘
19 | 沙尘
20 | 大风
21 |
22 | AQI:
23 | 优
24 | 良
25 | 轻度污染
26 | 中度污染
27 | 重度污染
28 | 严重污染
29 |
30 | 降水强度:
31 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #000000
4 | #000000
5 | #FFFFFF
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 86px
4 | 80px
5 | 60px
6 | 30px
7 | 26px
8 | 21px
9 | 20px
10 | 18px
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Meizu Gravity +
3 | Dashboard
4 | Setting
5 | Send a GET request through port 2333 to modify the settings.\n
6 | Example: 192.168.43.192:2333/brightness=0.2\n\n
7 | The following request values are available:\n
8 | [boolean]autoSleep-Adjust whether DashBoard opens automatically.\n
9 | [int]overTime-Adjust the time when DashBoard is opened.\n
10 | [float]brightness-Adjust the brightness of DashBoard.\n
11 | [string]location-used to display the local weather.\n
12 | [string]coolapkUid-used to display the specified Coolapk user information.\n
13 | About
14 | This device is not supported. This application only supports Meizu Gravity.
15 | Tap "Next" to return\nTap "Play" to enter the selected item\nSee the about page for more information
16 | 「Let this screen do what it should do.」\n\n
17 | The development of this project is inseparable from the following projects:\n
18 | Android Open Source Project (Apache 2.0)\n
19 | AndroidX (Apache 2.0)\n
20 | AppCenter SDK Android (MIT)\n
21 | Zxing (Apache 2.0)\n
22 | Calligraphy (Apache 2.0)\n
23 | ViewPump (Apache 2.0)\n
24 | Commons Codec (Apache 2.0)\n
25 | OKHttp (Apache 2.0)\n
26 | Meizu Gravity APK (Non license)
27 | EEEE M.d
28 | following
29 | follower
30 | No lyrics
31 | Apps
32 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings_weather.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Sunny
4 | Partly cloudy
5 | Cloudy
6 | Light haze
7 | Moderate haze
8 | Heavy haze
9 | Light rain
10 | Moderate rain
11 | Heavy rain
12 | Storm rain
13 | Fog
14 | Light snow
15 | Moderate snow
16 | Heavy snow
17 | Storm snow
18 | Dust
19 | Sand
20 | Wind
21 |
22 | AQI:
23 | Good
24 | Moderate
25 | Unhealthy for Sensitive Groups
26 | Unhealthy
27 | Very Unhealthy
28 | Hazardous
29 |
30 | Precipitation intensity:
31 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | ext.kotlin_version ="1.6.10"
4 | repositories {
5 | maven { url "https://jitpack.io" }
6 | mavenCentral()
7 | google()
8 | jcenter()
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:7.4.1'
12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0"
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | maven { url "https://jitpack.io" }
21 | mavenCentral()
22 | google()
23 | jcenter()
24 | }
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
--------------------------------------------------------------------------------
/controller/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/controller/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin:'kotlin-android'
3 | apply plugin:'kotlin-android-extensions'
4 | android {
5 | compileSdkVersion 31
6 | buildToolsVersion "31.0.0"
7 |
8 | defaultConfig {
9 | Date date = new Date()
10 | applicationId "moe.lz233.meizugravity.controller"
11 | minSdkVersion 21
12 | targetSdkVersion 31
13 | versionCode = date.format("yyyyMMdd").toInteger()
14 | versionName "0.4"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled true
22 | zipAlignEnabled true
23 | shrinkResources true
24 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
25 | }
26 | }
27 | compileOptions {
28 | sourceCompatibility JavaVersion.VERSION_11
29 | targetCompatibility JavaVersion.VERSION_11
30 | }
31 | namespace 'moe.lz233.meizugravity.controller'
32 | }
33 |
34 | dependencies {
35 | implementation fileTree(dir: "libs", include: ["*.jar"])
36 | implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.2'
37 | implementation 'androidx.appcompat:appcompat:1.4.1'
38 | implementation 'com.google.android.material:material:1.5.0'
39 | implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
40 | implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
41 | implementation 'com.github.warkiz.widget:indicatorseekbar:2.1.2'
42 | implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
43 | testImplementation 'junit:junit:4.13.2'
44 | androidTestImplementation 'androidx.test.ext:junit:1.1.3'
45 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/controller/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/controller/src/androidTest/java/moe/lz233/meizugravity/controller/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.controller;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("moe.lz233.meizugravity.controller", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/controller/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
15 |
19 |
20 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/controller/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/controller/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/controller/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/controller/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/controller/src/main/java/ch/deletescape/lawnchair/util/ReflectionUtils.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Lawnchair Launcher.
3 | *
4 | * Lawnchair Launcher is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * Lawnchair Launcher is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with Lawnchair Launcher. If not, see .
16 | */
17 |
18 | package ch.deletescape.lawnchair.util
19 |
20 | import java.lang.reflect.Field
21 |
22 | inline fun getField(name: String): Field {
23 | return T::class.java.getDeclaredField(name).apply {
24 | isAccessible = true
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/controller/src/main/java/com/android/launcher3/touch/OverScroll.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.android.launcher3.touch;
17 |
18 | /**
19 | * Utility methods for overscroll damping and related effect.
20 | */
21 | public class OverScroll {
22 |
23 | private static final float OVERSCROLL_DAMP_FACTOR = 0.07f;
24 |
25 | /**
26 | * This curve determines how the effect of scrolling over the limits of the page diminishes
27 | * as the user pulls further and further from the bounds
28 | *
29 | * @param f The percentage of how much the user has overscrolled.
30 | * @return A transformed percentage based on the influence curve.
31 | */
32 | private static float overScrollInfluenceCurve(float f) {
33 | f -= 1.0f;
34 | return f * f * f + 1.0f;
35 | }
36 |
37 | /**
38 | * @param amount The original amount overscrolled.
39 | * @param max The maximum amount that the View can overscroll.
40 | * @return The dampened overscroll amount.
41 | */
42 | public static int dampedScroll(float amount, int max) {
43 | if (Float.compare(amount, 0) == 0) return 0;
44 |
45 | float f = amount / max;
46 | f = f / (Math.abs(f)) * (overScrollInfluenceCurve(Math.abs(f)));
47 |
48 | // Clamp this factor, f, to -1 < f < 1
49 | if (Math.abs(f) >= 1) {
50 | f /= Math.abs(f);
51 | }
52 |
53 | return Math.round(OVERSCROLL_DAMP_FACTOR * f * max);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/controller/src/main/java/moe/lz233/meizugravity/controller/Application.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.controller
2 |
3 | import android.app.Application
4 | import android.content.Context
5 | import android.content.SharedPreferences
6 |
7 | class Application : Application() {
8 | companion object {
9 | lateinit var context: Context
10 | lateinit var sp: SharedPreferences
11 | lateinit var editor: SharedPreferences.Editor
12 | }
13 |
14 | override fun onCreate() {
15 | super.onCreate()
16 | context = applicationContext
17 | sp = context.getSharedPreferences(BuildConfig.APPLICATION_ID, MODE_PRIVATE)
18 | editor = sp.edit()
19 | }
20 | }
--------------------------------------------------------------------------------
/controller/src/main/java/moe/lz233/meizugravity/controller/activity/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.controller.activity;
2 |
3 | import android.content.SharedPreferences;
4 | import android.content.res.Configuration;
5 | import android.os.Bundle;
6 | import android.view.Menu;
7 | import android.view.MenuItem;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 |
11 | import androidx.annotation.NonNull;
12 | import androidx.annotation.Nullable;
13 | import androidx.appcompat.app.AppCompatActivity;
14 |
15 | public class BaseActivity extends AppCompatActivity {
16 | protected SharedPreferences sharedPreferences;
17 | protected SharedPreferences.Editor editor;
18 | protected ViewGroup rootView;
19 | @Override
20 | protected void onCreate(@Nullable Bundle savedInstanceState) {
21 | super.onCreate(savedInstanceState);
22 | sharedPreferences = getSharedPreferences("setting",MODE_PRIVATE);
23 | editor = sharedPreferences.edit();
24 | rootView = findViewById(android.R.id.content);
25 | //状态栏icon
26 | int mode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
27 | if (mode == Configuration.UI_MODE_NIGHT_NO) {
28 | this.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/controller/src/main/java/moe/lz233/meizugravity/controller/fragment/TouchPadFragment.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.controller.fragment
2 |
3 | import android.animation.LayoutTransition
4 | import android.content.Intent
5 | import android.content.SharedPreferences
6 | import android.os.Bundle
7 | import android.view.LayoutInflater
8 | import android.view.View
9 | import android.view.ViewGroup
10 | import androidx.viewpager2.widget.ViewPager2
11 | import kotlinx.android.synthetic.main.fragment_touchpad.*
12 | import moe.lz233.meizugravity.controller.R
13 | import moe.lz233.meizugravity.controller.service.AdbService
14 |
15 | class TouchPadFragment(private val viewPager2: ViewPager2, sharedPreferences: SharedPreferences, editor: SharedPreferences.Editor) : BaseFragment(sharedPreferences, editor) {
16 |
17 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
18 | return inflater.inflate(R.layout.fragment_touchpad, container, false) as ViewGroup
19 | }
20 |
21 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
22 | touchPadFrameLayout.layoutTransition.enableTransitionType(LayoutTransition.CHANGING)
23 | touchPadView.viewPager2 = viewPager2
24 | runCommandExtendedFloatingActionButton.setOnClickListener { showRunCommandDialog() }
25 | centerFloatingActionButton.setOnClickListener { activity?.startService(Intent(activity, AdbService::class.java).putExtra("cmd", "input keyevent 66")) }
26 | backFloatingActionButton.setOnClickListener { activity?.startService(Intent(activity, AdbService::class.java).putExtra("cmd", "input keyevent 4")) }
27 | rotateFloatingActionButton.setOnClickListener {
28 | touchPadView.changeSize(touchPadView.height, touchPadView.width)
29 | }
30 | super.onViewCreated(view, savedInstanceState)
31 | }
32 | }
--------------------------------------------------------------------------------
/controller/src/main/java/moe/lz233/meizugravity/controller/util/LogUtil.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.controller.util
2 |
3 | import moe.lz233.meizugravity.controller.BuildConfig
4 | import android.util.Log as ALog
5 |
6 | object LogUtil {
7 |
8 | @JvmStatic
9 | private fun doLog(f: (String, String) -> Int, obj: Any?) {
10 | val str = if (obj is Throwable) ALog.getStackTraceString(obj) else obj.toString()
11 | if (str.length > maxLength) {
12 | val chunkCount: Int = str.length / maxLength
13 | for (i in 0..chunkCount) {
14 | val max: Int = 4000 * (i + 1)
15 | if (max >= str.length) {
16 | doLog(f, str.substring(maxLength * i))
17 | } else {
18 | doLog(f, str.substring(maxLength * i, max))
19 | }
20 | }
21 | } else {
22 | f("MEIZUGRAVITY", str)
23 | }
24 | }
25 |
26 | @JvmStatic
27 | fun d(obj: Any?) {
28 | doLog(ALog::d, obj)
29 | }
30 |
31 | @JvmStatic
32 | fun i(obj: Any?) {
33 | doLog(ALog::i, obj)
34 | }
35 |
36 | @JvmStatic
37 | fun e(obj: Any?) {
38 | doLog(ALog::e, obj)
39 | }
40 |
41 | @JvmStatic
42 | fun v(obj: Any?) {
43 | doLog(ALog::v, obj)
44 | }
45 |
46 | @JvmStatic
47 | fun w(obj: Any?) {
48 | doLog(ALog::w, obj)
49 | }
50 |
51 | private const val maxLength = 4000
52 | }
--------------------------------------------------------------------------------
/controller/src/main/java/moe/lz233/meizugravity/controller/util/UriUtil.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.controller.util;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 |
6 | public class UriUtil {
7 | public static String getHostUri(Context context,String port) {
8 | SharedPreferences sharedPreferences = context.getSharedPreferences("setting",Context.MODE_PRIVATE);
9 | return "http://" + sharedPreferences.getString("ip", "127.0.0.1") + ":" + port + "/";
10 | }
11 |
12 | public static String getCmdUri(Context context,String cmd) {
13 | return getHostUri(context,"2333") + cmd.replace(" ", "%20");
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/controller/src/main/java/moe/lz233/meizugravity/controller/util/libadb/AdbBase64.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.controller.util.libadb;
2 |
3 | /**
4 | * This interface specifies the required functions for AdbCrypto to
5 | * perform Base64 encoding of its public key.
6 | *
7 | * @author Cameron Gutman
8 | */
9 | public interface AdbBase64 {
10 |
11 | /**
12 | * This function must encoded the specified data as a base 64 string, without
13 | * appending any extra newlines or other characters.
14 | *
15 | * @param data Data to encode
16 | * @return String containing base 64 encoded data
17 | */
18 | String encodeToString(byte[] data);
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/controller/src/main/java/moe/lz233/meizugravity/controller/view/AdjustImageView.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.controller.view;
2 |
3 | import android.content.Context;
4 | import android.graphics.drawable.Drawable;
5 | import android.util.AttributeSet;
6 |
7 | import androidx.annotation.Nullable;
8 |
9 | public class AdjustImageView extends androidx.appcompat.widget.AppCompatImageView {
10 | public AdjustImageView(Context context) {
11 | super(context);
12 | }
13 |
14 | public AdjustImageView(Context context, @Nullable AttributeSet attrs) {
15 | super(context, attrs);
16 | }
17 |
18 | public AdjustImageView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
19 | super(context, attrs, defStyleAttr);
20 | }
21 |
22 | @Override
23 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
24 | Drawable d = getDrawable();
25 | if (d != null) {
26 | int width = MeasureSpec.getSize(widthMeasureSpec);
27 | int height = (int) Math.ceil((float) width * (float) d.getIntrinsicHeight() / (float) d.getIntrinsicWidth());
28 | setMeasuredDimension(width, height);
29 |
30 | } else {
31 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
32 |
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/gravity.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/controller/src/main/res/drawable/gravity.webp
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_back.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_close.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_developer_mode.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_enter.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_graphic_eq.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_keyboard_arrow_down.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_keyboard_arrow_left.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_keyboard_arrow_right.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_keyboard_arrow_up.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_menu.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_more_vert.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_play.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_power.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_rotate.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_settings.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_skip_next.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_skip_previous.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_volume_down.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/drawable/ic_volume_up.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/controller/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
24 |
25 |
26 |
27 |
32 |
33 |
--------------------------------------------------------------------------------
/controller/src/main/res/layout/dialog_run_command.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
16 |
--------------------------------------------------------------------------------
/controller/src/main/res/layout/dialog_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
17 |
--------------------------------------------------------------------------------
/controller/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/controller/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/controller/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/controller/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/controller/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/controller/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/controller/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/controller/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/controller/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/controller/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/controller/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/controller/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/controller/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/controller/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/controller/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/controller/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/controller/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/controller/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/controller/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/controller/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/controller/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/controller/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/controller/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/controller/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3c4043
4 | #202125
5 | #e9eaee
6 | #E0E1E4
7 | #CBCDD1
8 | #3c4043
9 |
--------------------------------------------------------------------------------
/controller/src/main/res/values-zh-rHK/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Gravity Controller
4 | 設置
5 | 運行命令
6 | IP
7 | 端口
8 | 確認
9 | 取消
10 | 不允許為空。
11 | 聲學:
12 | 標準
13 | Dirac
14 | 電台
15 | 流行
16 | 古典
17 | 搖滾
18 | 打開網易雲
19 | 名稱
20 | ID
21 | 設備版本
22 | 設備版本號
23 | BSP 版本
24 | 引導版本
25 | 內核版本
26 |
--------------------------------------------------------------------------------
/controller/src/main/res/values-zh-rMO/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Gravity Controller
4 | 設置
5 | 運行命令
6 | IP
7 | 端口
8 | 確認
9 | 取消
10 | 不允許爲空。
11 | 聲學:
12 | 標準
13 | Dirac
14 | 電臺
15 | 流行
16 | 古典
17 | 搖滾
18 | 打開網易雲
19 | 名稱
20 | ID
21 | 設備版本
22 | 設備版本號
23 | BSP 版本
24 | 引導版本
25 | 內核版本
26 |
--------------------------------------------------------------------------------
/controller/src/main/res/values-zh-rTW/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Gravity Controller
4 | 設定
5 | 執行命令
6 | IP
7 | 埠
8 | 確認
9 | 取消
10 | 不允許為空。
11 | 聲學:
12 | 標準
13 | Dirac
14 | 電臺
15 | 流行
16 | 古典
17 | 搖滾
18 | 開啟網易雲
19 | 名稱
20 | ID
21 | 裝置版本
22 | 裝置版本號
23 | BSP 版本
24 | 引導版本
25 | 核心版本
26 |
--------------------------------------------------------------------------------
/controller/src/main/res/values-zh/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Gravity Controller
4 | 设置
5 | 运行命令
6 | IP
7 | 端口
8 | 确认
9 | 取消
10 | 不允许为空。
11 | 声学:
12 | 标准
13 | Dirac
14 | 电台
15 | 流行
16 | 古典
17 | 摇滚
18 | 打开网易云
19 | 名称
20 | ID
21 | 设备版本
22 | 设备版本号
23 | BSP 版本
24 | 引导版本
25 | 内核版本
26 |
--------------------------------------------------------------------------------
/controller/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #f2f3f5
5 | #202125
6 | #5f6267
7 | #80858b
8 | #FFFFFF
9 |
--------------------------------------------------------------------------------
/controller/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 | 8dp
4 | 20dp
5 |
6 |
--------------------------------------------------------------------------------
/controller/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 |
--------------------------------------------------------------------------------
/controller/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Gravity Controller
3 | Settings
4 | Run command
5 | IP
6 | Port
7 | OK
8 | Cancel
9 | Not allowed to be empty.
10 | Acoustics:
11 | Standard
12 | Dirac
13 | Radio
14 | Pop
15 | Classic
16 | Rock
17 | Open CloudMusic
18 | Name
19 | ID
20 | Device Version
21 | Device Version Code
22 | Bsp Version
23 | Boot Version
24 | Kernel Version
25 | Device Information
26 | The volume may be too loud, confirm the adjustment?
27 | Confirm
28 | Volume Confirmation
29 |
--------------------------------------------------------------------------------
/controller/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
16 |
17 |
18 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/controller/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/controller/src/test/java/moe/lz233/meizugravity/controller/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.controller;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/design/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/design/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.library'
3 | id 'kotlin-android'
4 | }
5 |
6 | android {
7 | compileSdk 32
8 |
9 | defaultConfig {
10 | minSdk 19
11 | targetSdk 32
12 | }
13 |
14 | compileOptions {
15 | sourceCompatibility JavaVersion.VERSION_11
16 | targetCompatibility JavaVersion.VERSION_11
17 | }
18 | kotlinOptions {
19 | jvmTarget = '11'
20 | }
21 | namespace 'moe.lz233.meizugravity.design'
22 | }
23 |
24 | dependencies {
25 | api 'androidx.appcompat:appcompat:1.4.2'
26 | api 'androidx.viewpager2:viewpager2:1.0.0'
27 | api "androidx.multidex:multidex:2.0.1"
28 | api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1'
29 | implementation 'io.github.inflationx:calligraphy3:3.1.1'
30 | implementation 'io.github.inflationx:viewpump:2.0.3'
31 | api 'com.google.zxing:core:3.4.1'
32 | }
--------------------------------------------------------------------------------
/design/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/design/consumer-rules.pro
--------------------------------------------------------------------------------
/design/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/design/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/design/src/main/assets/font.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/design/src/main/assets/font.otf
--------------------------------------------------------------------------------
/design/src/main/java/com/kd/easybarrage/AnimationHelper.java:
--------------------------------------------------------------------------------
1 | package com.kd.easybarrage;
2 |
3 | import android.content.Context;
4 | import android.view.animation.Animation;
5 | import android.view.animation.TranslateAnimation;
6 |
7 | public class AnimationHelper {
8 | public static Animation createTranslateAnim(Context context, int fromX, int toX) {
9 | TranslateAnimation tlAnim = new TranslateAnimation(fromX, toX, 0, 0);
10 | long duration = (long) (Math.abs(toX - fromX) * 1.0f / BarrageTools.getScreenWidth(context) * 3000);
11 | tlAnim.setDuration(duration);
12 | tlAnim.setInterpolator(new DecelerateAccelerateInterpolator());
13 | tlAnim.setFillAfter(true);
14 | return tlAnim;
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/design/src/main/java/com/kd/easybarrage/Barrage.java:
--------------------------------------------------------------------------------
1 | package com.kd.easybarrage;
2 |
3 | import android.graphics.Color;
4 |
5 | public class Barrage {
6 |
7 | private String content;
8 | private int color;
9 | private boolean showBorder;
10 | private int backGroundColor;
11 |
12 | public Barrage(String content) {
13 | this(content, android.R.color.black, false, Color.WHITE);
14 | }
15 |
16 | public Barrage(String content, int color) {
17 | this(content, color, false, Color.WHITE);
18 | }
19 |
20 | public Barrage(String content, boolean showBorder) {
21 | this(content, android.R.color.black, showBorder, Color.WHITE);
22 | }
23 |
24 | public Barrage(String content, int color, int backGroundColor) {
25 | this(content, color, false, backGroundColor);
26 | }
27 |
28 | private Barrage(String content, int color, boolean showBorder, int backGroundColor) {
29 | this.content = content;
30 | this.color = color;
31 | this.showBorder = showBorder;
32 | this.backGroundColor = backGroundColor;
33 | }
34 |
35 | public boolean isShowBorder() {
36 | return showBorder;
37 | }
38 |
39 | public void setShowBorder(boolean showBorder) {
40 | this.showBorder = showBorder;
41 | }
42 |
43 | public String getContent() {
44 | return content;
45 | }
46 |
47 | public void setContent(String content) {
48 | this.content = content;
49 | }
50 |
51 | public int getColor() {
52 | return color;
53 | }
54 |
55 | public void setColor(int color) {
56 | this.color = color;
57 | }
58 |
59 | public int getBackGroundColor() {
60 | return backGroundColor;
61 | }
62 |
63 | public void setBackGroundColor(int backGroundColor) {
64 | this.backGroundColor = backGroundColor;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/design/src/main/java/com/kd/easybarrage/BarrageTools.java:
--------------------------------------------------------------------------------
1 | package com.kd.easybarrage;
2 |
3 | import android.content.Context;
4 | import android.view.WindowManager;
5 |
6 | /**
7 | * Created by shiwei on 2017/8/2.
8 | */
9 |
10 | public class BarrageTools {
11 | public static int getScreenWidth(Context context) {
12 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
13 | return wm.getDefaultDisplay().getWidth();
14 | }
15 |
16 | public static int dp2px(Context context, float dpValue) {
17 | final float scale = context.getResources().getDisplayMetrics().density;
18 | return (int) (dpValue * scale + 0.5f);
19 | }
20 |
21 | public static int px2sp(Context context, float pxValue) {
22 | final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
23 | return (int) (pxValue / fontScale + 0.5f);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/design/src/main/java/com/kd/easybarrage/BorderTextView.java:
--------------------------------------------------------------------------------
1 | package com.kd.easybarrage;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.graphics.Paint;
6 | import android.util.AttributeSet;
7 |
8 | import androidx.appcompat.widget.AppCompatTextView;
9 |
10 | public class BorderTextView extends AppCompatTextView {
11 |
12 | public BorderTextView(Context context, int border_color) {
13 | this(context, null, border_color);
14 | }
15 |
16 | public BorderTextView(Context context, AttributeSet attrs, int border_color) {
17 | super(context, attrs);
18 | this.border_color = border_color;
19 | }
20 |
21 | private final int border_color;
22 |
23 | @Override
24 | protected void onDraw(Canvas canvas) {
25 | Paint paint = new Paint();
26 | paint.setColor(border_color);
27 | paint.setStrokeWidth(5);
28 | canvas.drawLine(0, 0, this.getWidth(), 0, paint);
29 | canvas.drawLine(0, 0, 0, this.getHeight(), paint);
30 | canvas.drawLine(this.getWidth(), 0, this.getWidth(), this.getHeight(), paint);
31 | canvas.drawLine(0, this.getHeight(), this.getWidth(), this.getHeight(), paint);
32 | super.onDraw(canvas);
33 | }
34 | }
--------------------------------------------------------------------------------
/design/src/main/java/com/kd/easybarrage/DecelerateAccelerateInterpolator.java:
--------------------------------------------------------------------------------
1 | package com.kd.easybarrage;
2 |
3 | import android.view.animation.Interpolator;
4 |
5 | public class DecelerateAccelerateInterpolator implements Interpolator {
6 | @Override
7 | public float getInterpolation(float input) {
8 | return (float) (Math.tan((input * 2 - 1) / 4 * Math.PI)) / 2.0f + 0.5f;
9 | }
10 | }
--------------------------------------------------------------------------------
/design/src/main/java/moe/lz233/meizugravity/design/App.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.design
2 |
3 | import android.content.Context
4 | import android.content.SharedPreferences
5 | import androidx.multidex.MultiDexApplication
6 |
7 | open class App(private val spName: String) : MultiDexApplication() {
8 | companion object {
9 | lateinit var context: Context
10 | lateinit var sp: SharedPreferences
11 | lateinit var editor: SharedPreferences.Editor
12 | }
13 |
14 | override fun onCreate() {
15 | super.onCreate()
16 | context = applicationContext
17 | sp = context.getSharedPreferences(spName, MODE_PRIVATE)
18 | editor = sp.edit()
19 | }
20 | }
--------------------------------------------------------------------------------
/design/src/main/java/moe/lz233/meizugravity/design/activity/BaseActivity.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.design.activity
2 |
3 | import android.content.Context
4 | import android.content.pm.ActivityInfo
5 | import android.os.Bundle
6 | import android.view.View
7 | import androidx.appcompat.app.AlertDialog
8 | import androidx.appcompat.app.AppCompatActivity
9 | import io.github.inflationx.calligraphy3.CalligraphyConfig
10 | import io.github.inflationx.calligraphy3.CalligraphyInterceptor
11 | import io.github.inflationx.viewpump.ViewPump
12 | import io.github.inflationx.viewpump.ViewPumpContextWrapper
13 | import kotlinx.coroutines.CoroutineScope
14 | import kotlinx.coroutines.MainScope
15 | import moe.lz233.meizugravity.design.BuildConfig
16 | import moe.lz233.meizugravity.design.utils.SystemPropertyUtil
17 |
18 | abstract class BaseActivity : AppCompatActivity(), CoroutineScope by MainScope() {
19 | override fun onCreate(savedInstanceState: Bundle?) {
20 | super.onCreate(savedInstanceState)
21 | val rootView = findViewById(android.R.id.content)
22 | //横屏
23 | requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
24 | //检测设备
25 | if (!((SystemPropertyUtil.getSystemProperty("ro.udisk.lable") == "A8") or BuildConfig.DEBUG)) {
26 | AlertDialog.Builder(this).apply {
27 | setMessage("?!")
28 | }.create().apply {
29 | setOnDismissListener { finish() }
30 | show()
31 | }
32 | }
33 | //全局自定义字体
34 | ViewPump.init(ViewPump.builder()
35 | .addInterceptor(CalligraphyInterceptor(CalligraphyConfig.Builder()
36 | .setDefaultFontPath("font.otf")
37 | .setFontAttrId(io.github.inflationx.calligraphy3.R.attr.fontPath)
38 | .build()))
39 | .build())
40 | }
41 |
42 | override fun attachBaseContext(newBase: Context) {
43 | super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase))
44 | }
45 | }
--------------------------------------------------------------------------------
/design/src/main/java/moe/lz233/meizugravity/design/utils/LogUtil.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.design.utils
2 |
3 | import android.os.Handler
4 | import android.os.Looper
5 | import android.widget.Toast
6 | import moe.lz233.meizugravity.design.App
7 | import android.util.Log as ALog
8 |
9 | object LogUtil {
10 |
11 | private const val maxLength = 4000
12 | private val handler by lazy { Handler(Looper.getMainLooper()) }
13 |
14 | @JvmStatic
15 | @JvmOverloads
16 | fun toast(msg: String, duration: Int = Toast.LENGTH_SHORT, force: Boolean = true) {
17 | if (!force) return
18 | handler.post { ToastUtil.show(App.context, msg, duration) }
19 | }
20 |
21 | @JvmStatic
22 | private fun doLog(f: (String, String) -> Int, obj: Any?) {
23 | val str = if (obj is Throwable) ALog.getStackTraceString(obj) else obj.toString()
24 | if (str.length > maxLength) {
25 | val chunkCount: Int = str.length / maxLength
26 | for (i in 0..chunkCount) {
27 | val max: Int = 4000 * (i + 1)
28 | if (max >= str.length) {
29 | doLog(f, str.substring(maxLength * i))
30 | } else {
31 | doLog(f, str.substring(maxLength * i, max))
32 | }
33 | }
34 | } else {
35 | f("MEIZUGRAVITY", str)
36 | toast(str, force = false)
37 | }
38 | }
39 |
40 | @JvmStatic
41 | fun d(obj: Any?) {
42 | doLog(ALog::d, obj)
43 | }
44 |
45 | @JvmStatic
46 | fun i(obj: Any?) {
47 | doLog(ALog::i, obj)
48 | }
49 |
50 | @JvmStatic
51 | fun e(obj: Any?) {
52 | doLog(ALog::e, obj)
53 | }
54 |
55 | @JvmStatic
56 | fun v(obj: Any?) {
57 | doLog(ALog::v, obj)
58 | }
59 |
60 | @JvmStatic
61 | fun w(obj: Any?) {
62 | doLog(ALog::w, obj)
63 | }
64 | }
--------------------------------------------------------------------------------
/design/src/main/java/moe/lz233/meizugravity/design/utils/SystemPropertyUtil.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.design.utils;
2 |
3 | import java.io.BufferedReader;
4 | import java.io.IOException;
5 | import java.io.InputStreamReader;
6 | import java.util.Properties;
7 |
8 | /**
9 | * Android 系统属性读取工具类
10 | * Created by Zhuliya on 2018/10/22
11 | */
12 | public class SystemPropertyUtil {
13 |
14 | /**
15 | * 使用命令方式读取系统属性
16 | *
17 | * @param propName
18 | * @return
19 | */
20 | public static String getSystemProperty(String propName) {
21 | String line;
22 | BufferedReader input = null;
23 | try {
24 | Process p = Runtime.getRuntime().exec("getprop " + propName);
25 | input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024);
26 | line = input.readLine();
27 | input.close();
28 | } catch (IOException e) {
29 | //Log.e("Unable to read sysprop " + propName, ex);
30 | return null;
31 | } finally {
32 | if (input != null) {
33 | try {
34 | input.close();
35 | } catch (IOException e) {
36 | //Log.e("Exception while closing InputStream", e);
37 | }
38 | }
39 | }
40 | return line;
41 | }
42 |
43 | /**
44 | * 读取系统属性,装载至Properties
45 | *
46 | * @return
47 | */
48 | public static Properties getProperty() {
49 | Properties properties = new Properties();
50 | try {
51 | Process p = Runtime.getRuntime().exec("getprop");
52 | properties.load(p.getInputStream());
53 | } catch (IOException e) {
54 | e.printStackTrace();
55 | }
56 | return properties;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/design/src/main/java/moe/lz233/meizugravity/design/utils/ViewPager2Util.java:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.design.utils;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 | import android.view.animation.AccelerateDecelerateInterpolator;
6 |
7 | import androidx.viewpager2.widget.ViewPager2;
8 |
9 | public class ViewPager2Util {
10 | /**
11 | * 保存前一个animatedValue
12 | */
13 | private static int previousValue;
14 |
15 | /**
16 | * 设置当前Item
17 | *
18 | * @param pager viewpager2
19 | * @param item 下一个跳转的item
20 | * @param duration scroll时长
21 | */
22 | public static void setCurrentItem(final ViewPager2 pager, int item, long duration, int padding) {
23 | previousValue = 0;
24 | int currentItem = pager.getCurrentItem();
25 | int pagePxHeight = pager.getHeight();
26 | //减掉边距
27 | int pxToDrag = (pagePxHeight - padding) * (item - currentItem);
28 | final ValueAnimator animator = ValueAnimator.ofInt(0, pxToDrag);
29 | animator.addUpdateListener(animation -> {
30 | int currentValue = (int) animation.getAnimatedValue();
31 | float currentPxToDrag = (float) (currentValue - previousValue);
32 | pager.fakeDragBy(-currentPxToDrag);
33 | previousValue = currentValue;
34 | });
35 | animator.addListener(new Animator.AnimatorListener() {
36 | @Override
37 | public void onAnimationStart(Animator animation) {
38 | pager.beginFakeDrag();
39 | }
40 |
41 | @Override
42 | public void onAnimationEnd(Animator animation) {
43 | pager.endFakeDrag();
44 | }
45 |
46 | @Override
47 | public void onAnimationCancel(Animator animation) {
48 | }
49 |
50 | @Override
51 | public void onAnimationRepeat(Animator animation) {
52 | }
53 | });
54 | animator.setInterpolator(new AccelerateDecelerateInterpolator());
55 | animator.setDuration(duration);
56 | animator.start();
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/design/src/main/java/moe/lz233/meizugravity/design/utils/ktx/Boolean.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.design.utils.ktx
2 |
3 | fun Boolean.toInt() = if (this) 1 else 0
--------------------------------------------------------------------------------
/design/src/main/res/drawable/bgstyle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/design/src/main/res/drawable/button_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/design/src/main/res/drawable/button_shape_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
9 |
--------------------------------------------------------------------------------
/design/src/main/res/drawable/button_shape_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
9 |
--------------------------------------------------------------------------------
/design/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #9E9E9E
4 | #FF4081
5 | #F8BBD0
6 | #809E9E9E
7 | #809E9E9E
8 |
--------------------------------------------------------------------------------
/design/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1000
4 | 16sp
5 | 12sp
6 | 16dp
7 | 1dp
8 | 30dp
9 | 40dp
10 |
--------------------------------------------------------------------------------
/design/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 暂无歌词
3 |
4 |
--------------------------------------------------------------------------------
/docs/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .temp
3 | .cache
4 |
--------------------------------------------------------------------------------
/docs/.vuepress/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | lang: 'zh-CN',
3 | title: 'Meizu Gravity',
4 | head: [['link', { rel: 'icon', href: '/images/fav.png' }]],
5 | description: 'Let this screen do what it should do.',
6 |
7 | themeConfig: {
8 | logo: null,
9 | navbar: [
10 | {
11 | text: '应用',
12 | link: 'application.md',
13 | },
14 | {
15 | text: 'GitHub',
16 | link: 'https://github.com/lz233/MeizuGravity',
17 | },
18 | ],
19 | // 侧边栏对象
20 | // 不同子路径下的页面会使用不同的侧边栏
21 | sidebar: "auto",
22 | },
23 | markdown: {
24 | extractHeaders: {
25 | level: [1,2,3],
26 | },
27 | },
28 | dest: 'public',
29 | }
--------------------------------------------------------------------------------
/docs/.vuepress/public/images/fav.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/docs/.vuepress/public/images/fav.png
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | home: true
3 | ---
4 |
5 | [Get Started
](application.md)
6 |
--------------------------------------------------------------------------------
/docs/application.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "应用"
3 | ---
4 |
5 | # Meizu Gravity +
6 |
7 | Meizu Gravity + 可以在你使用 DLNA 串流时显示歌词。另外也包含一些小功能。
8 |
9 | ## 部署
10 |
11 | 1. 下载项目中的 ./gravity/A8Speaker5.apk 和 [Release APK](https://github.com/lz233/MeizuGravity/releases)。
12 |
13 | 2. 通过 TCP/IP 连接到 Meizu Gravity,端口号 7788。
14 |
15 | ```bash
16 | > adb connect 192.168.xx.xxx:7788
17 | # connected to 192.168.xx.xxx:7788
18 | > adb devices
19 | # List of devices attached
20 | # 192.168.xx.xxx:7788 device
21 | ```
22 |
23 | 3. 安装 A8Speaker5.apk 和 Release APK。
24 |
25 | ```bash
26 | > adb install -r A8Speaker5.apk
27 | # pkg: /sdcard/A8Speaker5.apk
28 | # Success
29 | > adb install app-release.apk
30 | # pkg: /sdcard/app-release.apk
31 | # Success
32 | ```
33 |
34 | 5. 在首页长按「下一首」按键,进入「Meizu Gravity +」。
35 |
36 | ## 配置
37 |
38 | 1. 参见应用内的设置。
39 |
40 | ## 还原
41 |
42 | 1. 卸载 Meizu Gravity + 和 Speaker。
43 |
44 | ```bash
45 | > adb uninstall com.meizu.speaker
46 | # Success
47 | > adb uninstall moe.lz233.meizugravity
48 | # Success
49 | ```
50 |
51 | # Meizu Gravity Controller
52 |
53 | Meizu Gravity Controller 可以替代官方~~鸡肋~~客户端的一些功能,并进行一些扩展,例如触摸板、远程命令。
54 |
55 |
56 |
57 | # Netease Cloud Music For Gravity
58 |
59 | Netease Cloud Music For Gravity 是一个专门为 Gravity 适配的网易云第三方客户端。
60 |
61 | ## 部署
62 |
63 | 安装方法参见 [Meizu Gravity +](#部署),此处不再赘述。
64 |
65 | ## 截图
66 |
67 | 
68 |
69 | 
70 |
71 | 
--------------------------------------------------------------------------------
/docs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "MeizuGravity",
3 | "version": "1.0.0",
4 | "description": "Let this screen do what it should do.",
5 | "main": "index.js",
6 | "repository": "https://github.com/lz233/MeizuGravity",
7 | "author": "lz233",
8 | "license": "MIT",
9 | "devDependencies": {
10 | "vuepress": "^2.0.0-beta.27"
11 | },
12 | "scripts": {
13 | "dev": "vuepress dev",
14 | "build": "vuepress build"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon May 03 13:11:04 CST 2021
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
7 |
--------------------------------------------------------------------------------
/mediaplayer/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/mediaplayer/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'kotlin-android'
3 | group = 'com.github.IAmWilling'
4 |
5 | android {
6 | compileSdkVersion 31
7 | buildToolsVersion "31.0.0"
8 |
9 | defaultConfig {
10 | minSdkVersion 19
11 | targetSdkVersion 31
12 |
13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14 | consumerProguardFiles "consumer-rules.pro"
15 | ndkVersion '22.1.7171670'
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 |
25 | sourceSets {
26 | main {
27 | jniLibs.srcDirs = ['libs']
28 | }
29 | }
30 | compileOptions {
31 | sourceCompatibility JavaVersion.VERSION_11
32 | targetCompatibility JavaVersion.VERSION_11
33 | }
34 | kotlinOptions {
35 | jvmTarget = '11'
36 | }
37 | namespace 'com.zhy.mediaplayer_exo'
38 | }
39 |
40 | dependencies {
41 | implementation fileTree(dir: "libs", include: ["*.jar"])
42 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
43 | implementation 'androidx.core:core-ktx:1.7.0'
44 | //2.14.2
45 | api 'com.google.android.exoplayer:exoplayer:2.14.2'
46 | api 'com.google.android.exoplayer:extension-okhttp:2.14.2'
47 | compileOnly 'org.checkerframework:checker-qual:3.16.0'
48 | }
--------------------------------------------------------------------------------
/mediaplayer/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/mediaplayer/consumer-rules.pro
--------------------------------------------------------------------------------
/mediaplayer/libs/armeabi-v7a/libflacJNI.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/mediaplayer/libs/armeabi-v7a/libflacJNI.so
--------------------------------------------------------------------------------
/mediaplayer/libs/x86/libflacJNI.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/mediaplayer/libs/x86/libflacJNI.so
--------------------------------------------------------------------------------
/mediaplayer/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 | -keep class com.google.android.exoplayer2.ext.** {*;}
--------------------------------------------------------------------------------
/mediaplayer/src/androidTest/java/com/zhy/mediaplayer_exo/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.zhy.mediaplayer_exo
2 |
3 | import androidx.test.ext.junit.runners.AndroidJUnit4
4 | import androidx.test.platform.app.InstrumentationRegistry
5 | import org.junit.Assert.*
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | /**
10 | * Instrumented test, which will execute on an Android device.
11 | *
12 | * See [testing documentation](http://d.android.com/tools/testing).
13 | */
14 | @RunWith(AndroidJUnit4::class)
15 | class ExampleInstrumentedTest {
16 | @Test
17 | fun useAppContext() {
18 | // Context of the app under test.
19 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
20 | assertEquals("com.zhy.mediaplayer_exo.test", appContext.packageName)
21 | }
22 | }
--------------------------------------------------------------------------------
/mediaplayer/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/mediaplayer/src/main/java/com/google/android/exoplayer2/ext/flac/FlacDecoderException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.ext.flac;
17 |
18 | import com.google.android.exoplayer2.decoder.DecoderException;
19 |
20 | /**
21 | * Thrown when an Flac decoder error occurs.
22 | */
23 | public final class FlacDecoderException extends DecoderException {
24 |
25 | /* package */ FlacDecoderException(String message) {
26 | super(message);
27 | }
28 |
29 | /* package */ FlacDecoderException(String message, Throwable cause) {
30 | super(message, cause);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/mediaplayer/src/main/java/com/google/android/exoplayer2/ext/flac/FlacLibrary.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.ext.flac;
17 |
18 | import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
19 | import com.google.android.exoplayer2.util.LibraryLoader;
20 |
21 | /**
22 | * Configures and queries the underlying native library.
23 | */
24 | public final class FlacLibrary {
25 |
26 | static {
27 | ExoPlayerLibraryInfo.registerModule("goog.exo.flac");
28 | }
29 |
30 | private static final LibraryLoader LOADER = new LibraryLoader("flacJNI");
31 |
32 | private FlacLibrary() {
33 | }
34 |
35 | /**
36 | * Override the names of the Flac native libraries. If an application wishes to call this method,
37 | * it must do so before calling any other method defined by this class, and before instantiating
38 | * any {@link LibflacAudioRenderer} and {@link FlacExtractor} instances.
39 | *
40 | * @param libraries The names of the Flac native libraries.
41 | */
42 | public static void setLibraries(String... libraries) {
43 | LOADER.setLibraries(libraries);
44 | }
45 |
46 | /**
47 | * Returns whether the underlying library is available, loading it if necessary.
48 | */
49 | public static boolean isAvailable() {
50 | return LOADER.isAvailable();
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/mediaplayer/src/main/java/com/google/android/exoplayer2/ext/flac/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | @NonNullApi
17 | package com.google.android.exoplayer2.ext.flac;
18 |
19 | import com.google.android.exoplayer2.util.NonNullApi;
20 |
--------------------------------------------------------------------------------
/mediaplayer/src/main/java/com/zhy/mediaplayer_exo/playermanager/MediaErrorListener.kt:
--------------------------------------------------------------------------------
1 | package com.zhy.mediaplayer_exo.playermanager
2 |
3 | interface MediaErrorListener {
4 | fun onMediaError()
5 | }
--------------------------------------------------------------------------------
/mediaplayer/src/main/java/com/zhy/mediaplayer_exo/playermanager/MediaPlayStateListaner.kt:
--------------------------------------------------------------------------------
1 | package com.zhy.mediaplayer_exo.playermanager
2 |
3 | /**
4 | * Created by zhy
5 | * Date 2021/2/25
6 | *
7 | * 音频状态监听
8 | *
9 | */
10 | interface MediaPlayStateListaner {
11 | /**
12 | * state
13 | * exoplayer -> Player接口中
14 | */
15 | fun onMediaPlayState(state: Int)
16 | }
--------------------------------------------------------------------------------
/mediaplayer/src/main/java/com/zhy/mediaplayer_exo/playermanager/MediaPlayerExoPlayMode.kt:
--------------------------------------------------------------------------------
1 | package com.zhy.mediaplayer_exo.playermanager
2 |
3 | /**
4 | * 媒体播放模式
5 | */
6 | annotation class MediaPlayerExoPlayMode {
7 | companion object {
8 | //音频列表循环
9 | val MEDIA_LIST_LOOP = 1
10 |
11 | //音频单曲循环
12 | val MEDIA_ALONE_LOOP = 2
13 |
14 | //音频列表随机播放
15 | val MEDIA_LSIT_RANDOM = 3
16 |
17 | //音频列表顺序播放
18 | val MEDIA_LIST_ORDER_PLAY = 4
19 | }
20 | }
--------------------------------------------------------------------------------
/mediaplayer/src/main/java/com/zhy/mediaplayer_exo/playermanager/MediaProgressListener.kt:
--------------------------------------------------------------------------------
1 | package com.zhy.mediaplayer_exo.playermanager
2 |
3 | /**
4 | * 音频进度监听
5 | */
6 | interface MediaProgressListener {
7 | //当前媒体进度
8 | fun onProgressChange(position: Long, duration: Long)
9 | }
--------------------------------------------------------------------------------
/mediaplayer/src/main/java/com/zhy/mediaplayer_exo/playermanager/MediaSwitchTrackChange.kt:
--------------------------------------------------------------------------------
1 | package com.zhy.mediaplayer_exo.playermanager
2 |
3 | /**
4 | * 音频声音改变
5 | */
6 | interface MediaSwitchTrackChange {
7 | fun onTracksChange(playlistItem: PlaylistItem)
8 | }
--------------------------------------------------------------------------------
/mediaplayer/src/main/java/com/zhy/mediaplayer_exo/playermanager/PlaylistItem.kt:
--------------------------------------------------------------------------------
1 | package com.zhy.mediaplayer_exo.playermanager
2 |
3 | /**
4 | * 播放item接口
5 | * 任何音频数据结构需要实现此接口
6 | */
7 | interface PlaylistItem {
8 | val id: Long
9 | val mvId: Long
10 | val name: String?
11 | val artistId: List?
12 | val artistName: String?
13 | val albumId: Long?
14 | val albumName: String?
15 | val coverUrl: String?
16 | val mediaUrl: String?
17 | }
--------------------------------------------------------------------------------
/mediaplayer/src/main/java/com/zhy/mediaplayer_exo/playermanager/meta/PlayListItem.kt:
--------------------------------------------------------------------------------
1 | package com.zhy.mediaplayer_exo.playermanager.meta
2 |
3 | import com.zhy.mediaplayer_exo.playermanager.PlaylistItem
4 |
5 | class PlayListItem(override val id: Long,
6 | override val mvId: Long,
7 | override val name: String?,
8 | override val artistId: List?,
9 | override val artistName: String?,
10 | override val albumId: Long?,
11 | override val albumName: String?,
12 | override val coverUrl: String?,
13 | override val mediaUrl: String?) : PlaylistItem
--------------------------------------------------------------------------------
/mediaplayer/src/test/java/com/zhy/mediaplayer_exo/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.zhy.mediaplayer_exo
2 |
3 | import org.junit.Assert.*
4 | import org.junit.Test
5 |
6 | /**
7 | * Example local unit test, which will execute on the development machine (host).
8 | *
9 | * See [testing documentation](http://d.android.com/tools/testing).
10 | */
11 | class ExampleUnitTest {
12 | @Test
13 | fun addition_isCorrect() {
14 | assertEquals(4, 2 + 2)
15 | }
16 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/neteasecloudmusic/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
23 | -keep class moe.lz233.meizugravity.cloudmusic.logic.model.** {*;}
--------------------------------------------------------------------------------
/neteasecloudmusic/src/androidTest/java/moe/lz233/meizugravity/cloudmusic/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic
2 |
3 | import org.junit.Test
4 | import org.junit.runner.RunWith
5 | import org.junit.runners.JUnit4
6 |
7 | /**
8 | * Instrumented test, which will execute on an Android device.
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | @RunWith(JUnit4::class)
13 | class ExampleInstrumentedTest {
14 | @Test
15 | fun useAppContext() {
16 | // Context of the app under test.
17 | //val appContext = InstrumentationRegistry.getInstrumentation().targetContext
18 | //assertEquals("moe.lz233.meizugravity.cloudmusic", appContext.packageName)
19 | }
20 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
14 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
27 |
30 |
33 |
36 |
39 |
42 |
45 |
48 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/assets/font.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/neteasecloudmusic/src/main/assets/font.otf
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/App.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic
2 |
3 | import com.google.android.exoplayer2.SimpleExoPlayer
4 | import com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource
5 | import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory
6 | import com.google.android.exoplayer2.source.DefaultMediaSourceFactory
7 | import com.zhy.mediaplayer_exo.playermanager.MediaPlayerService
8 | import moe.lz233.meizugravity.cloudmusic.logic.network.ServiceCreator
9 | import moe.lz233.meizugravity.design.App
10 | import org.conscrypt.Conscrypt
11 | import java.security.Security
12 |
13 | class App : App(BuildConfig.APPLICATION_ID) {
14 |
15 | override fun onCreate() {
16 | super.onCreate()
17 | Security.insertProviderAt(Conscrypt.newProvider(), 1)
18 | //设置固定码率 比特率 某些音频格式文件,在seekTo的时候无法找到对应的节点导致无法跳播,此代码可以解决这个问题
19 | /*val extractorsFactory = DefaultExtractorsFactory().setConstantBitrateSeekingEnabled(true)
20 | val audioAttributes = AudioAttributes.Builder()
21 | .setUsage(C.USAGE_MEDIA)
22 | .setContentType(C.CONTENT_TYPE_MUSIC)
23 | .build()*/
24 | MediaPlayerService.init(this, SimpleExoPlayer.Builder(this, DefaultExtractorsFactory())
25 | //.setAudioAttributes(audioAttributes, true)
26 | .setMediaSourceFactory(DefaultMediaSourceFactory(OkHttpDataSource.Factory(ServiceCreator.exoPlayerOkHttpClient)))
27 | .build())
28 | }
29 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/dao/BaseDao.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.dao
2 |
3 | import moe.lz233.meizugravity.design.App.Companion.editor
4 | import moe.lz233.meizugravity.design.App.Companion.sp
5 |
6 | object BaseDao {
7 | var soundQuality: Int
8 | get() = sp.getInt("soundQuality", 999000)
9 | set(value) = editor.putInt("soundQuality", value).apply()
10 |
11 | var screenBrightness: Float
12 | get() = sp.getFloat("screenBrightness", 0.1f)
13 | set(value) = editor.putFloat("screenBrightness", value).apply()
14 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/dao/UserDao.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.dao
2 |
3 | import moe.lz233.meizugravity.design.App.Companion.editor
4 | import moe.lz233.meizugravity.design.App.Companion.sp
5 |
6 | object UserDao {
7 | var isLogin: Boolean
8 | get() = sp.getBoolean("userLogin", false)
9 | set(value) = editor.putBoolean("userLogin", value).apply()
10 |
11 | var id: Long
12 | get() = sp.getLong("userId", 0)
13 | set(value) = editor.putLong("userId", value).apply()
14 |
15 | var cookie: String
16 | get() = sp.getString("userCookie", "")!!
17 | set(value) = editor.putString("userCookie", value).apply()
18 |
19 | var name: String
20 | get() = sp.getString("userName", "")!!
21 | set(value) = editor.putString("userName", value).apply()
22 |
23 | var type: Int
24 | get() = sp.getInt("userType", 0)
25 | set(value) = editor.putInt("userType", value).apply()
26 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/model/meta/Album.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.model.meta
2 |
3 | data class Album(val id: Long, val name: String, val picUrl: String)
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/model/meta/Artist.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.model.meta
2 |
3 | data class Artist(val id: Long, val name: String)
4 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/model/meta/Comment.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.model.meta
2 |
3 | data class Comment(val user: User,
4 | val content: String)
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/model/meta/Music.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.model.meta
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class Music(val id: Long,
6 | @SerializedName("mv") val mvId: Long,
7 | val name: String,
8 | @SerializedName("ar") val artists: List,
9 | @SerializedName("al") val album: Album)
10 |
11 | data class MusicUrl(val id: Long,
12 | val url: String,
13 | @SerializedName("br") val bitRate: Long,
14 | val size: Long,
15 | val type: String)
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/model/meta/PlayList.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.model.meta
2 |
3 | data class PlayList(val id: Long,
4 | val name: String,
5 | val trackCount: Int,
6 | val specialType: Int, //官方动态歌单是 100 来着
7 | val coverImgUrl: String,
8 | val creator: User,
9 | val tracks: List)
10 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/model/meta/User.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.model.meta
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class User(val userId: Long,
6 | @SerializedName("nickname") val nickName: String,
7 | val avatarUrl: String,
8 | @SerializedName("signature") val bio: String?,
9 | val userType: Int)
10 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/model/response/LoginResponse.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.model.response
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class KeyResponse(val code: Int, @SerializedName("unikey") val key: String)
6 |
7 | data class CheckQrResponse(val code: Int, val message: String, val cookie: String)
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/model/response/PlaylistResponse.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.model.response
2 |
3 | import moe.lz233.meizugravity.cloudmusic.logic.model.meta.PlayList
4 |
5 | data class PlaylistDetailResponse(val code: Int, val playlist: PlayList)
6 |
7 | data class ModifyPlayListTracksResponse(val code: Int, val message: String?)
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/model/response/RecommendResponse.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.model.response
2 |
3 | import com.google.gson.annotations.SerializedName
4 | import moe.lz233.meizugravity.cloudmusic.logic.model.meta.Music
5 |
6 | data class DailyRecommendationResponse(val code: Int, val data: DailyRecommendationData) {
7 | data class DailyRecommendationData(@SerializedName("dailySongs") val songs: List)
8 | }
9 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/model/response/SongResponse.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.model.response
2 |
3 | import com.google.gson.annotations.SerializedName
4 | import moe.lz233.meizugravity.cloudmusic.logic.model.meta.Comment
5 | import moe.lz233.meizugravity.cloudmusic.logic.model.meta.MusicUrl
6 |
7 | data class SongUrlResponse(val code: Int, val data: List)
8 |
9 | data class SongLyricResponse(val code: Int,
10 | val uncollected: Boolean?,
11 | @SerializedName("nolyric") val noLyric: Boolean?,
12 | @SerializedName("lrc") val lyric: LyricData?,
13 | @SerializedName("tlyric") val translatedLyric: LyricData?) {
14 | data class LyricData(val version: Int, val lyric: String)
15 | }
16 |
17 | data class SongCommentResponse(val hotComments: List, val comments: List)
18 |
19 | data class SongLikeResponse(val code: Int, val playListId: Long)
20 |
21 | data class MvDetailResponse(val code: Int, val data: MvDetailData) {
22 | data class MvDetailData(@SerializedName("id") val mvId: Long,
23 | val artistId: Long,
24 | @SerializedName("cover") val coverUrl: String,
25 | @SerializedName("brs") val resolutionData: List) {
26 | data class MvResolutionData(val size: Long, @SerializedName("br") val resolution: Int, val point: Int)
27 | }
28 | }
29 |
30 | data class MvUrlResponse(val code: Int, val data: MvUrlData) {
31 | data class MvUrlData(val id: Long, val url: String)
32 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/model/response/UserResponse.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.model.response
2 |
3 | import com.google.gson.annotations.SerializedName
4 | import moe.lz233.meizugravity.cloudmusic.logic.model.meta.PlayList
5 | import moe.lz233.meizugravity.cloudmusic.logic.model.meta.User
6 |
7 | data class AccountInfoResponse(val code: Int, val profile: User)
8 |
9 | data class UserPlaylistResponse(val code: Int, val version: String, val more: Boolean, @SerializedName("playlist") val playlists: List)
10 |
11 | data class CheckInResponse(val code: Int, val point: Int?, @SerializedName("msg") val message: String?)
12 |
13 | data class YunbeiCheckInResponse(val code: Int, val point: Int?, @SerializedName("msg") val message: String?)
14 |
15 | data class MusicianCheckInResponse(val code: Int)
16 |
17 | data class MusicianTasksResponse(val code: Int, val data: MusicianTasksList) {
18 | data class MusicianTasksList(@SerializedName("list") val tasks: List) {
19 | data class MusicianTask(@SerializedName("description") val name: String,
20 | val userMissionId: Long?,
21 | val status: Int?,
22 | val period: Int,
23 | val rewardWorth: String)
24 | }
25 | }
26 |
27 | data class MusicianObtainTasksResponse(val code: Int, val message: String)
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/network/ServiceCreator.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.network
2 |
3 | import moe.lz233.meizugravity.cloudmusic.BuildConfig
4 | import moe.lz233.meizugravity.cloudmusic.logic.network.interceptor.ExoPlayerInterceptor
5 | import moe.lz233.meizugravity.cloudmusic.logic.network.interceptor.HttpLogger
6 | import moe.lz233.meizugravity.cloudmusic.logic.network.interceptor.RequestInterceptor
7 | import okhttp3.OkHttpClient
8 | import okhttp3.logging.HttpLoggingInterceptor
9 | import retrofit2.Retrofit
10 | import retrofit2.converter.gson.GsonConverterFactory
11 | import java.util.concurrent.TimeUnit
12 |
13 | object ServiceCreator {
14 | const val BASE_HOST = "music.163.com"
15 | const val BASE_URL = "https://$BASE_HOST"
16 |
17 | private val okHttpClient = OkHttpClient.Builder()
18 | .addNetworkInterceptor(HttpLoggingInterceptor(HttpLogger()).apply {
19 | if (BuildConfig.DEBUG) level = HttpLoggingInterceptor.Level.BODY
20 | })
21 | .addInterceptor(RequestInterceptor())
22 | .retryOnConnectionFailure(true)
23 | .callTimeout(20, TimeUnit.SECONDS)
24 | .build()
25 |
26 | val exoPlayerOkHttpClient: OkHttpClient = OkHttpClient.Builder()
27 | .addInterceptor(ExoPlayerInterceptor())
28 | .retryOnConnectionFailure(true)
29 | .callTimeout(20, TimeUnit.SECONDS)
30 | .build()
31 |
32 |
33 | private val retrofit by lazy {
34 | Retrofit.Builder()
35 | .baseUrl(BASE_URL)
36 | .addConverterFactory(GsonConverterFactory.create())
37 | .client(okHttpClient)
38 | .build()
39 | }
40 |
41 | fun create(serviceClass: Class): T = retrofit.create(serviceClass)
42 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/network/interceptor/ExoPlayerInterceptor.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.network.interceptor
2 |
3 | import moe.lz233.meizugravity.cloudmusic.utils.ktx.processEapi
4 | import moe.lz233.meizugravity.design.utils.LogUtil
5 | import okhttp3.Interceptor
6 | import okhttp3.Response
7 | import org.json.JSONObject
8 |
9 | class ExoPlayerInterceptor : Interceptor {
10 | override fun intercept(chain: Interceptor.Chain): Response {
11 | return if (chain.request().url().encodedPath().contains("eapi")) {
12 | val response = chain.processEapi()
13 | val body = response.body()!!.string()
14 | val url = JSONObject(body)
15 | .getJSONArray("data")
16 | .getJSONObject(0)
17 | .getString("url")
18 | LogUtil.d("music url: $url")
19 | chain.proceed(chain.request().newBuilder()
20 | .url(url)
21 | .get()
22 | .build())
23 | } else {
24 | chain.proceed(chain.request())
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/network/interceptor/HttpLogger.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.network.interceptor
2 |
3 | import moe.lz233.meizugravity.design.utils.LogUtil
4 | import okhttp3.logging.HttpLoggingInterceptor
5 |
6 | class HttpLogger : HttpLoggingInterceptor.Logger {
7 | override fun log(message: String) {
8 | LogUtil.d(message)
9 | }
10 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/network/interceptor/RequestInterceptor.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.network.interceptor
2 |
3 | import moe.lz233.meizugravity.cloudmusic.logic.dao.UserDao
4 | import moe.lz233.meizugravity.cloudmusic.utils.ktx.processEapi
5 | import okhttp3.Interceptor
6 | import okhttp3.Response
7 |
8 | class RequestInterceptor : Interceptor {
9 | override fun intercept(chain: Interceptor.Chain): Response {
10 | val response = chain.processEapi()
11 | response.headers("Set-Cookie").forEach {
12 | if (it.contains("MUSIC_U"))
13 | UserDao.cookie = it.substring(it.indexOf("MUSIC_U=") + 8, it.indexOf(';'))
14 | }
15 | return response
16 | }
17 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/network/service/LoginService.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.network.service
2 |
3 | import moe.lz233.meizugravity.cloudmusic.logic.model.response.CheckQrResponse
4 | import moe.lz233.meizugravity.cloudmusic.logic.model.response.KeyResponse
5 | import retrofit2.Call
6 | import retrofit2.http.GET
7 | import retrofit2.http.Query
8 |
9 | interface LoginService {
10 | @GET("/eapi/login/qrcode/unikey")
11 | fun getKey(@Query("type") type: Int): Call
12 |
13 | @GET("/eapi/login/qrcode/client/login")
14 | fun checkQrStatus(@Query("key") key: String, @Query("type") type: Int): Call
15 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/network/service/PlaylistService.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.network.service
2 |
3 | import moe.lz233.meizugravity.cloudmusic.logic.model.response.ModifyPlayListTracksResponse
4 | import moe.lz233.meizugravity.cloudmusic.logic.model.response.PlaylistDetailResponse
5 | import retrofit2.Call
6 | import retrofit2.http.GET
7 | import retrofit2.http.Query
8 |
9 | interface PlaylistService {
10 | @GET("/eapi/v6/playlist/detail")
11 | fun getPlaylistDetail(@Query("id") playlistId: Long, @Query("n") n: Int = 100000, @Query("s") s: Int = 0): Call
12 |
13 | @GET("/eapi/playlist/manipulate/tracks")
14 | fun modifyPlayListTracks(@Query("op") operation: String, @Query("pid") playlistId: Long, @Query("trackIds") MusicIds: String, @Query("imme") imme: Boolean = true): Call
15 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/network/service/RecommendService.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.network.service
2 |
3 | import moe.lz233.meizugravity.cloudmusic.logic.model.response.DailyRecommendationResponse
4 | import retrofit2.Call
5 | import retrofit2.http.GET
6 |
7 | interface RecommendService {
8 | @GET("/eapi/v3/discovery/recommend/songs")
9 | fun getDailyRecommendation(): Call
10 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/network/service/SongService.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.network.service
2 |
3 | import moe.lz233.meizugravity.cloudmusic.logic.dao.BaseDao
4 | import moe.lz233.meizugravity.cloudmusic.logic.model.response.*
5 | import retrofit2.Call
6 | import retrofit2.http.GET
7 | import retrofit2.http.Path
8 | import retrofit2.http.Query
9 |
10 | interface SongService {
11 | @GET("/eapi/song/enhance/player/url")
12 | fun getSongUrl(@Query("id") musicId: Long, @Query("br") bitRate: Int = BaseDao.soundQuality): Call
13 |
14 | @GET("/eapi/v1/mv/detail")
15 | fun getMvDetail(@Query("id") mvId: Long): Call
16 |
17 | @GET("/eapi/song/enhance/play/mv/url")
18 | fun getMvUrl(@Query("id") mvId: Long, @Query("r") resolution: Int): Call
19 |
20 | @GET("/eapi/song/lyric")
21 | fun getSongLyric(@Query("id") musicId: Long, @Query("lv") lv: Int = -1, @Query("kv") kv: Int = -1, @Query("tv") tv: Int = -1): Call
22 |
23 | @GET("/api/v1/resource/comments/R_SO_4_{id}")
24 | fun getSongComment(@Path("id") musicId: Long, @Query("rid") id: Long = musicId, @Query("limit") limit: Int = 20, @Query("offset") offset: Int = 0, @Query("beforeTime") beforeTime: Int = 0): Call
25 |
26 | @GET("/eapi/song/like")
27 | fun likeMusic(@Query("trackId") musicId: Long, @Query("like") operation: Boolean = true): Call
28 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/logic/network/service/UserService.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.logic.network.service
2 |
3 | import moe.lz233.meizugravity.cloudmusic.logic.model.response.*
4 | import retrofit2.Call
5 | import retrofit2.http.GET
6 | import retrofit2.http.Query
7 |
8 | interface UserService {
9 | @GET("/eapi/nuser/account/get")
10 | fun getAccountInfo(): Call
11 |
12 | @GET("/eapi/user/playlist")
13 | fun getUserPlaylist(@Query("uid") userId: Long, @Query("limit") limit: Int = 30, @Query("offset") offset: Int = 0): Call
14 |
15 | @GET("/eapi/point/dailyTask")
16 | fun checkIn(@Query("type") platformCode: Int): Call
17 |
18 | @GET("/eapi/creator/user/access")
19 | fun musicianCheckIn(): Call
20 |
21 | @GET("/eapi/nmusician/workbench/mission/cycle/list")
22 | fun getMusicianTasks(): Call
23 |
24 | @GET("/eapi/nmusician/workbench/mission/reward/obtain/new")
25 | fun obtainMusicianTask(@Query("userMissionId") userMissionId: Long, @Query("period") period: Int): Call
26 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/ui/about/AboutActivity.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.ui.about
2 |
3 | import android.content.Context
4 | import android.content.Intent
5 | import android.os.Bundle
6 | import android.view.KeyEvent
7 | import moe.lz233.meizugravity.cloudmusic.BuildConfig
8 | import moe.lz233.meizugravity.cloudmusic.databinding.ActivityAboutBinding
9 | import moe.lz233.meizugravity.design.App.Companion.editor
10 | import moe.lz233.meizugravity.design.activity.BaseActivity
11 | import moe.lz233.meizugravity.design.utils.QRCodeUtil
12 | import kotlin.system.exitProcess
13 |
14 | class AboutActivity : BaseActivity() {
15 | private val viewBuilding by lazy { ActivityAboutBinding.inflate(layoutInflater) }
16 |
17 | override fun onCreate(savedInstanceState: Bundle?) {
18 | super.onCreate(savedInstanceState)
19 | setContentView(viewBuilding.root)
20 | viewBuilding.aboutImageView.setImageBitmap(QRCodeUtil.createQRCodeBitmap("https://github.com/lz233/MeizuGravity/blob/master/NETEASECLOUDMUSIC.md", 100, 100))
21 | viewBuilding.versionTextView.text = "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})"
22 | viewBuilding.logoutButton.setOnClickListener {
23 | editor.remove("userLogin").commit()
24 | exitProcess(0)
25 | }
26 | }
27 |
28 | override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
29 | when (keyCode) {
30 | KeyEvent.KEYCODE_MENU -> finish()
31 | KeyEvent.KEYCODE_DPAD_UP -> {
32 | }
33 | KeyEvent.KEYCODE_DPAD_DOWN -> {
34 | }
35 | KeyEvent.KEYCODE_ENTER -> {
36 | }
37 | }
38 | return super.onKeyDown(keyCode, event)
39 | }
40 |
41 | companion object {
42 | fun actionStart(context: Context) = context.startActivity(Intent(context, AboutActivity::class.java))
43 | }
44 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/ui/daily/DailyAdapter.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.ui.daily
2 |
3 | import android.app.Activity
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import android.widget.ArrayAdapter
8 | import android.widget.TextView
9 | import moe.lz233.meizugravity.cloudmusic.R
10 | import moe.lz233.meizugravity.cloudmusic.logic.model.meta.Music
11 |
12 | class DailyAdapter(private val activity: Activity, musicList: List) : ArrayAdapter(activity, R.layout.item_music, musicList) {
13 | override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
14 | val view = convertView
15 | ?: LayoutInflater.from(activity).inflate(R.layout.item_music, parent, false)
16 | val music = getItem(position)!!
17 | view.findViewById(R.id.musicTextView).text = music.name
18 | view.findViewById(R.id.artistTextView).text = StringBuilder().apply {
19 | for (artist in music.artists) {
20 | append(artist.name)
21 | append('/')
22 | }
23 | deleteCharAt(lastIndex)
24 | }
25 | return view
26 | }
27 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/ui/playlist/PlayListAdapter.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.ui.playlist
2 |
3 | import android.app.Activity
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import android.widget.ArrayAdapter
8 | import android.widget.TextView
9 | import moe.lz233.meizugravity.cloudmusic.R
10 | import moe.lz233.meizugravity.cloudmusic.logic.dao.UserDao
11 | import moe.lz233.meizugravity.cloudmusic.logic.model.meta.PlayList
12 |
13 | class PlayListAdapter(private val activity: Activity, playLists: List) : ArrayAdapter(activity, R.layout.item_playlist, playLists) {
14 | override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
15 | val view = convertView
16 | ?: LayoutInflater.from(activity).inflate(R.layout.item_playlist, parent, false)
17 | val playList = getItem(position)!!
18 | view.findViewById(R.id.playlistTitleTextView).text = playList.name.replace(UserDao.name, "我")
19 | view.findViewById(R.id.playlistSummaryTextView).text = "${playList.trackCount}首"
20 | return view
21 | }
22 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/ui/playlistdetail/PlayListDetailAdapter.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.ui.playlistdetail
2 |
3 | import android.app.Activity
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import android.widget.ArrayAdapter
8 | import android.widget.TextView
9 | import moe.lz233.meizugravity.cloudmusic.R
10 | import moe.lz233.meizugravity.cloudmusic.logic.model.meta.Music
11 |
12 | class PlayListDetailAdapter(private val activity: Activity, musicList: List) : ArrayAdapter(activity, R.layout.item_music, musicList) {
13 | override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
14 | val view = convertView
15 | ?: LayoutInflater.from(activity).inflate(R.layout.item_music, parent, false)
16 | val music = getItem(position)!!
17 | view.findViewById(R.id.musicTextView).text = music.name
18 | view.findViewById(R.id.artistTextView).text = StringBuilder().apply {
19 | for (artist in music.artists) {
20 | append(artist.name)
21 | append('/')
22 | }
23 | deleteCharAt(lastIndex)
24 | }
25 | return view
26 | }
27 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/utils/AudioManager.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.utils
2 |
3 | import android.content.Context
4 | import android.media.AudioManager
5 | import moe.lz233.meizugravity.design.App.Companion.context
6 |
7 | object AudioManager {
8 | const val VOLUME_UP = AudioManager.ADJUST_RAISE
9 | const val VOLUME_DOWN = AudioManager.ADJUST_LOWER
10 |
11 | private val audioManager by lazy { context.getSystemService(Context.AUDIO_SERVICE) as AudioManager }
12 | val maxVolume
13 | get() = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC)
14 | val currentVolume
15 | get() = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC)
16 |
17 | fun adjustStreamVolume(direction: Int) = audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, direction, 0)
18 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/utils/ktx/Chain.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.utils.ktx
2 |
3 | import moe.lz233.meizugravity.cloudmusic.logic.dao.UserDao
4 | import moe.lz233.meizugravity.cloudmusic.utils.AESUtil
5 | import moe.lz233.meizugravity.design.utils.LogUtil
6 | import okhttp3.FormBody
7 | import okhttp3.Interceptor
8 | import okhttp3.Request
9 | import okhttp3.Response
10 | import org.apache.commons.codec.digest.DigestUtils
11 | import org.json.JSONObject
12 |
13 | fun Interceptor.Chain.processEapi(): Response {
14 | val nobodyKnowThis = "36cd479b6b5"
15 | val url = this.request().url()
16 | val path = url.encodedPath().replace("eapi", "api")
17 | val json = JSONObject().apply {
18 | url.queryParameterNames().forEach {
19 | put(it, url.queryParameter(it))
20 | }
21 | put("header", JSONObject())
22 | put("e_r", false)
23 | }
24 | val nobodyUseMD5 = DigestUtils.md5Hex("nobody${path}use${json}md5forencrypt")
25 | val params = "$path-$nobodyKnowThis-$json-$nobodyKnowThis-$nobodyUseMD5"
26 | LogUtil.d(params)
27 | return this.proceed(Request.Builder()
28 | .addHeader("Cookie", "MUSIC_U=${UserDao.cookie}; appver=6.5.0; versioncode=164; buildver=${System.currentTimeMillis()}; os=android")
29 | .url(url)
30 | .post(FormBody.Builder()
31 | .add("params", AESUtil.encrypt(params))
32 | .build())
33 | .build())
34 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/utils/ktx/List.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.utils.ktx
2 |
3 | import com.zhy.mediaplayer_exo.playermanager.PlaylistItem
4 | import com.zhy.mediaplayer_exo.playermanager.meta.PlayListItem
5 | import moe.lz233.meizugravity.cloudmusic.logic.model.meta.Artist
6 | import moe.lz233.meizugravity.cloudmusic.logic.model.meta.Music
7 |
8 | fun List.toPlayListItem() = mutableListOf().apply {
9 | this@toPlayListItem.forEach {
10 | add(PlayListItem(it.id,
11 | it.mvId,
12 | it.name,
13 | it.artists.map { artist -> artist.id },
14 | it.artists.toArtistName(),
15 | it.album.id,
16 | it.album.name,
17 | it.album.picUrl,
18 | it.id.getSongUrl()))
19 | }
20 | }
21 |
22 | fun List.toArtistName() = StringBuilder().apply {
23 | this@toArtistName.forEach {
24 | append(it.name)
25 | append('/')
26 | }
27 | deleteCharAt(lastIndex)
28 | }.toString()
29 |
30 | fun List.safeSubList(fromIndex: Int, toIndex: Int) =
31 | if (toIndex > size)
32 | this.subList(fromIndex, size)
33 | else
34 | this.subList(fromIndex, toIndex)
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/utils/ktx/ListView.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.utils.ktx
2 |
3 | import android.view.View
4 | import android.widget.AdapterView
5 | import android.widget.ListView
6 |
7 | fun ListView.setOnItemSelectedListener(block: (selected: Boolean, parent: AdapterView<*>?, view: View?, position: Int?, id: Long?) -> Unit) {
8 | onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
9 | override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
10 | block(true, parent, view, position, id)
11 | }
12 |
13 | override fun onNothingSelected(parent: AdapterView<*>?) {
14 | block(false, null, null, null, null)
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/utils/ktx/Long.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.utils.ktx
2 |
3 | import moe.lz233.meizugravity.cloudmusic.logic.dao.BaseDao
4 | import moe.lz233.meizugravity.cloudmusic.logic.network.ServiceCreator
5 |
6 | fun Long.getSongUrl(bitRate: Int = BaseDao.soundQuality) = "${ServiceCreator.BASE_URL}/eapi/song/enhance/player/url?ids=[$this]&br=$bitRate"
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/java/moe/lz233/meizugravity/cloudmusic/utils/ktx/String.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic.utils.ktx
2 |
3 | import moe.lz233.meizugravity.cloudmusic.logic.dao.UserDao
4 |
5 | fun String.adjustParam(width: String, height: String) = "$this?param=${width}y${height}"
6 | fun String.isMyFavorite() = this == "${UserDao.name}喜欢的音乐"
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/drawable/bgstyle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/drawable/ic_account.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/drawable/ic_favorite.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/drawable/ic_image.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/drawable/ic_playlist.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/activity_daily.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
23 |
24 |
28 |
29 |
35 |
36 |
37 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
22 |
23 |
31 |
32 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/activity_music_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
22 |
23 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/activity_mv.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
19 |
20 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/activity_playlist.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
23 |
24 |
28 |
29 |
35 |
36 |
37 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/activity_playlist_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
23 |
24 |
28 |
29 |
35 |
36 |
37 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/activity_time.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
18 |
19 |
27 |
28 |
36 |
37 |
44 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/dialog_logout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
24 |
25 |
33 |
34 |
41 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/dialog_server.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
18 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/item_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/item_music.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
25 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/item_music_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/item_playing.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/item_playlist.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
25 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/item_title.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
21 |
22 |
30 |
31 |
36 |
37 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/layout/view_exoplayer.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/neteasecloudmusic/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/neteasecloudmusic/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/neteasecloudmusic/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/neteasecloudmusic/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/neteasecloudmusic/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/neteasecloudmusic/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/neteasecloudmusic/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/neteasecloudmusic/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/neteasecloudmusic/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lz233/MeizuGravity/7735ed9c9fd1aecdf5eaa6162bbc221086cfe5f3/neteasecloudmusic/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #000000
4 | #000000
5 | #FFFFFF
6 | #68FFFFFF
7 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 86px
3 | 80px
4 | 60px
5 | 30px
6 | 50px
7 | 26px
8 | 21px
9 | 20px
10 | 18px
11 | 37px
12 | 125px
13 | 155px
14 | 240px
15 | 320px
16 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Cloud Music For Gravity
3 | 专为 Gravity 设计的网易云音乐第三方客户端。
4 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/neteasecloudmusic/src/test/java/moe/lz233/meizugravity/cloudmusic/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package moe.lz233.meizugravity.cloudmusic
2 |
3 |
4 | /**
5 | * Example local unit test, which will execute on the development machine (host).
6 | *
7 | * See [testing documentation](http://d.android.com/tools/testing).
8 | */
9 | class ExampleUnitTest {
10 | /*@Test
11 | fun addition_isCorrect() {
12 | assertEquals(4, 2 + 2)
13 | }*/
14 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':controller'
2 | include ':app'
3 | rootProject.name = "Meizu Gravity"
4 | include ':neteasecloudmusic'
5 | include ':mediaplayer'
6 | include ':design'
7 |
--------------------------------------------------------------------------------
/shot:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | adb shell /system/bin/screencap -p /sdcard/screenshot.png
3 | adb pull /sdcard/screenshot.png /Users/lz233/Desktop
4 | adb shell rm /sdcard/screenshot.png
--------------------------------------------------------------------------------
/shot.bat:
--------------------------------------------------------------------------------
1 | adb shell /system/bin/screencap -p /sdcard/screenshot.png
2 | adb pull /sdcard/screenshot.png C:\Users\%username%\Desktop
3 | adb shell rm /sdcard/screenshot.png
--------------------------------------------------------------------------------
/translate.bat:
--------------------------------------------------------------------------------
1 | python -m opencc -c s2t -i controller\src\main\res\values-zh\strings.xml -o controller\src\main\res\values-zh-rMO\strings.xml
2 | python -m opencc -c s2hk -i controller\src\main\res\values-zh\strings.xml -o controller\src\main\res\values-zh-rHK\strings.xml
3 | python -m opencc -c s2twp -i controller\src\main\res\values-zh\strings.xml -o controller\src\main\res\values-zh-rTW\strings.xml
--------------------------------------------------------------------------------
/translate2.bat:
--------------------------------------------------------------------------------
1 | mkdir controller\src\main\res\values-zh-rMO
2 | mkdir controller\src\main\res\values-zh-rHK
3 | mkdir controller\src\main\res\values-zh-rTW
4 | python -m opencc -c s2t -i controller\src\main\res\values-zh\strings.xml -o controller\src\main\res\values-zh-rMO\strings.xml
5 | python -m opencc -c s2hk -i controller\src\main\res\values-zh\strings.xml -o controller\src\main\res\values-zh-rHK\strings.xml
6 | python -m opencc -c s2twp -i controller\src\main\res\values-zh\strings.xml -o controller\src\main\res\values-zh-rTW\strings.xml
--------------------------------------------------------------------------------