mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-19 19:14:51 +00:00
Added sign-all-sources script.
This commit is contained in:
parent
c1a97f3843
commit
072094ed7b
2 changed files with 42 additions and 0 deletions
|
@ -62,6 +62,27 @@ class SignatureTests {
|
|||
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSignatureSignSh() {
|
||||
val somePlugin = SourcePluginConfig(
|
||||
"Script",
|
||||
"A plugin that adds Script as a source",
|
||||
"FUTO",
|
||||
"https://futo.org",
|
||||
"https://futo.org",
|
||||
"./Script.js",
|
||||
1,
|
||||
"./script.png",
|
||||
"394dba51-fa0c-450c-8f17-6a00df362218",
|
||||
"cQcTqsbGgEXGXycTl+Byf5+DmxTQLE6AjlS+IzRA0Dce915B2brFyr5tymwd2zCEL7HVSpX5g0fia0GRPcujSu21o0yy/iU4AtA1LAP8ZYgQxYSinUs2/q/B3MQYiJCrB9e2K+2Fr8p6CGG5usa4kkYDel4/tofdX3vwQjeEf8hZemPu8Gda39luTqJahQZZ9IZoif8RT9wpQmIXJ4/A+e3PW1m8+3QL3oiMPDos2csFG7Hko/AbBonJJvwr/ywh/+sNutKryvdeIlZgLBMudfrVEfoBdXePhRqSwBpFRuMPmCe63VvhRfu1EzoelGz2cskxsC9ia6b/TE6KPJvJ4w==",
|
||||
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzhBcOpjK+ArDFL94tXTsnmByyKEjN2LsuXk7Dtl6hKVUxOs7RuZ/Ok+CTacXP3/AmsjfOT9g4Rd5gUg3MHsA0PG5Jc8pzV0FHsTNSO6x9XdJv1CwmMqneQuoNxZfiw6MBCe6y0nMM1vaLYdkXniD39EFHyvYPgSTsF9AUljfmHHH7H7J7rxTbW2p7VYwUp2KNn9Q49G9H7A14hs3y1SsLK2y8fJCQ2XR1ARWrI/6xeOoAo23rSqMrML4O3ukaEG1wjidlPr3zdb8GfSHRBi/0qzTwXx7cFnffPqmoHhnMwmTFlhOO8TdwVRm0cWee3Zz2VsETW4Pd27K8NPH2RELGQIDAQAB"
|
||||
);
|
||||
val script = "//this is just an empty script";
|
||||
|
||||
assert(somePlugin.validate(script), { "Invalid signature" });
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "SignatureTests";
|
||||
}
|
||||
|
|
21
sign-all-sources.sh
Executable file
21
sign-all-sources.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Array of directories to look in
|
||||
dirs=("app/src/unstable/assets/sources" "app/src/stable/assets/sources" "app/src/playstore/assets/sources")
|
||||
|
||||
# Loop through each directory
|
||||
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 "$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
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
Loading…
Add table
Reference in a new issue