From a345da0feba51b23d8486e1b6c19ae74858adc2b Mon Sep 17 00:00:00 2001 From: Koen Date: Fri, 7 Jun 2024 09:32:16 +0200 Subject: [PATCH] Added spotify plugin. Fixed bilibili signing. Added bilibili and spotify link handling. --- .gitmodules | 6 +++++ app/src/stable/AndroidManifest.xml | 6 +++++ app/src/stable/assets/sources/bilibili | 2 +- app/src/stable/assets/sources/patreon | 2 +- app/src/stable/assets/sources/spotify | 1 + app/src/stable/res/raw/plugin_config.json | 3 ++- app/src/unstable/AndroidManifest.xml | 6 +++++ app/src/unstable/assets/sources/bilibili | 2 +- app/src/unstable/assets/sources/patreon | 2 +- app/src/unstable/assets/sources/spotify | 1 + app/src/unstable/res/raw/plugin_config.json | 3 ++- sign-all-sources.sh | 30 ++++++++++++--------- 12 files changed, 46 insertions(+), 18 deletions(-) create mode 160000 app/src/stable/assets/sources/spotify create mode 160000 app/src/unstable/assets/sources/spotify diff --git a/.gitmodules b/.gitmodules index 2e67308c..cfc1f2fa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -64,3 +64,9 @@ [submodule "app/src/stable/assets/sources/bilibili"] path = app/src/stable/assets/sources/bilibili url = ../plugins/bilibili.git +[submodule "app/src/stable/assets/sources/spotify"] + path = app/src/stable/assets/sources/spotify + url = ../plugins/spotify.git +[submodule "app/src/unstable/assets/sources/spotify"] + path = app/src/unstable/assets/sources/spotify + url = ../plugins/spotify.git diff --git a/app/src/stable/AndroidManifest.xml b/app/src/stable/AndroidManifest.xml index 0f4a00b8..a5fdd260 100644 --- a/app/src/stable/AndroidManifest.xml +++ b/app/src/stable/AndroidManifest.xml @@ -30,6 +30,9 @@ + + + @@ -51,6 +54,9 @@ + + + diff --git a/app/src/stable/assets/sources/bilibili b/app/src/stable/assets/sources/bilibili index 611f692c..b518be4d 160000 --- a/app/src/stable/assets/sources/bilibili +++ b/app/src/stable/assets/sources/bilibili @@ -1 +1 @@ -Subproject commit 611f692ced94bac637907b105170a4143580281a +Subproject commit b518be4dd5e162e67e9ca64e09be3fe574fccdb7 diff --git a/app/src/stable/assets/sources/patreon b/app/src/stable/assets/sources/patreon index cee1fda4..5b191993 160000 --- a/app/src/stable/assets/sources/patreon +++ b/app/src/stable/assets/sources/patreon @@ -1 +1 @@ -Subproject commit cee1fda4e875a46315a9d4492e2e3b541d98f39f +Subproject commit 5b1919934d20f8c53de9959b04bdb66e0c6af3e9 diff --git a/app/src/stable/assets/sources/spotify b/app/src/stable/assets/sources/spotify new file mode 160000 index 00000000..843cf2dc --- /dev/null +++ b/app/src/stable/assets/sources/spotify @@ -0,0 +1 @@ +Subproject commit 843cf2dc4b19c02d86a00407e2e8f9f1048cf475 diff --git a/app/src/stable/res/raw/plugin_config.json b/app/src/stable/res/raw/plugin_config.json index f679a30a..a1da4004 100644 --- a/app/src/stable/res/raw/plugin_config.json +++ b/app/src/stable/res/raw/plugin_config.json @@ -9,7 +9,8 @@ "4a78c2ff-c20f-43ac-8f75-34515df1d320": "sources/kick/KickConfig.json", "aac9e9f0-24b5-11ee-be56-0242ac120002": "sources/patreon/PatreonConfig.json", "9d703ff5-c556-4962-a990-4f000829cb87": "sources/nebula/NebulaConfig.json", - "cf8ea74d-ad9b-489e-a083-539b6aa8648c": "sources/bilibili/build/BiliBiliConfig.json" + "cf8ea74d-ad9b-489e-a083-539b6aa8648c": "sources/bilibili/build/BiliBiliConfig.json", + "4e365633-6d3f-4267-8941-fdc36631d813": "sources/spotify/build/SpotifyConfig.json" }, "SOURCES_EMBEDDED_DEFAULT": [ "35ae969a-a7db-11ed-afa1-0242ac120002" diff --git a/app/src/unstable/AndroidManifest.xml b/app/src/unstable/AndroidManifest.xml index 8a600a38..60fe5061 100644 --- a/app/src/unstable/AndroidManifest.xml +++ b/app/src/unstable/AndroidManifest.xml @@ -30,6 +30,9 @@ + + + @@ -51,6 +54,9 @@ + + + diff --git a/app/src/unstable/assets/sources/bilibili b/app/src/unstable/assets/sources/bilibili index 611f692c..b518be4d 160000 --- a/app/src/unstable/assets/sources/bilibili +++ b/app/src/unstable/assets/sources/bilibili @@ -1 +1 @@ -Subproject commit 611f692ced94bac637907b105170a4143580281a +Subproject commit b518be4dd5e162e67e9ca64e09be3fe574fccdb7 diff --git a/app/src/unstable/assets/sources/patreon b/app/src/unstable/assets/sources/patreon index cee1fda4..5b191993 160000 --- a/app/src/unstable/assets/sources/patreon +++ b/app/src/unstable/assets/sources/patreon @@ -1 +1 @@ -Subproject commit cee1fda4e875a46315a9d4492e2e3b541d98f39f +Subproject commit 5b1919934d20f8c53de9959b04bdb66e0c6af3e9 diff --git a/app/src/unstable/assets/sources/spotify b/app/src/unstable/assets/sources/spotify new file mode 160000 index 00000000..843cf2dc --- /dev/null +++ b/app/src/unstable/assets/sources/spotify @@ -0,0 +1 @@ +Subproject commit 843cf2dc4b19c02d86a00407e2e8f9f1048cf475 diff --git a/app/src/unstable/res/raw/plugin_config.json b/app/src/unstable/res/raw/plugin_config.json index db526f8f..551c5470 100644 --- a/app/src/unstable/res/raw/plugin_config.json +++ b/app/src/unstable/res/raw/plugin_config.json @@ -9,7 +9,8 @@ "4a78c2ff-c20f-43ac-8f75-34515df1d320": "sources/kick/KickConfig.json", "aac9e9f0-24b5-11ee-be56-0242ac120002": "sources/patreon/PatreonConfig.json", "9d703ff5-c556-4962-a990-4f000829cb87": "sources/nebula/NebulaConfig.json", - "cf8ea74d-ad9b-489e-a083-539b6aa8648c": "sources/bilibili/build/BiliBiliConfig.json" + "cf8ea74d-ad9b-489e-a083-539b6aa8648c": "sources/bilibili/build/BiliBiliConfig.json", + "4e365633-6d3f-4267-8941-fdc36631d813": "sources/spotify/build/SpotifyConfig.json" }, "SOURCES_EMBEDDED_DEFAULT": [ "35ae969a-a7db-11ed-afa1-0242ac120002" diff --git a/sign-all-sources.sh b/sign-all-sources.sh index ff4c0de6..3a6d783f 100755 --- a/sign-all-sources.sh +++ b/sign-all-sources.sh @@ -1,21 +1,27 @@ #!/bin/bash -# Array of directories to look in dirs=("app/src/unstable/assets/sources" "app/src/stable/assets/sources") -# Loop through each directory +sign_scripts() { + local plugin_dir=$1 + + if [[ -d "$plugin_dir" ]]; then + script_file=$(find "$plugin_dir" -maxdepth 2 -name '*Script.js') + config_file=$(find "$plugin_dir" -maxdepth 2 -name '*Config.json') + sign_script="$plugin_dir/sign.sh" + + if [[ -f "$sign_script" && -n "$script_file" && -n "$config_file" ]]; then + sh "$sign_script" "$script_file" "$config_file" + fi + fi +} + for dir in "${dirs[@]}"; do - if [[ -d "$dir" ]]; then # Check if directory exists - for plugin in "$dir"/*; do # Loop through each plugin folder + if [[ -d "$dir" ]]; then + for plugin in "$dir"/*; do if [[ -d "$plugin" ]]; then - script_file=$(find "$plugin" -maxdepth 1 -name '*Script.js') - config_file=$(find "$plugin" -maxdepth 1 -name '*Config.json') - sign_script="$plugin/sign.sh" - - if [[ -f "$sign_script" && -n "$script_file" && -n "$config_file" ]]; then - sh "$sign_script" "$script_file" "$config_file" - fi + sign_scripts "$plugin" fi done fi -done +done \ No newline at end of file