Compare commits
778 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fda4cd6783 | |||
| ecd1604e25 | |||
| 0f061900af | |||
| c47f5ea85e | |||
| 306eb0e3c7 | |||
| e64025ded8 | |||
| c1fe2da636 | |||
| ff23f58a4f | |||
| fc2f5ffdf9 | |||
| 6dd9ed7fb0 | |||
| 2f362abb91 | |||
| 96807a64cf | |||
| 7df5f1c4c4 | |||
| cf1ede9cf7 | |||
| 729385588a | |||
| 668d5cf8f0 | |||
| 72b1b5b0f9 | |||
| fbf726c174 | |||
| c441eed847 | |||
| e8e83ed49c | |||
| cdc21b067c | |||
| 48e19f7914 | |||
| 89dd570b30 | |||
| 16474d4328 | |||
| 9db612bf03 | |||
| 7d92dbc5c0 | |||
| a9efca8687 | |||
| dbfea5d02b | |||
| a6b05c4a27 | |||
| 6d539d3404 | |||
| b2aff1efc9 | |||
| 8a20a1ef50 | |||
| 33cbfa9751 | |||
| b95a8d44d4 | |||
| 54df9d634a | |||
| 4eb9a696ff | |||
| 7b4fb4682b | |||
| da4275530d | |||
| 1c417e909a | |||
| fc53d69f82 | |||
| dda86cdb93 | |||
| 525a974e3a | |||
| b18c155e22 | |||
| 07e011092a | |||
| 6803ac0611 | |||
| af0dde5ae8 | |||
| ea6edaecc4 | |||
| eb2054bd5e | |||
| b277b3e3af | |||
| 9dc3a4e6ee | |||
| 6fbd2f1079 | |||
| 9edbc7f1d7 | |||
| 8aa75be0d3 | |||
| dc124fb15c | |||
| 9109d1ca3e | |||
| 02296f1d1c | |||
| 63e1082b97 | |||
| 285f228660 | |||
| c18cf069b1 | |||
| fc64f47589 | |||
| 562b940d91 | |||
| d658e07583 | |||
| 9121a6341c | |||
| 4bec027f11 | |||
| b9053e3057 | |||
| 0621138478 | |||
| ce42e89e25 | |||
| 46e1e4c043 | |||
| 621468a183 | |||
| d8876cf96a | |||
| 57d5bc6480 | |||
| f224918f33 | |||
| 7b290dc465 | |||
| b1412dda34 | |||
| 28e4ac8dcb | |||
| 79eeb6d703 | |||
| 0d0e735d0e | |||
| d994502d06 | |||
| dfbd7a65ae | |||
| f99f94c8d7 | |||
| 41c643496a | |||
| e5476f8a01 | |||
| 188fb188ce | |||
| c852592b34 | |||
| 3a1e0c5a63 | |||
| 6376972130 | |||
| c70c860a82 | |||
| 5a178ada74 | |||
| 230427e758 | |||
| abf1af41a3 | |||
| 61e2548bb7 | |||
| f739c54292 | |||
| 3ed84de320 | |||
| 621b4c0946 | |||
| 11be969101 | |||
| ea958cd8f7 | |||
| 56048dcdb0 | |||
| fb545947ec | |||
| df57070b70 | |||
| 9b27d7ee23 | |||
| a2d3fa6e1d | |||
| 94b670eb81 | |||
| d65ed6ced7 | |||
| db50eb7526 | |||
| d21b2018cb | |||
| 9110c07ed9 | |||
| 2298e71279 | |||
| 909bd76e08 | |||
| 50cd0c4e10 | |||
| 460fc235e3 | |||
| c38a3d9eba | |||
| b303291e94 | |||
| 7993da038e | |||
| 05bf4f5525 | |||
| db36896f92 | |||
| 16dbad8bdf | |||
| 8a4c717d24 | |||
| 442a290966 | |||
| 0785f4d0f5 | |||
| 21e325af9c | |||
| 3e9d29ea7f | |||
| 4324373e61 | |||
| 673053d291 | |||
| 5b3975f886 | |||
| 7ed8f43859 | |||
| dcbb1c0dd1 | |||
| 5d4d417f3e | |||
| 5943c6a2c6 | |||
| 6d33d72663 | |||
| 9d2b098837 | |||
| 17bc2d2331 | |||
| 1c192b8db6 | |||
| 76595233fc | |||
| 6531b80998 | |||
| 05707e29d7 | |||
| 616ed4637d | |||
| 912c340a01 | |||
| 583a2f0fad | |||
| 60015bc041 | |||
| 029f445d0a | |||
| 150416b578 | |||
| 6684576de1 | |||
| 289acc9296 | |||
| 2cf9a407e8 | |||
| 682c364647 | |||
| e70730e9a8 | |||
| 0ba6c88d69 | |||
| c56bdea1e2 | |||
| a449a01a24 | |||
| 849acfca3d | |||
| 3cd3cb0186 | |||
| feead100f2 | |||
| a9987e6ab0 | |||
| ef0a6f54b8 | |||
| c8865ad185 | |||
| 354968fba7 | |||
| f985ed2131 | |||
| be2628875f | |||
| 9430c8c580 | |||
| ea2cf5d4ff | |||
| 3b36974d84 | |||
| 41fea1d2a0 | |||
| d81fafc9f6 | |||
| 0a73177996 | |||
| c9423ef425 | |||
| 7086055ec3 | |||
| 553b35d218 | |||
| c910026308 | |||
| 35be9f14e4 | |||
| abcbec9c2a | |||
| ff6f5d7e89 | |||
| 56deea9fb3 | |||
| 1c9a139006 | |||
| 4d89c324b9 | |||
| a76ce03911 | |||
| 9ee3f46ff0 | |||
| 3343007cf8 | |||
| c42d314b76 | |||
| 8db6c2153e | |||
| 5baf54335b | |||
| d9019b8f46 | |||
| a31446557d | |||
| 321fbe22dd | |||
| 01ab912bd9 | |||
| 557bad60bc | |||
| f2dd67d87f | |||
| b8b92c8d69 | |||
| 74ff112e7a | |||
| 684bb1875c | |||
| f6fec2424c | |||
| 2889029b70 | |||
| b56b4fa813 | |||
| 00bc055d69 | |||
| 6fd291c7e3 | |||
| dbdb787076 | |||
| fc788a718d | |||
| e093fe6a06 | |||
| cdce368042 | |||
| 689847d864 | |||
| 3675580d87 | |||
| 92f494d0fe | |||
| 06d7a6d892 | |||
| e2754200af | |||
| cdb083ff48 | |||
| c3fb08d634 | |||
| 78a167aacf | |||
| 5a913fdfbb | |||
| f0a190e8d2 | |||
| a2715fb851 | |||
| 47e5b03f45 | |||
| 251141a5c3 | |||
| 6ac8f4c45d | |||
| 7ebefa7c42 | |||
| 9e4c90f220 | |||
| 50f988641b | |||
| e53b9d4790 | |||
| 027805c4d5 | |||
| c02496c4f0 | |||
| 2a83f290a5 | |||
| d4f9b0b1bc | |||
| 2452b03a49 | |||
| 2ce423b6cb | |||
| e9206158b8 | |||
| 8690e918dd | |||
| c1d702a51c | |||
| 0338ac3810 | |||
| 526fef85e4 | |||
| 49f2d8588a | |||
| 9a80992aec | |||
| 32d0890dba | |||
| b4d37f9ba2 | |||
| 5372ef8f0c | |||
| a11b654c3d | |||
| 1a9a0b3394 | |||
| 890920a57b | |||
| 7fe7de5fdf | |||
| b9b115d0ea | |||
| 08af195f11 | |||
| 71cde729fc | |||
| 077f0a03f6 | |||
| 812eb8001b | |||
| b59af683ac | |||
| 561d680e78 | |||
| 7c3eff2ba7 | |||
| 300c0a8f35 | |||
| 51bfdc0947 | |||
| a64566c0f3 | |||
| dbb9a80ea6 | |||
| e930c54246 | |||
| dfff047cbf | |||
| 44fb2b02bc | |||
| 6a7efafd9f | |||
| 241abc3956 | |||
| 1e82c879bf | |||
| a81d01d2e3 | |||
| 2230796504 | |||
| 458ca7c7cf | |||
| 3f91663ecf | |||
| 04a671382a | |||
| 945ec818e5 | |||
| ff7ac8a785 | |||
| 603105e2ea | |||
| 5475567b48 | |||
| 2aec0adb08 | |||
| 54fc3761bf | |||
| 99e1912bfe | |||
| ecc1cabafd | |||
| 1a5b847b23 | |||
| d3409e7133 | |||
| 4e553e3eb3 | |||
| 4577bbc572 | |||
| da8ca23496 | |||
| 988853be63 | |||
| cde5dc5bfa | |||
| b617250eff | |||
| 313da99536 | |||
| 442e245216 | |||
| 050ab17019 | |||
| c80f488a13 | |||
| cf73804c71 | |||
| a90e5d13ea | |||
| 891fb0b479 | |||
| 58a623d44d | |||
| 0e84b8a154 | |||
| a4dfcf80e4 | |||
| d8567eadb2 | |||
| 0b88207ad5 | |||
| 671466a737 | |||
| 84881a0d52 | |||
| a589049cc7 | |||
| 17877e0f17 | |||
| 1ed9bef2a1 | |||
| a6dddf311c | |||
| e8c2bad187 | |||
| 52bda2c080 | |||
| 607919f40f | |||
| d830638ee6 | |||
| 106bda2097 | |||
| 7debb27374 | |||
| 05b5a7f598 | |||
| 3bbda7ba54 | |||
| 9312f5fd14 | |||
| 399eb07e35 | |||
| eb197ebcee | |||
| 4c30d8ab05 | |||
| 3a67ddf0f6 | |||
| 6541c7b5b7 | |||
| 37f41ade43 | |||
| 007d20d417 | |||
| 00370a81fa | |||
| d4599c3331 | |||
| bce76bbcf3 | |||
| 847a5fe71b | |||
| e2fa003239 | |||
| 0c555e88d3 | |||
| bf7f1a04b3 | |||
| 623172af6d | |||
| 4fb689d9e4 | |||
| 6054c489c6 | |||
| 21719f4408 | |||
| f2a650ba02 | |||
| 871c28b1ea | |||
| d3aa32147a | |||
| 9a50f2e408 | |||
| dcde4947e8 | |||
| 5b61bdc3a8 | |||
| ec1d65f4c3 | |||
| a0081dec07 | |||
| 783787e514 | |||
| ac99dd55a2 | |||
| c56f984952 | |||
| 9269ca726e | |||
| eca3205dcf | |||
| 13f5486d0b | |||
| d4e71274f9 | |||
| 4cc96de806 | |||
| d27ef12039 | |||
| f3c2ee4c40 | |||
| 555f73b478 | |||
| 544bf2ea21 | |||
| 54bbb5e384 | |||
| b10062c73d | |||
| a027d6df1b | |||
| 926a53a4b0 | |||
| 406cb46170 | |||
| acc58dc892 | |||
| 55894c22a4 | |||
| 476b10b862 | |||
| 3cbbe446ab | |||
| 4cf7512ee0 | |||
| ee8ec460a1 | |||
| deecab3cca | |||
| d2f5c1a195 | |||
| dba77e26a3 | |||
| fa48bafbc6 | |||
| 73c48694c7 | |||
| 0ff89d039b | |||
| 7a7081ee13 | |||
| 874aaf4e93 | |||
| ebf076d9f6 | |||
| 073a041d4c | |||
| 96a9b4dabd | |||
| 8e4cdf2386 | |||
| ab4d925a5a | |||
| d9c6f52e21 | |||
| 0a748cd53b | |||
| 07314ef018 | |||
| 5eaebf678f | |||
| 80fbfa60de | |||
| fbbcc9e9b6 | |||
| f47dc6b9de | |||
| 5f8e74f017 | |||
| 8c1ca0ac7e | |||
| 9018de3c4c | |||
| e7cb88c757 | |||
| d6127d6811 | |||
| 67e09e2e1d | |||
| 8fbc24c751 | |||
| c0948209be | |||
| 7237161d52 | |||
| 94c2e21e2b | |||
| 65067e6e01 | |||
| 39490ce7ba | |||
| 2f3f47c745 | |||
| 2195c3df76 | |||
| 119b9db6b4 | |||
| fcbc598732 | |||
| e850049e8e | |||
| 907adea73f | |||
| 2ac5c1362c | |||
| 8b20e2b48f | |||
| c2a9820fc1 | |||
| a9e5bc0c95 | |||
| 0fa2834d25 | |||
| 23f0876c00 | |||
| 6d88d90659 | |||
| a3c366c360 | |||
| 3bef07eeab | |||
| d029e65b8e | |||
| f305ac6905 | |||
| 4d4a46d2a5 | |||
| 8218f2f830 | |||
| b1bf901eac | |||
| 06eff55210 | |||
| 71730fddad | |||
| f2d1c6e3cb | |||
| 7ae837ca3c | |||
| b10908df5e | |||
| 4dd4d38d5b | |||
| 447c286b56 | |||
| c71898ece9 | |||
| 9473e88ea9 | |||
| d7663ed56e | |||
| da7569e2f5 | |||
| d989940a4d | |||
| bd6a86b135 | |||
| b38eb11503 | |||
| 7aef32c13d | |||
| fab64b147c | |||
| cc5a63205c | |||
| 814166a884 | |||
| 55240d9e9b | |||
| 9dc598150f | |||
| 21c087e273 | |||
| bdf3a7014f | |||
| dfea6e9b1b | |||
| 50eef1190e | |||
| ed180121ff | |||
| bdb0ad89d4 | |||
| 7195a30d55 | |||
| 5b0426a94c | |||
| a6d012abd9 | |||
| 86f0b3f29f | |||
| 85e3aa34ac | |||
| 5bbc1dedef | |||
| 39b468ef06 | |||
| fe17176b31 | |||
| 84f701c4ab | |||
| 047f8c176f | |||
| d82e79b680 | |||
| 320d1ae9d8 | |||
| a8892143a2 | |||
| 50f4532406 | |||
| 844454053d | |||
| db5c5ed534 | |||
| a26b8ecca0 | |||
| 5a32ccfa7a | |||
| f51818b157 | |||
| 31a624db51 | |||
| f045b18762 | |||
| f5006cac7d | |||
| 152b193ad5 | |||
| a27af0b642 | |||
| 44ffed3f7c | |||
| fa035ad9be | |||
| 186ace4343 | |||
| 8fb1a0bb1f | |||
| 05513bf8b9 | |||
| 858784857e | |||
| 291a23949a | |||
| 454de23844 | |||
| 1176092fc6 | |||
| 0fc2c57395 | |||
| 0b292f8d74 | |||
| 4bbe51331f | |||
| c289786dfa | |||
| 9a9752a6a1 | |||
| c43b688f8e | |||
| a6272d5221 | |||
| b440a58d95 | |||
| ec1589aa2d | |||
| 8d48e56fa0 | |||
| df7938037e | |||
| c908ee2d49 | |||
| b714abddae | |||
| 63ca189907 | |||
| 6130fb9ba2 | |||
| f0edc676fc | |||
| b68fdb0772 | |||
| 76c7bdd604 | |||
| 205101568e | |||
| efff68c49b | |||
| f74f60bb1d | |||
| 63ea28a620 | |||
| 2c6d043277 | |||
| 9a226f7b64 | |||
| 3b73a0fd72 | |||
| 2478aa77cd | |||
| a41068dbc9 | |||
| 5e47b7ae6b | |||
| debf45a7d5 | |||
| e7041e8c8c | |||
| bd960992bc | |||
| 0c5f6b432c | |||
| 49232edbd5 | |||
| b02884f58d | |||
| 845b588426 | |||
| 3a97d7c8be | |||
| 2cb2ded2d9 | |||
| 14e02bee6c | |||
| 30f7cdc1ba | |||
| 420d14fc37 | |||
| 3d7953d977 | |||
| 35238b3da1 | |||
| 446f4283e0 | |||
| 8062dd3709 | |||
| 41c8fde8c5 | |||
| d90b986d19 | |||
| 64ea8416b2 | |||
| 100a4c9d35 | |||
| 4ef6dec89a | |||
| a14cdc48bd | |||
| 8a4ddbc6df | |||
| ee33acc561 | |||
| 5fe69becf3 | |||
| d460d3ccdf | |||
| 0ee74943e8 | |||
| 82837e38d2 | |||
| 91df90d760 | |||
| 1ee37da720 | |||
| 6f8fc5b69d | |||
| be1918c769 | |||
| 0057b35a0a | |||
| d12974702a | |||
| 921c41689d | |||
| 6389899507 | |||
| 92ede2a2b3 | |||
| 826a63ed71 | |||
| d1576a2a72 | |||
| 95f218d704 | |||
| 315d3a0ac0 | |||
| 954818cef2 | |||
| 5a95ca9b1b | |||
| c1e6f4c26e | |||
| 7c603258fb | |||
| fcbc582686 | |||
| 9c4906b90b | |||
| d35e31e02d | |||
| 6c4ca36c09 | |||
| 70355dc505 | |||
| 20aeaf2a05 | |||
| 1f13e1d08b | |||
| eb9d35c123 | |||
| 45808cd530 | |||
| fd715a3f92 | |||
| e3b32367a7 | |||
| bf9554a746 | |||
| b9f8ca1488 | |||
| e8c4159678 | |||
| e57e71629e | |||
| 2bfd9d24a4 | |||
| b18b8fe22f | |||
| b154ff2f9d | |||
| e9b764b63c | |||
| 7216b97d92 | |||
| 0e9d93b194 | |||
| 2cbee62f0a | |||
| 379e9da5fe | |||
| ae7caa4901 | |||
| cd8b4c9dd7 | |||
| 60cd61dfd2 | |||
| 5a6637d9fc | |||
| dca7ed23f5 | |||
| 8cb5791f3b | |||
| 9b67f2c58f | |||
| 3815810d4f | |||
| 819ceba17d | |||
| 0aa0d62e03 | |||
| b3e2a35880 | |||
| 15ec20c65d | |||
| d4d6d7e12f | |||
| 2e7a4f1421 | |||
| ab8a52faf3 | |||
| bd465559fb | |||
| 13ec45a95c | |||
| 13b034875b | |||
| bb701fb088 | |||
| b367414865 | |||
| 4b00eec608 | |||
| 5e11b51152 | |||
| 9fb43b996e | |||
| bc2072e81f | |||
| f36bc3f643 | |||
| f7901ad843 | |||
| 3771030ed6 | |||
| 57197e58b5 | |||
| ac601399ac | |||
| 6a0e221153 | |||
| 6a949fc851 | |||
| f1a077dc2f | |||
| f20962b02b | |||
| 77e057f244 | |||
| 2c5114c770 | |||
| a30895a199 | |||
| 6d46d4b3da | |||
| 006efbbb77 | |||
| 52334087ad | |||
| ea8fb2c70a | |||
| 531d148718 | |||
| d83ddea323 | |||
| b5dea34090 | |||
| 7d8e3202b5 | |||
| d956e0af4b | |||
| 9ad70990b5 | |||
| 82d711f077 | |||
| 5fc28ef711 | |||
| 1f3dc682e2 | |||
| cce7768246 | |||
| 01172b0664 | |||
| 1ca11fdd34 | |||
| 52a064ae45 | |||
| 6c62ddf927 | |||
| 47e04c08d0 | |||
| d1601874b4 | |||
| 6bc19af041 | |||
| 4e72a3886f | |||
| 8e6b219eea | |||
| bd638251e4 | |||
| 0173d5e4b3 | |||
| 4f364e134b | |||
| 94d2519717 | |||
| 6a11d2e357 | |||
| 0a9e0bc9e4 | |||
| 5914e367d1 | |||
| aeaed888d4 | |||
| a0f054b005 | |||
| 4498e9d444 | |||
| 43e0763fef | |||
| a519c8a482 | |||
| 19bc595a2a | |||
| db07825c58 | |||
| b199e3bf0e | |||
| 1f9ea0891e | |||
| 0a7aa48f1e | |||
| 4b65b7da6c | |||
| 183a7dac4b | |||
| 6726f008c1 | |||
| 89cf0c140f | |||
| 504025ce80 | |||
| fee9e914f1 | |||
| 76efa71c68 | |||
| 26e61959ae | |||
| 9a8956ef9d | |||
| 10d3ffc2f6 | |||
| 090399f61d | |||
| ae7d975a92 | |||
| 55ec6bcafe | |||
| f0566d15af | |||
| a730b692bc | |||
| 826d767423 | |||
| 6d227c7fcd | |||
| 7d9d97840e | |||
| 110ded45a0 | |||
| 7872b593c7 | |||
| 90be30bddb | |||
| a298c61dab | |||
| eb416c45bd | |||
| b05b817aeb | |||
| 666602283a | |||
| ac040a4bae | |||
| b4982c8f22 | |||
| ce3ad92095 | |||
| 8e1ac8698c | |||
| b60a39c7cb | |||
| 3b3e8ba4c8 | |||
| e387f6d3be | |||
| 799d469cb6 | |||
| a54a596fa7 | |||
| 92d73d0285 | |||
| acb752e4e8 | |||
| 9e377abba6 | |||
| 04552c0923 | |||
| 2e1fb85b73 | |||
| 50db32d9b4 | |||
| 28743d953e | |||
| b109d26aa7 | |||
| 7fd21bd06d | |||
| 12e0ffb466 | |||
| 9259341df8 | |||
| 8e8aca7e7b | |||
| 7f0bcd987b | |||
| ef21de95cb | |||
| ca3246de02 | |||
| f0940b7926 | |||
| 0066e0b901 | |||
| 9771f566b0 | |||
| 38ad4c6dec | |||
| 37cf80a188 | |||
| c86ee53f66 | |||
| c2cea7e797 | |||
| a8ef6cdd4f | |||
| 53d157fee8 | |||
| c2e07b13f6 | |||
| 2e8cc48311 | |||
| f6f811eb77 | |||
| ac5528fb15 | |||
| 940d2b7862 | |||
| 835fe3dad3 | |||
| dfaecc08c5 | |||
| 87f5e9b847 | |||
| 3d3939e808 | |||
| 90822e3858 | |||
| 14eec47e9c | |||
| 15ed3fcc69 | |||
| fd8fa9f3ef | |||
| b81075f4a7 | |||
| f11a52e8e1 | |||
| 9c007483d4 | |||
| ff4e818e4c | |||
| 45a50ca0c1 | |||
| 65d9021c37 | |||
| 66481a0391 | |||
| a14a82bc9a | |||
| 756c57a16e | |||
| 8b19e34dc5 | |||
| 50083019ee | |||
| 155272e638 | |||
| 08443ceb3d | |||
| c215696f04 | |||
| 5ca42bf9b6 | |||
| 3272b9dec5 | |||
| 2ebd5da4aa | |||
| 34f024ace2 | |||
| b31f2d50f6 | |||
| da44d3b2b4 | |||
| 99ec2aca6a | |||
| 6c278604ec | |||
| 1e094a467a | |||
| 978ccfeeba | |||
| e93d66d8a1 | |||
| c29a749833 | |||
| b08d5d1261 | |||
| 9b129789e9 | |||
| a76a6d2798 | |||
| 086a760378 | |||
| f78c8d4fd8 | |||
| 7b91489997 | |||
| 36a8980c95 | |||
| 7c65640cb7 | |||
| d70e68495a | |||
| 2586202772 | |||
| b5f771368a | |||
| 0c28320ce3 | |||
| c8b4fbc36b | |||
| e9b07849fe | |||
| 409260af6f | |||
| d3d53d1a4e | |||
| e2db191f70 | |||
| d61816734d | |||
| f4dad8058f | |||
| 70bdb375c3 | |||
| e724ab0a29 | |||
| 7d0ee2ac11 | |||
| 59b7e852e2 | |||
| b2eb1a391d | |||
| 9b3aee98d3 | |||
| 0476f4144c | |||
| ed77f45fae | |||
| 0cd529e746 | |||
| 5969048318 | |||
| d1a7f8baa0 | |||
| 18dc936002 | |||
| b4b7b5d572 | |||
| 291c2e692d | |||
| 8a9a4f21b1 | |||
| cd31332b39 | |||
| cc8d2162a0 | |||
| e6313cdc67 | |||
| 5af64892e7 | |||
| a5578a7ac7 | |||
| fcdda6406e | |||
| 9bdd9f8aa6 | |||
| f3856f051b | |||
| d3a6662c60 | |||
| 5474eddf84 | |||
| b666cd47d4 | |||
| 8a986383fe | |||
| 9fa17f617e |
@@ -0,0 +1,11 @@
|
||||
[*.{kt,kts}]
|
||||
indent_size=4
|
||||
insert_final_newline=true
|
||||
ij_kotlin_allow_trailing_comma=true
|
||||
ij_kotlin_allow_trailing_comma_on_call_site=true
|
||||
ij_kotlin_name_count_to_use_star_import=2147483647
|
||||
ij_kotlin_name_count_to_use_star_import_for_members=2147483647
|
||||
|
||||
ktlint_standard_discouraged-comment-location=disabled
|
||||
ktlint_standard_if-else-wrapping=disabled
|
||||
ktlint_standard_no-consecutive-comments=disabled
|
||||
+4
-1
@@ -25,4 +25,7 @@
|
||||
*.pyc binary
|
||||
*.swp binary
|
||||
*.pdf binary
|
||||
*.exe binary
|
||||
*.exe binary
|
||||
*.avif binary
|
||||
*.heif binary
|
||||
*.jxl binary
|
||||
@@ -11,7 +11,7 @@ I acknowledge that:
|
||||
|
||||
- I have updated to the latest version of the app.
|
||||
- I have tried the troubleshooting guide described in `README.md`
|
||||
- If this is a request for adding/changing an extension it should be brought up to Tachiyomi: https://github.com/tachiyomiorg/tachiyomi-extensions/issues/new/choose
|
||||
- If this is a request for adding/changing an extension it should be brought up to your extension repo.
|
||||
- If this is an issue with some extension not working properly, It does work inside Tachiyomi as intended.
|
||||
- I have searched the existing issues and this is a new ticket **NOT** a duplicate or related to another open issue
|
||||
- I will fill out the title and the information in this template
|
||||
@@ -23,7 +23,7 @@ Note that the issue will be automatically closed if you do not fill out the titl
|
||||
---
|
||||
|
||||
## Device information
|
||||
- Tachidesk version: (Example: v0.2.3-r255-win32)
|
||||
- Suwayomi-Server version: (Example: v1.1.0-r1532-win32)
|
||||
- Server Operating System: (Example: Ubuntu 20.04)
|
||||
- Server Desktop Environment: N/A or (Example: Gnome 40)
|
||||
- Server JVM version: bundled with win32 or (Example: Java 8 Update 281 or OpenJDK 8u281)
|
||||
|
||||
@@ -11,7 +11,7 @@ I acknowledge that:
|
||||
|
||||
- I have updated to the latest version of the app.
|
||||
- I have tried the troubleshooting guide described in `README.md`
|
||||
- If this is a request for adding/changing an extension it should be brought up to Tachiyomi: https://github.com/tachiyomiorg/tachiyomi-extensions/issues/new/choose
|
||||
- If this is a request for adding/changing an extension it should be brought up to your extension repo.
|
||||
- If this is an issue with some extension not working properly, It does work in Tachiyomi application as intended.
|
||||
- I have searched the existing issues and this is a new ticket **NOT** a duplicate or related to another open issue
|
||||
- I will fill out the title and the information in this template
|
||||
@@ -22,7 +22,7 @@ Note that the issue will be automatically closed if you do not fill out the titl
|
||||
|
||||
---
|
||||
|
||||
## What feature should be added to Tachidesk?
|
||||
## What feature should be added to Suwayomi?
|
||||
Explain What the feature is and how it should work in detail. Remove this line after you are done.
|
||||
|
||||
## Why/Project's Benefit/Existing Problem
|
||||
|
||||
@@ -3,6 +3,10 @@ name: CI Pull Request
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check_wrapper:
|
||||
name: Validate Gradle Wrapper
|
||||
@@ -10,7 +14,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
@@ -18,26 +22,21 @@ jobs:
|
||||
build:
|
||||
name: Build pull request
|
||||
needs: check_wrapper
|
||||
if: "!startsWith(github.event.head_commit.message, '[SKIP CI]')"
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Cancel previous runs
|
||||
uses: styfle/cancel-workflow-action@0.9.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout pull request
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
path: master
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: 1.8
|
||||
java-version: 8
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Copy CI gradle.properties
|
||||
run: |
|
||||
@@ -45,17 +44,9 @@ jobs:
|
||||
mkdir -p ~/.gradle
|
||||
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
||||
|
||||
- name: Download android.jar
|
||||
run: |
|
||||
cd master
|
||||
curl https://raw.githubusercontent.com/Suwayomi/Tachidesk/android-jar/android.jar -o AndroidCompat/lib/android.jar
|
||||
|
||||
- name: Build Jar
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
build-root-directory: master
|
||||
wrapper-directory: master
|
||||
arguments: :server:shadowJar --stacktrace
|
||||
wrapper-cache-enabled: true
|
||||
dependencies-cache-enabled: true
|
||||
configuration-cache-enabled: true
|
||||
arguments: ktlintCheck :server:shadowJar --stacktrace
|
||||
|
||||
|
||||
@@ -5,41 +5,38 @@ on:
|
||||
branches:
|
||||
- master
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check_wrapper:
|
||||
name: Validate Gradle Wrapper
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
|
||||
build:
|
||||
name: Build artifacts and deploy preview
|
||||
name: Build Jar
|
||||
needs: check_wrapper
|
||||
if: "!startsWith(github.event.head_commit.message, '[SKIP CI]')"
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Cancel previous runs
|
||||
uses: styfle/cancel-workflow-action@0.9.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout master branch
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: master
|
||||
path: master
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: 1.8
|
||||
java-version: 8
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Copy CI gradle.properties
|
||||
run: |
|
||||
@@ -47,55 +44,137 @@ jobs:
|
||||
mkdir -p ~/.gradle
|
||||
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
||||
|
||||
- name: Download android.jar
|
||||
run: |
|
||||
cd master
|
||||
curl https://raw.githubusercontent.com/Suwayomi/Tachidesk/android-jar/android.jar -o AndroidCompat/lib/android.jar
|
||||
|
||||
- name: Build Jar
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
uses: gradle/gradle-build-action@v2
|
||||
env:
|
||||
ProductBuildType: "Preview"
|
||||
with:
|
||||
build-root-directory: master
|
||||
wrapper-directory: master
|
||||
arguments: :server:shadowJar --stacktrace
|
||||
wrapper-cache-enabled: true
|
||||
dependencies-cache-enabled: true
|
||||
configuration-cache-enabled: true
|
||||
|
||||
# - name: Mock Build and copy webUI, Build Jar
|
||||
# run: |
|
||||
# mkdir -p master/server/build
|
||||
# cd master/server/build
|
||||
# echo "test" > Tachidesk-v0.3.8-r583.jar
|
||||
- name: Upload Jar
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: jar
|
||||
path: master/server/build/*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload icons
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: icon
|
||||
path: master/server/src/main/resources/icon
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Tar scripts dir to maintain file permissions
|
||||
run: tar -cvzf scripts.tar.gz -C master/ scripts/
|
||||
|
||||
- name: Upload scripts.tar.gz
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: scripts
|
||||
path: scripts.tar.gz
|
||||
if-no-files-found: error
|
||||
|
||||
bundle:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- debian-all
|
||||
- linux-assets
|
||||
- linux-x64
|
||||
- macOS-x64
|
||||
- macOS-arm64
|
||||
- windows-x64
|
||||
- windows-x86
|
||||
|
||||
name: Make ${{ matrix.os }} release
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download Jar
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: jar
|
||||
path: server/build
|
||||
|
||||
- name: Download icons
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: icon
|
||||
path: server/src/main/resources/icon
|
||||
|
||||
- name: Download scripts.tar.gz
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: scripts
|
||||
|
||||
- name: Make ${{ matrix.os }} release
|
||||
run: |
|
||||
mkdir upload
|
||||
tar -xvpf scripts.tar.gz
|
||||
scripts/bundler.sh -o upload/ ${{ matrix.os }}
|
||||
|
||||
- name: Upload ${{ matrix.os }} release
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.os }}
|
||||
path: upload/*
|
||||
if-no-files-found: error
|
||||
|
||||
release:
|
||||
needs: bundle
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: jar
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: debian-all
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: linux-assets
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: linux-x64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macOS-x64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macOS-arm64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-x64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-x86
|
||||
path: release
|
||||
|
||||
- name: Checkout Preview branch
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "Suwayomi/Suwayomi-Server-preview"
|
||||
ref: main
|
||||
path: preview
|
||||
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
|
||||
|
||||
- name: Generate Tag Name
|
||||
id: GenTagName
|
||||
run: |
|
||||
cd master/server/build
|
||||
genTag=$(ls *.jar | sed -e's/Tachidesk-Server-\|.jar//g')
|
||||
cd release
|
||||
genTag=$(ls *.jar | sed -e's/Suwayomi-Server-\|.jar//g')
|
||||
echo "$genTag"
|
||||
echo "::set-output name=value::$genTag"
|
||||
|
||||
- name: make windows packages
|
||||
run: |
|
||||
cd master/scripts
|
||||
./windows-bundler.sh win32
|
||||
./windows-bundler.sh win64
|
||||
|
||||
# - name: Mock make windows packages
|
||||
# run: |
|
||||
# cd master/server/build
|
||||
# echo test > Tachidesk-v0.3.8-r580-win32.zip
|
||||
|
||||
- name: Checkout preview branch
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'Suwayomi/Tachidesk-Server-preview'
|
||||
ref: main
|
||||
path: preview
|
||||
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
|
||||
echo "value=$genTag" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create Tag
|
||||
run: |
|
||||
@@ -104,7 +183,8 @@ jobs:
|
||||
cd preview
|
||||
echo "{ \"latest\": \"$TAG\" }" > index.json
|
||||
git add index.json
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --global user.email \
|
||||
"github-actions[bot]@users.noreply.github.com"
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git commit -m "Updated to $TAG"
|
||||
git push origin main
|
||||
@@ -113,14 +193,10 @@ jobs:
|
||||
git push origin $TAG
|
||||
|
||||
- name: Upload Preview Release
|
||||
uses: ncipollo/release-action@v1
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
|
||||
artifacts: "master/server/build/*.jar,master/server/build/*.zip"
|
||||
owner: "Suwayomi"
|
||||
repo: "Tachidesk-Server-preview"
|
||||
tag: ${{ steps.GenTagName.outputs.value }}
|
||||
repository: "Suwayomi/Suwayomi-Server-preview"
|
||||
tag_name: ${{ steps.GenTagName.outputs.value }}
|
||||
files: release/*
|
||||
|
||||
- name: Run Docker build workflow
|
||||
run: |
|
||||
curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.DEPLOY_PREVIEW_TOKEN }}" -d '{"ref":"main", "inputs":{"tachidesk_release_type": "preview"}}' https://api.github.com/repos/suwayomi/docker-tachidesk/actions/workflows/build_container_images.yml/dispatches
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
name: Docker Build Stable
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build_publish_docker_container:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: run docker build and publish script
|
||||
run: |
|
||||
curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.DEPLOY_PREVIEW_TOKEN }}" -d '{"ref":"main", "inputs":{"tachidesk_release_type": "stable"}}' https://api.github.com/repos/suwayomi/docker-tachidesk/actions/workflows/build_container_images.yml/dispatches
|
||||
|
||||
@@ -1,24 +1,35 @@
|
||||
name: Issue closer
|
||||
name: Issue moderator
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened, edited, reopened]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
autoclose:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Autoclose issues
|
||||
uses: arkon/issue-closer-action@v3.0
|
||||
- name: Moderate issues
|
||||
uses: tachiyomiorg/issue-moderator-action@v1
|
||||
with:
|
||||
repo-token: ${{ github.token }}
|
||||
rules: |
|
||||
duplicate-check-enabled: true
|
||||
duplicate-check-label: Source request
|
||||
existing-check-enabled: true
|
||||
existing-check-label: Source request
|
||||
auto-close-rules: |
|
||||
[
|
||||
{
|
||||
"type": "title",
|
||||
"regex": ".*<short description>*",
|
||||
"regex": ".*<short description>.*",
|
||||
"message": "You did not fill out the description in the title"
|
||||
},
|
||||
{
|
||||
"type": "title",
|
||||
"regex": ".*(<|>)+.*",
|
||||
"message": "You did not remove Angle brackets(< and >) from the title"
|
||||
},
|
||||
{
|
||||
"type": "body",
|
||||
"regex": ".*DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT.*",
|
||||
@@ -26,7 +37,7 @@ jobs:
|
||||
},
|
||||
{
|
||||
"type": "body",
|
||||
"regex": "(Tachidesk version|Server Operating System|Server Desktop Environment|Server JVM version|Client Operating System|Client Web Browser):.*(\\(Example:|<usually).*",
|
||||
"regex": ".*(Suwayomi-Server version|Server Operating System|Server Desktop Environment|Server JVM version|Client Operating System|Client Web Browser):.*(\\(Example:|<usually).*",
|
||||
"message": "The requested information was not filled out"
|
||||
},
|
||||
{
|
||||
+130
-48
@@ -1,92 +1,174 @@
|
||||
name: CI Publish
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
- "v*"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
check_wrapper:
|
||||
name: Validate Gradle Wrapper
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Clone repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
|
||||
build:
|
||||
name: Build artifacts and release
|
||||
name: Build Jar
|
||||
needs: check_wrapper
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Cancel previous runs
|
||||
uses: styfle/cancel-workflow-action@0.9.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout ${{ github.ref }}
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
path: master
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: 1.8
|
||||
java-version: 8
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Copy CI gradle.properties
|
||||
run: |
|
||||
cd master
|
||||
mkdir -p ~/.gradle
|
||||
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
||||
|
||||
- name: Download android.jar
|
||||
run: |
|
||||
cd master
|
||||
curl https://raw.githubusercontent.com/Suwayomi/Tachidesk/android-jar/android.jar -o AndroidCompat/lib/android.jar
|
||||
|
||||
- name: Cache node_modules
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
**/webUI/node_modules
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/webUI/yarn.lock') }}
|
||||
cp .github/runner-files/ci-gradle.properties \
|
||||
~/.gradle/gradle.properties
|
||||
|
||||
- name: Build and copy webUI, Build Jar
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
uses: gradle/gradle-build-action@v2
|
||||
env:
|
||||
ProductBuildType: "Stable"
|
||||
with:
|
||||
build-root-directory: master
|
||||
wrapper-directory: master
|
||||
arguments: :server:downloadWebUI :server:shadowJar --stacktrace
|
||||
wrapper-cache-enabled: true
|
||||
dependencies-cache-enabled: true
|
||||
configuration-cache-enabled: true
|
||||
|
||||
- name: make windows packages
|
||||
run: |
|
||||
cd master/scripts
|
||||
./windows-bundler.sh win32
|
||||
./windows-bundler.sh win64
|
||||
|
||||
- name: Upload Release
|
||||
uses: xresloader/upload-to-github-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Upload Jar
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
file: "master/server/build/*.jar;master/server/build/*.zip"
|
||||
tags: true
|
||||
draft: true
|
||||
verbose: true
|
||||
name: jar
|
||||
path: master/server/build/*.jar
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Run Docker build workflow
|
||||
- name: Upload icons
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: icon
|
||||
path: master/server/src/main/resources/icon
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Tar scripts dir to maintain file permissions
|
||||
run: tar -cvzf scripts.tar.gz -C master/ scripts/
|
||||
|
||||
- name: Upload scripts.tar.gz
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: scripts
|
||||
path: scripts.tar.gz
|
||||
if-no-files-found: error
|
||||
|
||||
bundle:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- debian-all
|
||||
- linux-assets
|
||||
- linux-x64
|
||||
- macOS-x64
|
||||
- macOS-arm64
|
||||
- windows-x64
|
||||
- windows-x86
|
||||
|
||||
name: Make ${{ matrix.os }} release
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download Jar
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: jar
|
||||
path: server/build
|
||||
|
||||
- name: Download icons
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: icon
|
||||
path: server/src/main/resources/icon
|
||||
|
||||
- name: Download scripts.tar.gz
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: scripts
|
||||
|
||||
- name: Make ${{ matrix.os }} release
|
||||
run: |
|
||||
curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.DEPLOY_PREVIEW_TOKEN }}" -d '{"ref":"main", "inputs":{"tachidesk_release_type": "stable"}}' https://api.github.com/repos/suwayomi/docker-tachidesk/actions/workflows/build_container_images.yml/dispatches
|
||||
|
||||
mkdir upload/
|
||||
tar -xvpf scripts.tar.gz
|
||||
scripts/bundler.sh -o upload/ ${{ matrix.os }}
|
||||
|
||||
- name: Upload ${{ matrix.os }} files
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.os }}
|
||||
path: upload/*
|
||||
if-no-files-found: error
|
||||
|
||||
release:
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
needs: bundle
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: jar
|
||||
path: release
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: debian-all
|
||||
path: release
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: linux-assets
|
||||
path: release
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: linux-x64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: macOS-x64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: macOS-arm64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: windows-x64
|
||||
path: release
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: windows-x86
|
||||
path: release
|
||||
|
||||
- name: Generate checksums
|
||||
run: cd release && sha256sum * > Checksums.sha256
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
token: ${{ secrets.DEPLOY_RELEASE_TOKEN }}
|
||||
draft: true
|
||||
files: release/*
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
name: Publish to WinGet
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["CI Publish"]
|
||||
types:
|
||||
- completed
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: windows-latest # action can only be run on windows
|
||||
steps:
|
||||
- uses: vedantmgoyal2009/winget-releaser@v2
|
||||
with:
|
||||
identifier: Suwayomi.Tachidesk-Server
|
||||
installers-regex: '.*x64.msi$'
|
||||
token: ${{ secrets.WINGET_PUBLISH_PAT }}
|
||||
+12
-7
@@ -1,16 +1,21 @@
|
||||
# Ignore Gradle project-specific cache directory
|
||||
# Ignore project-specific local files and dirs
|
||||
.gradle
|
||||
.idea
|
||||
gradle.properties
|
||||
.fleet
|
||||
# But we need these
|
||||
!.idea/runConfigurations
|
||||
|
||||
# Ignore Gradle build output directory
|
||||
build
|
||||
server/out
|
||||
AndroidCompat/out
|
||||
|
||||
# WebUI is either to be downloaded on-demand or is a dynamic build asset
|
||||
server/src/main/resources/WebUI.zip
|
||||
server/tmp/
|
||||
server/tachiserver-data/
|
||||
|
||||
# bundle asset downlaods
|
||||
OpenJDK*.zip
|
||||
electron-*.zip
|
||||
rcedit-*
|
||||
# bundling stage downlaoded assets
|
||||
scripts/OpenJDK*
|
||||
scripts/zulu*
|
||||
scripts/electron-*
|
||||
scripts/rcedit-*
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
plugins {
|
||||
id(libs.plugins.kotlin.jvm.get().pluginId)
|
||||
id(libs.plugins.kotlin.serialization.get().pluginId)
|
||||
id(libs.plugins.ktlint.get().pluginId)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Config API, moved to the global build.gradle
|
||||
// implementation("com.typesafe:config:1.4.0")
|
||||
}
|
||||
// Shared
|
||||
implementation(libs.bundles.shared)
|
||||
testImplementation(libs.bundles.sharedTest)
|
||||
}
|
||||
|
||||
@@ -9,11 +9,12 @@ package xyz.nulldev.ts.config
|
||||
|
||||
import net.harawata.appdirs.AppDirsFactory
|
||||
|
||||
const val CONFIG_PREFIX = "suwayomi.tachidesk.config"
|
||||
|
||||
val ApplicationRootDir: String
|
||||
get(): String {
|
||||
return System.getProperty(
|
||||
"suwayomi.tachidesk.server.rootDir",
|
||||
AppDirsFactory.getInstance().getUserDataDir("Tachidesk", null, null)
|
||||
"$CONFIG_PREFIX.server.rootDir",
|
||||
AppDirsFactory.getInstance().getUserDataDir("Tachidesk", null, null),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@ import org.kodein.di.bind
|
||||
import org.kodein.di.singleton
|
||||
|
||||
class ConfigKodeinModule {
|
||||
fun create() = DI.Module("ConfigManager") {
|
||||
//Config module
|
||||
bind<ConfigManager>() with singleton { GlobalConfigManager }
|
||||
}
|
||||
}
|
||||
fun create() =
|
||||
DI.Module("ConfigManager") {
|
||||
// Config module
|
||||
bind<ConfigManager>() with singleton { GlobalConfigManager }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,12 @@ package xyz.nulldev.ts.config
|
||||
import ch.qos.logback.classic.Level
|
||||
import com.typesafe.config.Config
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import com.typesafe.config.ConfigRenderOptions
|
||||
import com.typesafe.config.ConfigValue
|
||||
import com.typesafe.config.ConfigValueFactory
|
||||
import com.typesafe.config.parser.ConfigDocument
|
||||
import com.typesafe.config.parser.ConfigDocumentFactory
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
import mu.KotlinLogging
|
||||
import java.io.File
|
||||
|
||||
@@ -18,14 +23,18 @@ import java.io.File
|
||||
* Manages app config.
|
||||
*/
|
||||
open class ConfigManager {
|
||||
val logger = KotlinLogging.logger {}
|
||||
private val generatedModules = mutableMapOf<Class<out ConfigModule>, ConfigModule>()
|
||||
val config by lazy { loadConfigs() }
|
||||
private val userConfigFile = File(ApplicationRootDir, "server.conf")
|
||||
private var internalConfig = loadConfigs()
|
||||
val config: Config
|
||||
get() = internalConfig
|
||||
|
||||
//Public read-only view of modules
|
||||
// Public read-only view of modules
|
||||
val loadedModules: Map<Class<out ConfigModule>, ConfigModule>
|
||||
get() = generatedModules
|
||||
|
||||
val logger = KotlinLogging.logger {}
|
||||
private val mutex = Mutex()
|
||||
|
||||
/**
|
||||
* Get a config module
|
||||
@@ -38,28 +47,32 @@ open class ConfigManager {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun <T : ConfigModule> module(type: Class<T>): T = loadedModules[type] as T
|
||||
|
||||
private fun getUserConfig(): Config {
|
||||
return userConfigFile.let {
|
||||
ConfigFactory.parseFile(it)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load configs
|
||||
*/
|
||||
fun loadConfigs(): Config {
|
||||
//Load reference configs
|
||||
// Load reference configs
|
||||
val compatConfig = ConfigFactory.parseResources("compat-reference.conf")
|
||||
val serverConfig = ConfigFactory.parseResources("server-reference.conf")
|
||||
val baseConfig =
|
||||
ConfigFactory.parseMap(
|
||||
mapOf(
|
||||
"ts.server.rootDir" to ApplicationRootDir
|
||||
)
|
||||
)
|
||||
ConfigFactory.parseMap(
|
||||
mapOf(
|
||||
// override AndroidCompat's rootDir
|
||||
"androidcompat.rootDir" to "$ApplicationRootDir/android-compat",
|
||||
),
|
||||
)
|
||||
|
||||
//Load user config
|
||||
val userConfig =
|
||||
File(ApplicationRootDir, "server.conf").let {
|
||||
ConfigFactory.parseFile(it)
|
||||
}
|
||||
// Load user config
|
||||
val userConfig = getUserConfig()
|
||||
|
||||
|
||||
val config = ConfigFactory.empty()
|
||||
val config =
|
||||
ConfigFactory.empty()
|
||||
.withFallback(baseConfig)
|
||||
.withFallback(userConfig)
|
||||
.withFallback(compatConfig)
|
||||
@@ -68,11 +81,7 @@ open class ConfigManager {
|
||||
|
||||
// set log level early
|
||||
if (debugLogsEnabled(config)) {
|
||||
setLogLevel(Level.DEBUG)
|
||||
}
|
||||
|
||||
logger.debug {
|
||||
"Loaded config:\n" + config.root().render(ConfigRenderOptions.concise().setFormatted(true))
|
||||
setLogLevelFor(BASE_LOGGER_NAME, Level.DEBUG)
|
||||
}
|
||||
|
||||
return config
|
||||
@@ -87,6 +96,71 @@ open class ConfigManager {
|
||||
registerModule(it)
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateUserConfigFile(
|
||||
path: String,
|
||||
value: ConfigValue,
|
||||
) {
|
||||
val userConfigDoc = ConfigDocumentFactory.parseFile(userConfigFile)
|
||||
val updatedConfigDoc = userConfigDoc.withValue(path, value)
|
||||
val newFileContent = updatedConfigDoc.render()
|
||||
userConfigFile.writeText(newFileContent)
|
||||
}
|
||||
|
||||
suspend fun updateValue(
|
||||
path: String,
|
||||
value: Any,
|
||||
) {
|
||||
mutex.withLock {
|
||||
val configValue = ConfigValueFactory.fromAnyRef(value)
|
||||
|
||||
updateUserConfigFile(path, configValue)
|
||||
internalConfig = internalConfig.withValue(path, configValue)
|
||||
}
|
||||
}
|
||||
|
||||
fun resetUserConfig(updateInternalConfig: Boolean = true): ConfigDocument {
|
||||
val serverConfigFileContent = this::class.java.getResource("/server-reference.conf")?.readText()
|
||||
val serverConfigDoc = ConfigDocumentFactory.parseString(serverConfigFileContent)
|
||||
userConfigFile.writeText(serverConfigDoc.render())
|
||||
|
||||
if (updateInternalConfig) {
|
||||
getUserConfig().entrySet().forEach { internalConfig = internalConfig.withValue(it.key, it.value) }
|
||||
}
|
||||
|
||||
return serverConfigDoc
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes sure the "UserConfig" is up-to-date.
|
||||
*
|
||||
* - adds missing settings
|
||||
* - removes outdated settings
|
||||
*/
|
||||
fun updateUserConfig() {
|
||||
val serverConfig = ConfigFactory.parseResources("server-reference.conf")
|
||||
val userConfig = getUserConfig()
|
||||
|
||||
val hasMissingSettings = serverConfig.entrySet().any { !userConfig.hasPath(it.key) }
|
||||
val hasOutdatedSettings = userConfig.entrySet().any { !serverConfig.hasPath(it.key) }
|
||||
val isUserConfigOutdated = hasMissingSettings || hasOutdatedSettings
|
||||
if (!isUserConfigOutdated) {
|
||||
return
|
||||
}
|
||||
|
||||
logger.debug {
|
||||
"user config is out of date, updating... (missingSettings= $hasMissingSettings, outdatedSettings= $hasOutdatedSettings"
|
||||
}
|
||||
|
||||
var newUserConfigDoc: ConfigDocument = resetUserConfig(false)
|
||||
userConfig.entrySet().filter {
|
||||
serverConfig.hasPath(
|
||||
it.key,
|
||||
)
|
||||
}.forEach { newUserConfigDoc = newUserConfigDoc.withValue(it.key, it.value) }
|
||||
|
||||
userConfigFile.writeText(newUserConfigDoc.render())
|
||||
}
|
||||
}
|
||||
|
||||
object GlobalConfigManager : ConfigManager()
|
||||
|
||||
@@ -8,32 +8,50 @@ package xyz.nulldev.ts.config
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import com.typesafe.config.Config
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import com.typesafe.config.ConfigValueFactory
|
||||
import io.github.config4k.getValue
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
/**
|
||||
* Abstract config module.
|
||||
*/
|
||||
abstract class ConfigModule(config: Config, moduleName: String = "") {
|
||||
val overridableWithSysProperty = SystemPropertyOverrideDelegate(config, moduleName)
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
abstract class ConfigModule(getConfig: () -> Config)
|
||||
|
||||
/**
|
||||
* Abstract jvm-commandline-argument-overridable config module.
|
||||
*/
|
||||
abstract class SystemPropertyOverridableConfigModule(getConfig: () -> Config, moduleName: String) : ConfigModule(getConfig) {
|
||||
val overridableConfig = SystemPropertyOverrideDelegate(getConfig, moduleName)
|
||||
}
|
||||
|
||||
class SystemPropertyOverrideDelegate(val config: Config, val moduleName: String) {
|
||||
inline operator fun <R, reified T> getValue(thisRef: R, property: KProperty<*>): T {
|
||||
/** Defines a config property that is overridable with jvm `-D` commandline arguments prefixed with [CONFIG_PREFIX] */
|
||||
class SystemPropertyOverrideDelegate(val getConfig: () -> Config, val moduleName: String) {
|
||||
inline operator fun <R, reified T> getValue(
|
||||
thisRef: R,
|
||||
property: KProperty<*>,
|
||||
): T {
|
||||
val config = getConfig()
|
||||
val configValue: T = config.getValue(thisRef, property)
|
||||
|
||||
val combined = System.getProperty(
|
||||
"suwayomi.tachidesk.config.$moduleName.${property.name}",
|
||||
configValue.toString()
|
||||
)
|
||||
val combined =
|
||||
System.getProperty(
|
||||
"$CONFIG_PREFIX.$moduleName.${property.name}",
|
||||
if (T::class.simpleName == "List") {
|
||||
ConfigValueFactory.fromAnyRef(configValue).render()
|
||||
} else {
|
||||
configValue.toString()
|
||||
},
|
||||
)
|
||||
|
||||
val asT = when(T::class.simpleName) {
|
||||
return when (T::class.simpleName) {
|
||||
"Int" -> combined.toInt()
|
||||
"Boolean" -> combined.toBoolean()
|
||||
"Double" -> combined.toDouble()
|
||||
"List" -> ConfigFactory.parseString("internal=" + combined).getStringList("internal").orEmpty()
|
||||
// add more types as needed
|
||||
else -> combined
|
||||
}
|
||||
|
||||
return asT as T
|
||||
else -> combined // covers String
|
||||
} as T
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,89 @@ package xyz.nulldev.ts.config
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import ch.qos.logback.classic.Level
|
||||
import ch.qos.logback.classic.LoggerContext
|
||||
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent
|
||||
import ch.qos.logback.core.rolling.RollingFileAppender
|
||||
import ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy
|
||||
import ch.qos.logback.core.util.FileSize
|
||||
import com.typesafe.config.Config
|
||||
import mu.KotlinLogging
|
||||
import org.slf4j.Logger
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
fun setLogLevel(level: Level) {
|
||||
(KotlinLogging.logger(Logger.ROOT_LOGGER_NAME).underlyingLogger as ch.qos.logback.classic.Logger).level = level
|
||||
private fun createRollingFileAppender(
|
||||
logContext: LoggerContext,
|
||||
logDirPath: String,
|
||||
): RollingFileAppender<ILoggingEvent> {
|
||||
val logFilename = "application"
|
||||
|
||||
val logEncoder =
|
||||
PatternLayoutEncoder().apply {
|
||||
pattern = "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n"
|
||||
context = logContext
|
||||
start()
|
||||
}
|
||||
|
||||
val appender =
|
||||
RollingFileAppender<ILoggingEvent>().apply {
|
||||
name = "FILE"
|
||||
context = logContext
|
||||
encoder = logEncoder
|
||||
file = "$logDirPath/$logFilename.log"
|
||||
}
|
||||
|
||||
val rollingPolicy =
|
||||
SizeAndTimeBasedRollingPolicy<ILoggingEvent>().apply {
|
||||
context = logContext
|
||||
setParent(appender)
|
||||
fileNamePattern = "$logDirPath/${logFilename}_%d{yyyy-MM-dd}_%i.log.gz"
|
||||
setMaxFileSize(FileSize.valueOf("10mb"))
|
||||
maxHistory = 14
|
||||
setTotalSizeCap(FileSize.valueOf("1gb"))
|
||||
start()
|
||||
}
|
||||
|
||||
appender.rollingPolicy = rollingPolicy
|
||||
appender.start()
|
||||
|
||||
return appender
|
||||
}
|
||||
|
||||
fun debugLogsEnabled(config: Config)
|
||||
= System.getProperty("suwayomi.tachidesk.config.server.debugLogsEnabled", config.getString("server.debugLogsEnabled")).toBoolean()
|
||||
private fun getBaseLogger(): ch.qos.logback.classic.Logger {
|
||||
return (KotlinLogging.logger(Logger.ROOT_LOGGER_NAME).underlyingLogger as ch.qos.logback.classic.Logger)
|
||||
}
|
||||
|
||||
private fun getLogger(name: String): ch.qos.logback.classic.Logger {
|
||||
val context = LoggerFactory.getILoggerFactory() as LoggerContext
|
||||
return context.getLogger(name)
|
||||
}
|
||||
|
||||
fun initLoggerConfig(appRootPath: String) {
|
||||
val context = LoggerFactory.getILoggerFactory() as LoggerContext
|
||||
val logger = getBaseLogger()
|
||||
// logback logs to the console by default (at least when adding a console appender logs in the console are duplicated)
|
||||
logger.addAppender(createRollingFileAppender(context, "$appRootPath/logs"))
|
||||
|
||||
// set "kotlin exposed" log level
|
||||
setLogLevelFor("Exposed", Level.ERROR)
|
||||
}
|
||||
|
||||
const val BASE_LOGGER_NAME = "_BaseLogger"
|
||||
|
||||
fun setLogLevelFor(
|
||||
name: String,
|
||||
level: Level,
|
||||
) {
|
||||
val logger =
|
||||
if (name == BASE_LOGGER_NAME) {
|
||||
getBaseLogger()
|
||||
} else {
|
||||
getLogger(name)
|
||||
}
|
||||
|
||||
logger.level = level
|
||||
}
|
||||
|
||||
fun debugLogsEnabled(config: Config) =
|
||||
System.getProperty("suwayomi.tachidesk.config.server.debugLogsEnabled", config.getString("server.debugLogsEnabled")).toBoolean()
|
||||
|
||||
@@ -2,5 +2,6 @@ package xyz.nulldev.ts.config.util
|
||||
|
||||
import com.typesafe.config.Config
|
||||
|
||||
operator fun Config.get(key: String) = getString(key)
|
||||
operator fun Config.get(key: String) =
|
||||
getString(key)
|
||||
?: throw IllegalStateException("Could not find value for config entry: $key!")
|
||||
|
||||
@@ -1,77 +1,38 @@
|
||||
|
||||
plugins {
|
||||
application
|
||||
kotlin("plugin.serialization")
|
||||
}
|
||||
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url = uri("https://jitpack.io")
|
||||
}
|
||||
|
||||
maven {
|
||||
url = uri("https://maven.google.com")
|
||||
}
|
||||
id(libs.plugins.kotlin.jvm.get().pluginId)
|
||||
id(libs.plugins.kotlin.serialization.get().pluginId)
|
||||
id(libs.plugins.ktlint.get().pluginId)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Shared
|
||||
implementation(libs.bundles.shared)
|
||||
testImplementation(libs.bundles.sharedTest)
|
||||
|
||||
// Android stub library
|
||||
implementation(fileTree("lib/"))
|
||||
|
||||
|
||||
// Android JAR libs
|
||||
// compileOnly( fileTree(dir: new File(rootProject.rootDir, "libs/other"), include: "*.jar")
|
||||
|
||||
// JSON
|
||||
compileOnly("com.google.code.gson:gson:2.8.6")
|
||||
|
||||
// Javassist
|
||||
compileOnly("org.javassist:javassist:3.27.0-GA")
|
||||
implementation(libs.android.stubs)
|
||||
|
||||
// XML
|
||||
compileOnly(group= "xmlpull", name= "xmlpull", version= "1.1.3.1")
|
||||
compileOnly(libs.xmlpull)
|
||||
|
||||
// Config API
|
||||
implementation(project(":AndroidCompat:Config"))
|
||||
implementation(projects.androidCompat.config)
|
||||
|
||||
// APK sig verifier
|
||||
compileOnly("com.android.tools.build:apksig:4.2.0-alpha13")
|
||||
compileOnly(libs.apksig)
|
||||
|
||||
// AndroidX annotations
|
||||
compileOnly("androidx.annotation:annotation:1.2.0-alpha01")
|
||||
compileOnly(libs.android.annotations)
|
||||
|
||||
// substitute for duktape-android
|
||||
// 'org.mozilla:rhino' includes some code that we don't need so use 'org.mozilla:rhino-runtime' instead
|
||||
implementation("org.mozilla:rhino-runtime:1.7.13")
|
||||
// 'org.mozilla:rhino-engine' provides the same interface as 'javax.script' a.k.a Nashorn
|
||||
implementation("org.mozilla:rhino-engine:1.7.13")
|
||||
implementation(libs.bundles.rhino)
|
||||
|
||||
// Kotlin wrapper around Java Preferences, makes certain things easier
|
||||
val multiplatformSettingsVersion = "0.7.7"
|
||||
implementation("com.russhwolf:multiplatform-settings-jvm:$multiplatformSettingsVersion")
|
||||
implementation("com.russhwolf:multiplatform-settings-serialization-jvm:$multiplatformSettingsVersion")
|
||||
implementation(libs.bundles.settings)
|
||||
|
||||
// Android version of SimpleDateFormat
|
||||
implementation("com.ibm.icu:icu4j:69.1")
|
||||
}
|
||||
implementation(libs.icu4j)
|
||||
|
||||
tasks {
|
||||
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
||||
kotlinOptions.freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn")
|
||||
}
|
||||
// OpenJDK lacks native JPEG encoder and native WEBP decoder
|
||||
implementation(libs.bundles.twelvemonkeys)
|
||||
}
|
||||
|
||||
//def fatJarTask = tasks.getByPath(':AndroidCompat:JVMPatch:fatJar')
|
||||
//
|
||||
//// Copy JVM core patches
|
||||
//task copyJVMPatches(type: Copy) {
|
||||
// from fatJarTask.outputs.files
|
||||
// into 'src/main/resources/patches'
|
||||
//}
|
||||
//
|
||||
//compileOnly(Java.dependsOn gradle.includedBuild('dex2jar').task(':dex-translator:assemble')
|
||||
//compileOnly(Java.dependsOn copyJVMPatches
|
||||
//copyJVMPatches.dependsOn fatJarTask
|
||||
//
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
android.jar
|
||||
@@ -0,0 +1,235 @@
|
||||
package android.graphics;
|
||||
|
||||
import android.annotation.ColorInt;
|
||||
import android.annotation.NonNull;
|
||||
|
||||
import javax.imageio.IIOImage;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.ImageWriteParam;
|
||||
import javax.imageio.ImageWriter;
|
||||
import javax.imageio.stream.ImageOutputStream;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.Raster;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Iterator;
|
||||
|
||||
public final class Bitmap {
|
||||
private final int width;
|
||||
private final int height;
|
||||
private final BufferedImage image;
|
||||
|
||||
public Bitmap(BufferedImage image) {
|
||||
this.image = image;
|
||||
this.width = image.getWidth();
|
||||
this.height = image.getHeight();
|
||||
}
|
||||
|
||||
public BufferedImage getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public enum CompressFormat {
|
||||
JPEG (0),
|
||||
PNG (1),
|
||||
WEBP (2),
|
||||
WEBP_LOSSY (3),
|
||||
WEBP_LOSSLESS (4);
|
||||
|
||||
CompressFormat(int nativeInt) {
|
||||
this.nativeInt = nativeInt;
|
||||
}
|
||||
|
||||
final int nativeInt;
|
||||
}
|
||||
|
||||
public enum Config {
|
||||
ALPHA_8(1),
|
||||
RGB_565(3),
|
||||
ARGB_4444(4),
|
||||
ARGB_8888(5),
|
||||
RGBA_F16(6),
|
||||
HARDWARE(7),
|
||||
RGBA_1010102(8);
|
||||
|
||||
final int nativeInt;
|
||||
|
||||
private static final Config[] sConfigs = {
|
||||
null, ALPHA_8, null, RGB_565, ARGB_4444, ARGB_8888, RGBA_F16, HARDWARE, RGBA_1010102
|
||||
};
|
||||
|
||||
Config(int ni) {
|
||||
this.nativeInt = ni;
|
||||
}
|
||||
|
||||
static Config nativeToConfig(int ni) {
|
||||
return sConfigs[ni];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Common code for checking that x and y are >= 0
|
||||
*
|
||||
* @param x x coordinate to ensure is >= 0
|
||||
* @param y y coordinate to ensure is >= 0
|
||||
*/
|
||||
private static void checkXYSign(int x, int y) {
|
||||
if (x < 0) {
|
||||
throw new IllegalArgumentException("x must be >= 0");
|
||||
}
|
||||
if (y < 0) {
|
||||
throw new IllegalArgumentException("y must be >= 0");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Common code for checking that width and height are > 0
|
||||
*
|
||||
* @param width width to ensure is > 0
|
||||
* @param height height to ensure is > 0
|
||||
*/
|
||||
private static void checkWidthHeight(int width, int height) {
|
||||
if (width <= 0) {
|
||||
throw new IllegalArgumentException("width must be > 0");
|
||||
}
|
||||
if (height <= 0) {
|
||||
throw new IllegalArgumentException("height must be > 0");
|
||||
}
|
||||
}
|
||||
|
||||
public static Bitmap createBitmap(int width, int height, Config config) {
|
||||
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
|
||||
return new Bitmap(image);
|
||||
}
|
||||
|
||||
public static Bitmap createBitmap(@NonNull Bitmap source, int x, int y, int width, int height) {
|
||||
checkXYSign(x, y);
|
||||
checkWidthHeight(width, height);
|
||||
if (x + width > source.getWidth()) {
|
||||
throw new IllegalArgumentException("x + width must be <= bitmap.width()");
|
||||
}
|
||||
if (y + height > source.getHeight()) {
|
||||
throw new IllegalArgumentException("y + height must be <= bitmap.height()");
|
||||
}
|
||||
|
||||
// Android will make a copy when creating a sub image,
|
||||
// so we do the same here
|
||||
BufferedImage subImage = source.image.getSubimage(x, y, width, height);
|
||||
BufferedImage newImage = new BufferedImage(subImage.getWidth(), subImage.getHeight(), subImage.getType());
|
||||
newImage.setData(subImage.getData());
|
||||
|
||||
return new Bitmap(newImage);
|
||||
}
|
||||
|
||||
public boolean compress(CompressFormat format, int quality, OutputStream stream) {
|
||||
if (stream == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
if (quality < 0 || quality > 100) {
|
||||
throw new IllegalArgumentException("quality must be 0..100");
|
||||
}
|
||||
float qualityFloat = ((float) quality) / 100;
|
||||
|
||||
String formatString;
|
||||
if (format == Bitmap.CompressFormat.PNG) {
|
||||
formatString = "png";
|
||||
} else if (format == Bitmap.CompressFormat.JPEG) {
|
||||
formatString = "jpg";
|
||||
} else {
|
||||
throw new IllegalArgumentException("unsupported compression format!");
|
||||
}
|
||||
|
||||
Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName(formatString);
|
||||
if (!writers.hasNext()) {
|
||||
throw new IllegalStateException("no image writers found for this format!");
|
||||
}
|
||||
ImageWriter writer = writers.next();
|
||||
|
||||
ImageOutputStream ios;
|
||||
try {
|
||||
ios = ImageIO.createImageOutputStream(stream);
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
writer.setOutput(ios);
|
||||
|
||||
ImageWriteParam param = writer.getDefaultWriteParam();
|
||||
if ("jpg".equals(formatString)) {
|
||||
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
|
||||
param.setCompressionQuality(qualityFloat);
|
||||
}
|
||||
|
||||
try {
|
||||
writer.write(null, new IIOImage(image, null, null), param);
|
||||
ios.close();
|
||||
writer.dispose();
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shared code to check for illegal arguments passed to getPixels()
|
||||
* or setPixels()
|
||||
*
|
||||
* @param x left edge of the area of pixels to access
|
||||
* @param y top edge of the area of pixels to access
|
||||
* @param width width of the area of pixels to access
|
||||
* @param height height of the area of pixels to access
|
||||
* @param offset offset into pixels[] array
|
||||
* @param stride number of elements in pixels[] between each logical row
|
||||
* @param pixels array to hold the area of pixels being accessed
|
||||
*/
|
||||
private void checkPixelsAccess(int x, int y, int width, int height,
|
||||
int offset, int stride, int[] pixels) {
|
||||
checkXYSign(x, y);
|
||||
if (width < 0) {
|
||||
throw new IllegalArgumentException("width must be >= 0");
|
||||
}
|
||||
if (height < 0) {
|
||||
throw new IllegalArgumentException("height must be >= 0");
|
||||
}
|
||||
if (x + width > getWidth()) {
|
||||
throw new IllegalArgumentException(
|
||||
"x + width must be <= bitmap.width()");
|
||||
}
|
||||
if (y + height > getHeight()) {
|
||||
throw new IllegalArgumentException(
|
||||
"y + height must be <= bitmap.height()");
|
||||
}
|
||||
if (Math.abs(stride) < width) {
|
||||
throw new IllegalArgumentException("abs(stride) must be >= width");
|
||||
}
|
||||
int lastScanline = offset + (height - 1) * stride;
|
||||
int length = pixels.length;
|
||||
if (offset < 0 || (offset + width > length)
|
||||
|| lastScanline < 0
|
||||
|| (lastScanline + width > length)) {
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
}
|
||||
}
|
||||
|
||||
public void getPixels(@ColorInt int[] pixels, int offset, int stride,
|
||||
int x, int y, int width, int height) {
|
||||
checkPixelsAccess(x, y, width, height, offset, stride, pixels);
|
||||
|
||||
Raster raster = image.getData();
|
||||
int[] rasterPixels = raster.getPixels(x, y, width, height, (int[]) null);
|
||||
|
||||
for (int ht = 0; ht < height; ht++) {
|
||||
int rowOffset = offset + stride * ht;
|
||||
System.arraycopy(rasterPixels, ht * width, pixels, rowOffset, width);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package android.graphics;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.ImageReader;
|
||||
import javax.imageio.stream.ImageInputStream;
|
||||
|
||||
public class BitmapFactory {
|
||||
public static Bitmap decodeStream(InputStream inputStream) {
|
||||
Bitmap bitmap = null;
|
||||
|
||||
try {
|
||||
ImageInputStream imageInputStream = ImageIO.createImageInputStream(inputStream);
|
||||
Iterator<ImageReader> imageReaders = ImageIO.getImageReaders(imageInputStream);
|
||||
|
||||
if (!imageReaders.hasNext()) {
|
||||
throw new IllegalArgumentException("no reader for image");
|
||||
}
|
||||
|
||||
ImageReader imageReader = imageReaders.next();
|
||||
imageReader.setInput(imageInputStream);
|
||||
|
||||
BufferedImage image = imageReader.read(0, imageReader.getDefaultReadParam());
|
||||
bitmap = new Bitmap(image);
|
||||
|
||||
imageReader.dispose();
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
public static Bitmap decodeByteArray(byte[] data, int offset, int length) {
|
||||
Bitmap bitmap = null;
|
||||
|
||||
ByteArrayInputStream byteArrayStream = new ByteArrayInputStream(data);
|
||||
try {
|
||||
BufferedImage image = ImageIO.read(byteArrayStream);
|
||||
bitmap = new Bitmap(image);
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package android.graphics;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
public final class Canvas {
|
||||
private BufferedImage canvasImage;
|
||||
private Graphics2D canvas;
|
||||
|
||||
public Canvas(Bitmap bitmap) {
|
||||
canvasImage = bitmap.getImage();
|
||||
canvas = canvasImage.createGraphics();
|
||||
}
|
||||
|
||||
public void drawBitmap(Bitmap sourceBitmap, Rect src, Rect dst, Paint paint) {
|
||||
BufferedImage sourceImage = sourceBitmap.getImage();
|
||||
BufferedImage sourceImageCropped = sourceImage.getSubimage(src.left, src.top, src.getWidth(), src.getHeight());
|
||||
canvas.drawImage(sourceImageCropped, null, dst.left, dst.top);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package android.graphics;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public final class Rect {
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
|
||||
private static final class UnflattenHelper {
|
||||
private static final Pattern FLATTENED_PATTERN = Pattern.compile(
|
||||
"(-?\\d+) (-?\\d+) (-?\\d+) (-?\\d+)");
|
||||
|
||||
static Matcher getMatcher(String str) {
|
||||
return FLATTENED_PATTERN.matcher(str);
|
||||
}
|
||||
}
|
||||
|
||||
public Rect() {
|
||||
}
|
||||
|
||||
public Rect(int left, int top, int right, int bottom) {
|
||||
this.left = left;
|
||||
this.top = top;
|
||||
this.right = right;
|
||||
this.bottom = bottom;
|
||||
}
|
||||
|
||||
public Rect(Rect r) {
|
||||
if (r == null) {
|
||||
this.left = 0;
|
||||
this.top = 0;
|
||||
this.right = 0;
|
||||
this.bottom = 0;
|
||||
} else {
|
||||
this.left = left;
|
||||
this.top = top;
|
||||
this.right = right;
|
||||
this.bottom = bottom;
|
||||
}
|
||||
}
|
||||
|
||||
public final int getWidth() {
|
||||
return right - left;
|
||||
}
|
||||
|
||||
public final int getHeight() {
|
||||
return bottom - top;
|
||||
}
|
||||
|
||||
public static Rect unflattenFromString(String str) {
|
||||
if (str.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Matcher matcher = UnflattenHelper.getMatcher(str);
|
||||
if (!matcher.matches()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Rect(Integer.parseInt(matcher.group(1)),
|
||||
Integer.parseInt(matcher.group(2)),
|
||||
Integer.parseInt(matcher.group(3)),
|
||||
Integer.parseInt(matcher.group(4)));
|
||||
}
|
||||
|
||||
public String toShortString() {
|
||||
return toShortString(new StringBuilder(32));
|
||||
}
|
||||
|
||||
public String toShortString(StringBuilder sb) {
|
||||
sb.setLength(0);
|
||||
sb.append('['); sb.append(left); sb.append(',');
|
||||
sb.append(top); sb.append("]["); sb.append(right);
|
||||
sb.append(','); sb.append(bottom); sb.append(']');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String flattenToString() {
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append(left);
|
||||
sb.append(' ');
|
||||
sb.append(top);
|
||||
sb.append(' ');
|
||||
sb.append(right);
|
||||
sb.append(' ');
|
||||
sb.append(bottom);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeInt(left);
|
||||
out.writeInt(top);
|
||||
out.writeInt(right);
|
||||
out.writeInt(bottom);
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<Rect> CREATOR = new Parcelable.Creator<Rect>() {
|
||||
@Override
|
||||
public Rect createFromParcel(Parcel in) {
|
||||
Rect r = new Rect();
|
||||
r.readFromParcel(in);
|
||||
return r;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rect[] newArray(int size) {
|
||||
return new Rect[size];
|
||||
}
|
||||
};
|
||||
|
||||
public void readFromParcel(Parcel in) {
|
||||
left = in.readInt();
|
||||
top = in.readInt();
|
||||
right = in.readInt();
|
||||
bottom = in.readInt();
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,10 @@ import android.content.Context
|
||||
class PreferenceManager {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun getDefaultSharedPreferences(context: Context)
|
||||
= context.getSharedPreferences(context.applicationInfo.packageName,
|
||||
Context.MODE_PRIVATE)!!
|
||||
fun getDefaultSharedPreferences(context: Context) =
|
||||
context.getSharedPreferences(
|
||||
context.applicationInfo.packageName,
|
||||
Context.MODE_PRIVATE,
|
||||
)!!
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ package android.text;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.safety.Whitelist;
|
||||
import org.jsoup.safety.Safelist;
|
||||
import org.xml.sax.XMLReader;
|
||||
|
||||
/**
|
||||
@@ -18,7 +18,7 @@ import org.xml.sax.XMLReader;
|
||||
public class Html {
|
||||
|
||||
public static Spanned fromHtml(String source) {
|
||||
return new FakeSpanned(Jsoup.clean(source, Whitelist.none()));
|
||||
return new FakeSpanned(Jsoup.clean(source, Safelist.none()));
|
||||
}
|
||||
|
||||
public static Spanned fromHtml(String source, Html.ImageGetter imageGetter, Html.TagHandler tagHandler) {
|
||||
|
||||
@@ -0,0 +1,247 @@
|
||||
package android.webkit;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import xyz.nulldev.androidcompat.webkit.CookieManagerImpl;
|
||||
|
||||
public abstract class CookieManager {
|
||||
/**
|
||||
* @deprecated This class should not be constructed by applications, use {@link #getInstance}
|
||||
* instead to fetch the singleton instance.
|
||||
*/
|
||||
// TODO(ntfschr): mark this as @SystemApi after a year.
|
||||
@Deprecated
|
||||
public CookieManager() {}
|
||||
@Override
|
||||
protected Object clone() throws CloneNotSupportedException {
|
||||
throw new CloneNotSupportedException("doesn't implement Cloneable");
|
||||
}
|
||||
|
||||
private static CookieManager INSTANCE = null;
|
||||
private static final Object lock = new Object();
|
||||
/**
|
||||
* Gets the singleton CookieManager instance.
|
||||
*
|
||||
* @return the singleton CookieManager instance
|
||||
*/
|
||||
public static CookieManager getInstance() {
|
||||
if (INSTANCE != null) {
|
||||
return INSTANCE;
|
||||
} else {
|
||||
synchronized (lock) {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new CookieManagerImpl();
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets whether the application's {@link WebView} instances should send and
|
||||
* accept cookies.
|
||||
* By default this is set to {@code true} and the WebView accepts cookies.
|
||||
* <p>
|
||||
* When this is {@code true}
|
||||
* {@link CookieManager#setAcceptThirdPartyCookies setAcceptThirdPartyCookies} and
|
||||
* {@link CookieManager#setAcceptFileSchemeCookies setAcceptFileSchemeCookies}
|
||||
* can be used to control the policy for those specific types of cookie.
|
||||
*
|
||||
* @param accept whether {@link WebView} instances should send and accept
|
||||
* cookies
|
||||
*/
|
||||
public abstract void setAcceptCookie(boolean accept);
|
||||
/**
|
||||
* Gets whether the application's {@link WebView} instances send and accept
|
||||
* cookies.
|
||||
*
|
||||
* @return {@code true} if {@link WebView} instances send and accept cookies
|
||||
*/
|
||||
public abstract boolean acceptCookie();
|
||||
/**
|
||||
* Sets whether the {@link WebView} should allow third party cookies to be set.
|
||||
* Allowing third party cookies is a per WebView policy and can be set
|
||||
* differently on different WebView instances.
|
||||
* <p>
|
||||
* Apps that target {@link android.os.Build.VERSION_CODES#KITKAT} or below
|
||||
* default to allowing third party cookies. Apps targeting
|
||||
* {@link android.os.Build.VERSION_CODES#LOLLIPOP} or later default to disallowing
|
||||
* third party cookies.
|
||||
*
|
||||
* @param webview the {@link WebView} instance to set the cookie policy on
|
||||
* @param accept whether the {@link WebView} instance should accept
|
||||
* third party cookies
|
||||
*/
|
||||
public abstract void setAcceptThirdPartyCookies(WebView webview, boolean accept);
|
||||
/**
|
||||
* Gets whether the {@link WebView} should allow third party cookies to be set.
|
||||
*
|
||||
* @param webview the {@link WebView} instance to get the cookie policy for
|
||||
* @return {@code true} if the {@link WebView} accepts third party cookies
|
||||
*/
|
||||
public abstract boolean acceptThirdPartyCookies(WebView webview);
|
||||
/**
|
||||
* Sets a single cookie (key-value pair) for the given URL. Any existing cookie with the same
|
||||
* host, path and name will be replaced with the new cookie. The cookie being set
|
||||
* will be ignored if it is expired. To set multiple cookies, your application should invoke
|
||||
* this method multiple times.
|
||||
*
|
||||
* <p>The {@code value} parameter must follow the format of the {@code Set-Cookie} HTTP
|
||||
* response header defined by
|
||||
* <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03">RFC6265bis</a>.
|
||||
* This is a key-value pair of the form {@code "key=value"}, optionally followed by a list of
|
||||
* cookie attributes delimited with semicolons (ex. {@code "key=value; Max-Age=123"}). Please
|
||||
* consult the RFC specification for a list of valid attributes.
|
||||
*
|
||||
* <p class="note"><b>Note:</b> if specifying a {@code value} containing the {@code "Secure"}
|
||||
* attribute, {@code url} must use the {@code "https://"} scheme.
|
||||
*
|
||||
* @param url the URL for which the cookie is to be set
|
||||
* @param value the cookie as a string, using the format of the 'Set-Cookie'
|
||||
* HTTP response header
|
||||
*/
|
||||
public abstract void setCookie(String url, String value);
|
||||
/**
|
||||
* Sets a single cookie (key-value pair) for the given URL. Any existing cookie with the same
|
||||
* host, path and name will be replaced with the new cookie. The cookie being set
|
||||
* will be ignored if it is expired. To set multiple cookies, your application should invoke
|
||||
* this method multiple times.
|
||||
*
|
||||
* <p>The {@code value} parameter must follow the format of the {@code Set-Cookie} HTTP
|
||||
* response header defined by
|
||||
* <a href="https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03">RFC6265bis</a>.
|
||||
* This is a key-value pair of the form {@code "key=value"}, optionally followed by a list of
|
||||
* cookie attributes delimited with semicolons (ex. {@code "key=value; Max-Age=123"}). Please
|
||||
* consult the RFC specification for a list of valid attributes.
|
||||
*
|
||||
* <p>This method is asynchronous. If a {@link ValueCallback} is provided,
|
||||
* {@link ValueCallback#onReceiveValue} will be called on the current
|
||||
* thread's {@link android.os.Looper} once the operation is complete.
|
||||
* The value provided to the callback indicates whether the cookie was set successfully.
|
||||
* You can pass {@code null} as the callback if you don't need to know when the operation
|
||||
* completes or whether it succeeded, and in this case it is safe to call the method from a
|
||||
* thread without a Looper.
|
||||
*
|
||||
* <p class="note"><b>Note:</b> if specifying a {@code value} containing the {@code "Secure"}
|
||||
* attribute, {@code url} must use the {@code "https://"} scheme.
|
||||
*
|
||||
* @param url the URL for which the cookie is to be set
|
||||
* @param value the cookie as a string, using the format of the 'Set-Cookie'
|
||||
* HTTP response header
|
||||
* @param callback a callback to be executed when the cookie has been set
|
||||
*/
|
||||
public abstract void setCookie(String url, String value, @Nullable ValueCallback<Boolean>
|
||||
callback);
|
||||
/**
|
||||
* Gets all the cookies for the given URL. This may return multiple key-value pairs if multiple
|
||||
* cookies are associated with this URL, in which case each cookie will be delimited by {@code
|
||||
* "; "} characters (semicolon followed by a space). Each key-value pair will be of the form
|
||||
* {@code "key=value"}.
|
||||
*
|
||||
* @param url the URL for which the cookies are requested
|
||||
* @return value the cookies as a string, using the format of the 'Cookie'
|
||||
* HTTP request header
|
||||
*/
|
||||
public abstract String getCookie(String url);
|
||||
|
||||
/**
|
||||
* Removes all session cookies, which are cookies without an expiration
|
||||
* date.
|
||||
* @deprecated use {@link #removeSessionCookies(ValueCallback)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract void removeSessionCookie();
|
||||
/**
|
||||
* Removes all session cookies, which are cookies without an expiration
|
||||
* date.
|
||||
* <p>
|
||||
* This method is asynchronous.
|
||||
* If a {@link ValueCallback} is provided,
|
||||
* {@link ValueCallback#onReceiveValue(Object)} will be called on the current
|
||||
* thread's {@link android.os.Looper} once the operation is complete.
|
||||
* The value provided to the callback indicates whether any cookies were removed.
|
||||
* You can pass {@code null} as the callback if you don't need to know when the operation
|
||||
* completes or whether any cookie were removed, and in this case it is safe to call the
|
||||
* method from a thread without a Looper.
|
||||
* @param callback a callback which is executed when the session cookies have been removed
|
||||
*/
|
||||
public abstract void removeSessionCookies(@Nullable ValueCallback<Boolean> callback);
|
||||
/**
|
||||
* Removes all cookies.
|
||||
* @deprecated Use {@link #removeAllCookies(ValueCallback)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract void removeAllCookie();
|
||||
/**
|
||||
* Removes all cookies.
|
||||
* <p>
|
||||
* This method is asynchronous.
|
||||
* If a {@link ValueCallback} is provided,
|
||||
* {@link ValueCallback#onReceiveValue(Object)} will be called on the current
|
||||
* thread's {@link android.os.Looper} once the operation is complete.
|
||||
* The value provided to the callback indicates whether any cookies were removed.
|
||||
* You can pass {@code null} as the callback if you don't need to know when the operation
|
||||
* completes or whether any cookies were removed, and in this case it is safe to call the
|
||||
* method from a thread without a Looper.
|
||||
* @param callback a callback which is executed when the cookies have been removed
|
||||
*/
|
||||
public abstract void removeAllCookies(@Nullable ValueCallback<Boolean> callback);
|
||||
/**
|
||||
* Gets whether there are stored cookies.
|
||||
*
|
||||
* @return {@code true} if there are stored cookies
|
||||
*/
|
||||
public abstract boolean hasCookies();
|
||||
/**
|
||||
* Removes all expired cookies.
|
||||
* @deprecated The WebView handles removing expired cookies automatically.
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract void removeExpiredCookie();
|
||||
/**
|
||||
* Ensures all cookies currently accessible through the getCookie API are
|
||||
* written to persistent storage.
|
||||
* This call will block the caller until it is done and may perform I/O.
|
||||
*/
|
||||
public abstract void flush();
|
||||
/**
|
||||
* Gets whether the application's {@link WebView} instances send and accept
|
||||
* cookies for file scheme URLs.
|
||||
*
|
||||
* @return {@code true} if {@link WebView} instances send and accept cookies for
|
||||
* file scheme URLs
|
||||
*/
|
||||
// Static for backward compatibility.
|
||||
public static boolean allowFileSchemeCookies() {
|
||||
return getInstance().allowFileSchemeCookiesImpl();
|
||||
}
|
||||
|
||||
public abstract boolean allowFileSchemeCookiesImpl();
|
||||
|
||||
/**
|
||||
* Sets whether the application's {@link WebView} instances should send and accept cookies for
|
||||
* file scheme URLs.
|
||||
* <p>
|
||||
* Use of cookies with file scheme URLs is potentially insecure and turned off by default. All
|
||||
* {@code file://} URLs share all their cookies, which may lead to leaking private app cookies
|
||||
* (ex. any malicious file can access cookies previously set by other (trusted) files).
|
||||
* <p class="note">
|
||||
* Loading content via {@code file://} URLs is generally discouraged. See the note in
|
||||
* {@link WebSettings#setAllowFileAccess}.
|
||||
* Using <a href="{@docRoot}reference/androidx/webkit/WebViewAssetLoader.html">
|
||||
* androidx.webkit.WebViewAssetLoader</a> to load files over {@code http(s)://} URLs allows
|
||||
* the standard web security model to be used for setting and sharing cookies for local files.
|
||||
* <p>
|
||||
* Note that calls to this method will have no effect if made after calling other
|
||||
* {@link CookieManager} APIs.
|
||||
*
|
||||
* @deprecated This setting is not secure, please use
|
||||
* <a href="{@docRoot}reference/androidx/webkit/WebViewAssetLoader.html">
|
||||
* androidx.webkit.WebViewAssetLoader</a> instead.
|
||||
*/
|
||||
// Static for backward compatibility.
|
||||
@Deprecated
|
||||
public static void setAcceptFileSchemeCookies(boolean accept) {
|
||||
getInstance().setAcceptFileSchemeCookiesImpl(accept);
|
||||
}
|
||||
|
||||
public abstract void setAcceptFileSchemeCookiesImpl(boolean accept);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:Suppress("NOTHING_TO_INLINE") // Aliases to public API.
|
||||
|
||||
package androidx.core.net
|
||||
|
||||
import android.net.Uri
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Creates a Uri from the given encoded URI string.
|
||||
*
|
||||
* @see Uri.parse
|
||||
*/
|
||||
public inline fun String.toUri(): Uri = Uri.parse(this)
|
||||
|
||||
/**
|
||||
* Creates a Uri from the given file.
|
||||
*
|
||||
* @see Uri.fromFile
|
||||
*/
|
||||
public inline fun File.toUri(): Uri = Uri.fromFile(this)
|
||||
|
||||
/**
|
||||
* Creates a [File] from the given [Uri]. Note that this will throw an
|
||||
* [IllegalArgumentException] when invoked on a [Uri] that lacks `file` scheme.
|
||||
*/
|
||||
public fun Uri.toFile(): File {
|
||||
require(scheme == "file") { "Uri lacks 'file' scheme: $this" }
|
||||
return File(requireNotNull(path) { "Uri path is null: $this" })
|
||||
}
|
||||
@@ -13,33 +13,49 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import java.util.Set;
|
||||
|
||||
public class MultiSelectListPreference extends DialogPreference {
|
||||
// reference: https://android.googlesource.com/platform/frameworks/support/+/996971f962fcd554339a7cb2859cef9ca89dbcb7/preference/preference/src/main/java/androidx/preference/MultiSelectListPreference.java
|
||||
// Note: remove @JsonIgnore and implement methods if any extension ever uses these methods or the variables behind them
|
||||
|
||||
public MultiSelectListPreference(Context context) { super(context); }
|
||||
private CharSequence[] entries;
|
||||
private CharSequence[] entryValues;
|
||||
|
||||
public MultiSelectListPreference(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public void setEntries(CharSequence[] entries) {
|
||||
this.entries = entries;
|
||||
}
|
||||
|
||||
public CharSequence[] getEntries() {
|
||||
return entries;
|
||||
}
|
||||
|
||||
public void setEntryValues(CharSequence[] entryValues) {
|
||||
this.entryValues = entryValues;
|
||||
}
|
||||
|
||||
public CharSequence[] getEntryValues() {
|
||||
return entryValues;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public void setEntries(CharSequence[] entries) { throw new RuntimeException("Stub!"); }
|
||||
public void setValues(Set<String> values) {
|
||||
throw new RuntimeException("Stub!");
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public CharSequence[] getEntries() { throw new RuntimeException("Stub!"); }
|
||||
public Set<String> getValues() {
|
||||
throw new RuntimeException("Stub!");
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public void setEntryValues(CharSequence[] entryValues) { throw new RuntimeException("Stub!"); }
|
||||
|
||||
@JsonIgnore
|
||||
public CharSequence[] getEntryValues() { throw new RuntimeException("Stub!"); }
|
||||
|
||||
@JsonIgnore
|
||||
public void setValues(Set<String> values) { throw new RuntimeException("Stub!"); }
|
||||
|
||||
@JsonIgnore
|
||||
public Set<String> getValues() { throw new RuntimeException("Stub!"); }
|
||||
|
||||
public int findIndexOfValue(String value) { throw new RuntimeException("Stub!"); }
|
||||
public int findIndexOfValue(String value) {
|
||||
throw new RuntimeException("Stub!");
|
||||
}
|
||||
|
||||
/** Tachidesk specific API */
|
||||
@Override
|
||||
public String getDefaultValueType() {
|
||||
return "Set";
|
||||
return "Set<String>";
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ package androidx.preference;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* A minimal implementation of androidx.preference.Preference
|
||||
@@ -21,6 +22,7 @@ public class Preference {
|
||||
@JsonIgnore
|
||||
protected Context context;
|
||||
|
||||
private boolean isVisible;
|
||||
private String key;
|
||||
private CharSequence title;
|
||||
private CharSequence summary;
|
||||
@@ -99,6 +101,14 @@ public class Preference {
|
||||
return sharedPreferences;
|
||||
}
|
||||
|
||||
public void setVisible(boolean visible) {
|
||||
isVisible = visible;
|
||||
}
|
||||
|
||||
public boolean getVisible() {
|
||||
return isVisible;
|
||||
}
|
||||
|
||||
/** Tachidesk specific API */
|
||||
public void setSharedPreferences(SharedPreferences sharedPreferences) {
|
||||
this.sharedPreferences = sharedPreferences;
|
||||
@@ -113,18 +123,22 @@ public class Preference {
|
||||
}
|
||||
|
||||
/** Tachidesk specific API */
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object getCurrentValue() {
|
||||
switch (getDefaultValueType()) {
|
||||
case "String":
|
||||
return sharedPreferences.getString(key, (String)defaultValue);
|
||||
case "Boolean":
|
||||
return sharedPreferences.getBoolean(key, (Boolean)defaultValue);
|
||||
case "Set<String>":
|
||||
return sharedPreferences.getStringSet(key, (Set<String>)defaultValue);
|
||||
default:
|
||||
throw new RuntimeException("Unsupported type");
|
||||
}
|
||||
}
|
||||
|
||||
/** Tachidesk specific API */
|
||||
@SuppressWarnings("unchecked")
|
||||
public void saveNewValue(Object value) {
|
||||
switch (getDefaultValueType()) {
|
||||
case "String":
|
||||
@@ -133,6 +147,9 @@ public class Preference {
|
||||
case "Boolean":
|
||||
sharedPreferences.edit().putBoolean(key, (Boolean)value).apply();
|
||||
break;
|
||||
case "Set<String>":
|
||||
sharedPreferences.edit().putStringSet(key, (Set<String>)value).apply();
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("Unsupported type");
|
||||
}
|
||||
|
||||
@@ -13,7 +13,10 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
public class TwoStatePreference extends Preference {
|
||||
// Note: remove @JsonIgnore and implement methods if any extension ever uses these methods or the variables behind them
|
||||
|
||||
public TwoStatePreference(Context context) { super(context); }
|
||||
public TwoStatePreference(Context context) {
|
||||
super(context);
|
||||
setDefaultValue(false);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isChecked() { throw new RuntimeException("Stub!"); }
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package app.cash.quickjs;
|
||||
|
||||
import org.mozilla.javascript.ConsString;
|
||||
import org.mozilla.javascript.NativeArray;
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
import java.io.Closeable;
|
||||
|
||||
public final class QuickJs implements Closeable {
|
||||
private ScriptEngine engine;
|
||||
|
||||
public static QuickJs create() {
|
||||
return new QuickJs(new ScriptEngineManager());
|
||||
}
|
||||
|
||||
public QuickJs(ScriptEngineManager manager) {
|
||||
this.engine = manager.getEngineByName("rhino");
|
||||
}
|
||||
|
||||
public Object evaluate(String script, String fileName) {
|
||||
return this.evaluate(script);
|
||||
}
|
||||
|
||||
public Object evaluate(String script) {
|
||||
try {
|
||||
Object value = engine.eval(script);
|
||||
return translateType(value);
|
||||
} catch (Exception exception) {
|
||||
throw new QuickJsException(exception.getMessage(), exception);
|
||||
}
|
||||
}
|
||||
|
||||
private Object translateType(Object obj) {
|
||||
if (obj instanceof NativeArray) {
|
||||
NativeArray array = (NativeArray) obj;
|
||||
long length = array.getLength();
|
||||
Object[] objects = new Object[(int) length];
|
||||
for (int i = 0; i < (int) length; i++) {
|
||||
objects[i] = translateType(array.get(i));
|
||||
}
|
||||
return objects;
|
||||
}
|
||||
if (obj instanceof ConsString) {
|
||||
ConsString consString = (ConsString) obj;
|
||||
return consString.toString();
|
||||
}
|
||||
if (obj instanceof Long) {
|
||||
Long value = (Long) obj;
|
||||
return value.intValue();
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
public byte[] compile(String sourceCode, String fileName) {
|
||||
return sourceCode.getBytes();
|
||||
}
|
||||
|
||||
|
||||
public Object execute(byte[] bytecode) {
|
||||
return this.evaluate(new String(bytecode));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
this.engine = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.cash.quickjs;
|
||||
|
||||
public final class QuickJsException extends RuntimeException {
|
||||
public QuickJsException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
@@ -14,9 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.internal.util;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Bitmap.CompressFormat;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.util.ArrayMap;
|
||||
@@ -25,19 +26,14 @@ import android.util.Xml;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
import org.xmlpull.v1.XmlSerializer;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.ProtocolException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
/** {@hide} */
|
||||
public class XmlUtils {
|
||||
private static final String STRING_ARRAY_SEPARATOR = ":";
|
||||
@@ -1396,9 +1392,9 @@ public class XmlUtils {
|
||||
} else if (tagName.equals("long")) {
|
||||
return Long.valueOf(parser.getAttributeValue(null, "value"));
|
||||
} else if (tagName.equals("float")) {
|
||||
return new Float(parser.getAttributeValue(null, "value"));
|
||||
return Float.valueOf(parser.getAttributeValue(null, "value"));
|
||||
} else if (tagName.equals("double")) {
|
||||
return new Double(parser.getAttributeValue(null, "value"));
|
||||
return Double.valueOf(parser.getAttributeValue(null, "value"));
|
||||
} else if (tagName.equals("boolean")) {
|
||||
return Boolean.valueOf(parser.getAttributeValue(null, "value"));
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ import android.arch.persistence.db.framework.FrameworkSQLiteOpenHelperFactory
|
||||
|
||||
class RequerySQLiteOpenHelperFactory {
|
||||
fun create(configuration: SupportSQLiteOpenHelper.Configuration) = FrameworkSQLiteOpenHelperFactory().create(configuration)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package kotlinx.coroutines.experimental.android
|
||||
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
|
||||
val UI = GlobalScope.coroutineContext
|
||||
@@ -7,11 +7,10 @@ import org.kodein.di.instance
|
||||
import xyz.nulldev.androidcompat.androidimpl.CustomContext
|
||||
|
||||
class AndroidCompat {
|
||||
|
||||
val context: CustomContext by DI.global.instance()
|
||||
|
||||
fun startApp(application: Application) {
|
||||
application.attach(context)
|
||||
application.onCreate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package xyz.nulldev.androidcompat
|
||||
|
||||
import org.kodein.di.DI
|
||||
import org.kodein.di.conf.global
|
||||
import xyz.nulldev.androidcompat.bytecode.ModApplier
|
||||
import xyz.nulldev.androidcompat.config.ApplicationInfoConfigModule
|
||||
import xyz.nulldev.androidcompat.config.FilesConfigModule
|
||||
import xyz.nulldev.androidcompat.config.SystemConfigModule
|
||||
@@ -12,22 +11,20 @@ import xyz.nulldev.ts.config.GlobalConfigManager
|
||||
* Initializes the Android compatibility module
|
||||
*/
|
||||
class AndroidCompatInitializer {
|
||||
|
||||
val modApplier by lazy { ModApplier() }
|
||||
|
||||
fun init() {
|
||||
modApplier.apply()
|
||||
|
||||
DI.global.addImport(AndroidCompatModule().create())
|
||||
|
||||
//Register config modules
|
||||
// Register config modules
|
||||
GlobalConfigManager.registerModules(
|
||||
FilesConfigModule.register(GlobalConfigManager.config),
|
||||
ApplicationInfoConfigModule.register(GlobalConfigManager.config),
|
||||
SystemConfigModule.register(GlobalConfigManager.config)
|
||||
SystemConfigModule.register(GlobalConfigManager.config),
|
||||
)
|
||||
|
||||
// Set some properties extensions use
|
||||
System.setProperty("http.agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36")
|
||||
System.setProperty(
|
||||
"http.agent",
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,22 +18,24 @@ import xyz.nulldev.androidcompat.service.ServiceSupport
|
||||
*/
|
||||
|
||||
class AndroidCompatModule {
|
||||
fun create() = DI.Module("AndroidCompat") {
|
||||
bind<AndroidFiles>() with singleton { AndroidFiles() }
|
||||
fun create() =
|
||||
DI.Module("AndroidCompat") {
|
||||
bind<AndroidFiles>() with singleton { AndroidFiles() }
|
||||
|
||||
bind<ApplicationInfoImpl>() with singleton { ApplicationInfoImpl() }
|
||||
bind<ApplicationInfoImpl>() with singleton { ApplicationInfoImpl() }
|
||||
|
||||
bind<ServiceSupport>() with singleton { ServiceSupport() }
|
||||
bind<ServiceSupport>() with singleton { ServiceSupport() }
|
||||
|
||||
bind<FakePackageManager>() with singleton { FakePackageManager() }
|
||||
bind<FakePackageManager>() with singleton { FakePackageManager() }
|
||||
|
||||
bind<PackageController>() with singleton { PackageController() }
|
||||
bind<PackageController>() with singleton { PackageController() }
|
||||
|
||||
//Context
|
||||
bind<CustomContext>() with singleton { CustomContext() }
|
||||
bind<Context>() with singleton {
|
||||
val context: Context by DI.global.instance<CustomContext>()
|
||||
context
|
||||
// Context
|
||||
bind<CustomContext>() with singleton { CustomContext() }
|
||||
bind<Context>() with
|
||||
singleton {
|
||||
val context: Context by DI.global.instance<CustomContext>()
|
||||
context
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package xyz.nulldev.androidcompat.bytecode
|
||||
|
||||
import javassist.CtClass
|
||||
import mu.KotlinLogging
|
||||
|
||||
/**
|
||||
* Applies Javassist modifications
|
||||
*/
|
||||
|
||||
class ModApplier {
|
||||
|
||||
val logger = KotlinLogging.logger {}
|
||||
|
||||
fun apply() {
|
||||
logger.info { "Applying Javassist mods..." }
|
||||
val modifiedClasses = mutableListOf<CtClass>()
|
||||
|
||||
modifiedClasses.forEach {
|
||||
it.toClass()
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -1,18 +1,18 @@
|
||||
package xyz.nulldev.androidcompat.config
|
||||
|
||||
import com.typesafe.config.Config
|
||||
import io.github.config4k.getValue
|
||||
import xyz.nulldev.ts.config.ConfigModule
|
||||
|
||||
/**
|
||||
* Application info config.
|
||||
*/
|
||||
|
||||
class ApplicationInfoConfigModule(config: Config) : ConfigModule(config) {
|
||||
val packageName = config.getString("packageName")!!
|
||||
val debug = config.getBoolean("debug")
|
||||
class ApplicationInfoConfigModule(getConfig: () -> Config) : ConfigModule(getConfig) {
|
||||
val packageName: String by getConfig()
|
||||
val debug: Boolean by getConfig()
|
||||
|
||||
companion object {
|
||||
fun register(config: Config)
|
||||
= ApplicationInfoConfigModule(config.getConfig("android.app"))
|
||||
fun register(config: Config) = ApplicationInfoConfigModule { config.getConfig("android.app") }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
package xyz.nulldev.androidcompat.config
|
||||
|
||||
import com.typesafe.config.Config
|
||||
import io.github.config4k.getValue
|
||||
import xyz.nulldev.ts.config.ConfigModule
|
||||
|
||||
/**
|
||||
* Files configuration modules. Specifies where to store the Android files.
|
||||
*/
|
||||
|
||||
class FilesConfigModule(config: Config) : ConfigModule(config) {
|
||||
val dataDir = config.getString("dataDir")!!
|
||||
val filesDir = config.getString("filesDir")!!
|
||||
val noBackupFilesDir = config.getString("noBackupFilesDir")!!
|
||||
val externalFilesDirs: MutableList<String> = config.getStringList("externalFilesDirs")!!
|
||||
val obbDirs: MutableList<String> = config.getStringList("obbDirs")!!
|
||||
val cacheDir = config.getString("cacheDir")!!
|
||||
val codeCacheDir = config.getString("codeCacheDir")!!
|
||||
val externalCacheDirs: MutableList<String> = config.getStringList("externalCacheDirs")!!
|
||||
val externalMediaDirs: MutableList<String> = config.getStringList("externalMediaDirs")!!
|
||||
val rootDir = config.getString("rootDir")!!
|
||||
val externalStorageDir = config.getString("externalStorageDir")!!
|
||||
val downloadCacheDir = config.getString("downloadCacheDir")!!
|
||||
val databasesDir = config.getString("databasesDir")!!
|
||||
class FilesConfigModule(getConfig: () -> Config) : ConfigModule(getConfig) {
|
||||
val dataDir: String by getConfig()
|
||||
val filesDir: String by getConfig()
|
||||
val noBackupFilesDir: String by getConfig()
|
||||
val externalFilesDirs: MutableList<String> by getConfig()
|
||||
val obbDirs: MutableList<String> by getConfig()
|
||||
val cacheDir: String by getConfig()
|
||||
val codeCacheDir: String by getConfig()
|
||||
val externalCacheDirs: MutableList<String> by getConfig()
|
||||
val externalMediaDirs: MutableList<String> by getConfig()
|
||||
val rootDir: String by getConfig()
|
||||
val externalStorageDir: String by getConfig()
|
||||
val downloadCacheDir: String by getConfig()
|
||||
val databasesDir: String by getConfig()
|
||||
|
||||
val prefsDir = config.getString("prefsDir")!!
|
||||
val prefsDir: String by getConfig()
|
||||
|
||||
val packageDir = config.getString("packageDir")!!
|
||||
val packageDir: String by getConfig()
|
||||
|
||||
companion object {
|
||||
fun register(config: Config)
|
||||
= FilesConfigModule(config.getConfig("android.files"))
|
||||
fun register(config: Config) = FilesConfigModule { config.getConfig("android.files") }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
package xyz.nulldev.androidcompat.config
|
||||
|
||||
import com.typesafe.config.Config
|
||||
import io.github.config4k.getValue
|
||||
import xyz.nulldev.ts.config.ConfigModule
|
||||
|
||||
class SystemConfigModule(val config: Config) : ConfigModule(config) {
|
||||
val isDebuggable = config.getBoolean("isDebuggable")
|
||||
class SystemConfigModule(val getConfig: () -> Config) : ConfigModule(getConfig) {
|
||||
val isDebuggable: Boolean by getConfig()
|
||||
|
||||
val propertyPrefix = "properties."
|
||||
|
||||
fun getStringProperty(property: String) = config.getString("$propertyPrefix$property")!!
|
||||
fun getIntProperty(property: String) = config.getInt("$propertyPrefix$property")
|
||||
fun getLongProperty(property: String) = config.getLong("$propertyPrefix$property")
|
||||
fun getBooleanProperty(property: String) = config.getBoolean("$propertyPrefix$property")
|
||||
fun hasProperty(property: String) = config.hasPath("$propertyPrefix$property")
|
||||
fun getStringProperty(property: String) = getConfig().getString("$propertyPrefix$property")!!
|
||||
|
||||
fun getIntProperty(property: String) = getConfig().getInt("$propertyPrefix$property")
|
||||
|
||||
fun getLongProperty(property: String) = getConfig().getLong("$propertyPrefix$property")
|
||||
|
||||
fun getBooleanProperty(property: String) = getConfig().getBoolean("$propertyPrefix$property")
|
||||
|
||||
fun hasProperty(property: String) = getConfig().hasPath("$propertyPrefix$property")
|
||||
|
||||
companion object {
|
||||
fun register(config: Config)
|
||||
= SystemConfigModule(config.getConfig("android.system"))
|
||||
fun register(config: Config) = SystemConfigModule { config.getConfig("android.system") }
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+161
-55
@@ -9,30 +9,77 @@ package xyz.nulldev.androidcompat.io.sharedprefs
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import com.russhwolf.settings.ExperimentalSettingsApi
|
||||
import com.russhwolf.settings.ExperimentalSettingsImplementation
|
||||
import com.russhwolf.settings.JvmPreferencesSettings
|
||||
import com.russhwolf.settings.PropertiesSettings
|
||||
import com.russhwolf.settings.Settings
|
||||
import com.russhwolf.settings.serialization.decodeValue
|
||||
import com.russhwolf.settings.serialization.decodeValueOrNull
|
||||
import com.russhwolf.settings.serialization.encodeValue
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.SerializationException
|
||||
import kotlinx.serialization.builtins.SetSerializer
|
||||
import kotlinx.serialization.builtins.nullable
|
||||
import kotlinx.serialization.builtins.serializer
|
||||
import java.util.prefs.PreferenceChangeListener
|
||||
import java.util.prefs.Preferences
|
||||
import mu.KotlinLogging
|
||||
import xyz.nulldev.androidcompat.util.SafePath
|
||||
import xyz.nulldev.ts.config.ApplicationRootDir
|
||||
import java.util.Properties
|
||||
import kotlin.io.path.Path
|
||||
import kotlin.io.path.createParentDirectories
|
||||
import kotlin.io.path.deleteIfExists
|
||||
import kotlin.io.path.exists
|
||||
import kotlin.io.path.inputStream
|
||||
import kotlin.io.path.outputStream
|
||||
|
||||
@OptIn(ExperimentalSettingsImplementation::class, ExperimentalSerializationApi::class, ExperimentalSettingsApi::class)
|
||||
@OptIn(ExperimentalSerializationApi::class, ExperimentalSettingsApi::class)
|
||||
class JavaSharedPreferences(key: String) : SharedPreferences {
|
||||
private val javaPreferences = Preferences.userRoot().node("suwayomi/tachidesk/$key")
|
||||
private val preferences = JvmPreferencesSettings(javaPreferences)
|
||||
private val listeners = mutableMapOf<SharedPreferences.OnSharedPreferenceChangeListener, PreferenceChangeListener>()
|
||||
companion object {
|
||||
private val logger = KotlinLogging.logger {}
|
||||
}
|
||||
|
||||
private val file =
|
||||
Path(
|
||||
ApplicationRootDir,
|
||||
"settings",
|
||||
"${SafePath.buildValidFilename(key)}.xml",
|
||||
)
|
||||
private val properties =
|
||||
Properties().also { properties ->
|
||||
try {
|
||||
if (file.exists()) {
|
||||
file.inputStream().use { properties.loadFromXML(it) }
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
logger.error(e) { "Error loading settings from $key" }
|
||||
}
|
||||
}
|
||||
private val preferences =
|
||||
PropertiesSettings(
|
||||
properties,
|
||||
onModify = { properties ->
|
||||
try {
|
||||
if (properties.isEmpty) {
|
||||
file.deleteIfExists()
|
||||
} else {
|
||||
file.createParentDirectories()
|
||||
file.outputStream().use {
|
||||
properties.storeToXML(it, null)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
logger.error(e) { "Error saving settings in $key" }
|
||||
}
|
||||
},
|
||||
)
|
||||
private val listeners = mutableMapOf<SharedPreferences.OnSharedPreferenceChangeListener, (String) -> Unit>()
|
||||
|
||||
// TODO: 2021-05-29 Need to find a way to get this working with all pref types
|
||||
override fun getAll(): MutableMap<String, *> {
|
||||
return preferences.keys.associateWith { preferences.getStringOrNull(it) }.toMutableMap()
|
||||
}
|
||||
|
||||
override fun getString(key: String, defValue: String?): String? {
|
||||
override fun getString(
|
||||
key: String,
|
||||
defValue: String?,
|
||||
): String? {
|
||||
return if (defValue != null) {
|
||||
preferences.getString(key, defValue)
|
||||
} else {
|
||||
@@ -40,31 +87,46 @@ class JavaSharedPreferences(key: String) : SharedPreferences {
|
||||
}
|
||||
}
|
||||
|
||||
override fun getStringSet(key: String, defValues: MutableSet<String>?): MutableSet<String>? {
|
||||
override fun getStringSet(
|
||||
key: String,
|
||||
defValues: Set<String>?,
|
||||
): Set<String>? {
|
||||
try {
|
||||
return if (defValues != null) {
|
||||
preferences.decodeValue(SetSerializer(String.serializer()).nullable, key, defValues)
|
||||
preferences.decodeValue(SetSerializer(String.serializer()), key, defValues)
|
||||
} else {
|
||||
preferences.decodeValue(SetSerializer(String.serializer()).nullable, key, null)
|
||||
}?.toMutableSet()
|
||||
preferences.decodeValueOrNull(SetSerializer(String.serializer()), key)
|
||||
}
|
||||
} catch (e: SerializationException) {
|
||||
throw ClassCastException("$key was not a StringSet")
|
||||
}
|
||||
}
|
||||
|
||||
override fun getInt(key: String, defValue: Int): Int {
|
||||
override fun getInt(
|
||||
key: String,
|
||||
defValue: Int,
|
||||
): Int {
|
||||
return preferences.getInt(key, defValue)
|
||||
}
|
||||
|
||||
override fun getLong(key: String, defValue: Long): Long {
|
||||
override fun getLong(
|
||||
key: String,
|
||||
defValue: Long,
|
||||
): Long {
|
||||
return preferences.getLong(key, defValue)
|
||||
}
|
||||
|
||||
override fun getFloat(key: String, defValue: Float): Float {
|
||||
override fun getFloat(
|
||||
key: String,
|
||||
defValue: Float,
|
||||
): Float {
|
||||
return preferences.getFloat(key, defValue)
|
||||
}
|
||||
|
||||
override fun getBoolean(key: String, defValue: Boolean): Boolean {
|
||||
override fun getBoolean(
|
||||
key: String,
|
||||
defValue: Boolean,
|
||||
): Boolean {
|
||||
return preferences.getBoolean(key, defValue)
|
||||
}
|
||||
|
||||
@@ -73,60 +135,86 @@ class JavaSharedPreferences(key: String) : SharedPreferences {
|
||||
}
|
||||
|
||||
override fun edit(): SharedPreferences.Editor {
|
||||
return Editor(preferences)
|
||||
return Editor(preferences) { key ->
|
||||
listeners.forEach { (_, listener) ->
|
||||
listener(key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Editor(private val preferences: JvmPreferencesSettings) : SharedPreferences.Editor {
|
||||
val itemsToAdd = mutableMapOf<String, Any>()
|
||||
class Editor(private val preferences: Settings, private val notify: (String) -> Unit) : SharedPreferences.Editor {
|
||||
private val actions = mutableListOf<Action>()
|
||||
|
||||
override fun putString(key: String, value: String?): SharedPreferences.Editor {
|
||||
private sealed class Action {
|
||||
data class Add(val key: String, val value: Any) : Action()
|
||||
|
||||
data class Remove(val key: String) : Action()
|
||||
data object Clear : Action()
|
||||
}
|
||||
|
||||
override fun putString(
|
||||
key: String,
|
||||
value: String?,
|
||||
): SharedPreferences.Editor {
|
||||
if (value != null) {
|
||||
itemsToAdd[key] = value
|
||||
actions += Action.Add(key, value)
|
||||
} else {
|
||||
remove(key)
|
||||
actions += Action.Remove(key)
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
override fun putStringSet(
|
||||
key: String,
|
||||
values: MutableSet<String>?
|
||||
values: MutableSet<String>?,
|
||||
): SharedPreferences.Editor {
|
||||
if (values != null) {
|
||||
itemsToAdd[key] = values
|
||||
actions += Action.Add(key, values)
|
||||
} else {
|
||||
remove(key)
|
||||
actions += Action.Remove(key)
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
override fun putInt(key: String, value: Int): SharedPreferences.Editor {
|
||||
itemsToAdd[key] = value
|
||||
override fun putInt(
|
||||
key: String,
|
||||
value: Int,
|
||||
): SharedPreferences.Editor {
|
||||
actions += Action.Add(key, value)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun putLong(key: String, value: Long): SharedPreferences.Editor {
|
||||
itemsToAdd[key] = value
|
||||
override fun putLong(
|
||||
key: String,
|
||||
value: Long,
|
||||
): SharedPreferences.Editor {
|
||||
actions += Action.Add(key, value)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun putFloat(key: String, value: Float): SharedPreferences.Editor {
|
||||
itemsToAdd[key] = value
|
||||
override fun putFloat(
|
||||
key: String,
|
||||
value: Float,
|
||||
): SharedPreferences.Editor {
|
||||
actions += Action.Add(key, value)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun putBoolean(key: String, value: Boolean): SharedPreferences.Editor {
|
||||
itemsToAdd[key] = value
|
||||
override fun putBoolean(
|
||||
key: String,
|
||||
value: Boolean,
|
||||
): SharedPreferences.Editor {
|
||||
actions += Action.Add(key, value)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun remove(key: String): SharedPreferences.Editor {
|
||||
itemsToAdd.remove(key)
|
||||
actions += Action.Remove(key)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun clear(): SharedPreferences.Editor {
|
||||
itemsToAdd.clear()
|
||||
actions.add(Action.Clear)
|
||||
return this
|
||||
}
|
||||
|
||||
@@ -140,38 +228,56 @@ class JavaSharedPreferences(key: String) : SharedPreferences {
|
||||
}
|
||||
|
||||
private fun addToPreferences() {
|
||||
itemsToAdd.forEach { (key, value) ->
|
||||
actions.forEach {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
when (value) {
|
||||
is Set<*> -> preferences.encodeValue(SetSerializer(String.serializer()), key, value as Set<String>)
|
||||
is String -> preferences.putString(key, value)
|
||||
is Int -> preferences.putInt(key, value)
|
||||
is Long -> preferences.putLong(key, value)
|
||||
is Float -> preferences.putFloat(key, value)
|
||||
is Double -> preferences.putDouble(key, value)
|
||||
is Boolean -> preferences.putBoolean(key, value)
|
||||
when (it) {
|
||||
is Action.Add -> {
|
||||
when (val value = it.value) {
|
||||
is Set<*> -> preferences.encodeValue(SetSerializer(String.serializer()), it.key, value as Set<String>)
|
||||
is String -> preferences.putString(it.key, value)
|
||||
is Int -> preferences.putInt(it.key, value)
|
||||
is Long -> preferences.putLong(it.key, value)
|
||||
is Float -> preferences.putFloat(it.key, value)
|
||||
is Double -> preferences.putDouble(it.key, value)
|
||||
is Boolean -> preferences.putBoolean(it.key, value)
|
||||
}
|
||||
notify(it.key)
|
||||
}
|
||||
is Action.Remove -> {
|
||||
preferences.remove(it.key)
|
||||
/**
|
||||
* Set<String> are stored like
|
||||
* key.0 = value1
|
||||
* key.1 = value2
|
||||
* key.size = 2
|
||||
*/
|
||||
preferences.keys.forEach { key ->
|
||||
if (key.startsWith(it.key + ".")) {
|
||||
preferences.remove(key)
|
||||
}
|
||||
}
|
||||
|
||||
notify(it.key)
|
||||
}
|
||||
Action.Clear -> preferences.clear()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun registerOnSharedPreferenceChangeListener(listener: SharedPreferences.OnSharedPreferenceChangeListener) {
|
||||
val javaListener = PreferenceChangeListener {
|
||||
listener.onSharedPreferenceChanged(this, it.key)
|
||||
val javaListener: (String) -> Unit = {
|
||||
listener.onSharedPreferenceChanged(this, it)
|
||||
}
|
||||
listeners[listener] = javaListener
|
||||
javaPreferences.addPreferenceChangeListener(javaListener)
|
||||
}
|
||||
|
||||
override fun unregisterOnSharedPreferenceChangeListener(listener: SharedPreferences.OnSharedPreferenceChangeListener) {
|
||||
val registeredListener = listeners.remove(listener)
|
||||
if (registeredListener != null) {
|
||||
javaPreferences.removePreferenceChangeListener(registeredListener)
|
||||
}
|
||||
listeners.remove(listener)
|
||||
}
|
||||
|
||||
fun deleteAll(): Boolean {
|
||||
javaPreferences.removeNode()
|
||||
preferences.clear()
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,44 +14,51 @@ import java.io.File
|
||||
import javax.imageio.ImageIO
|
||||
import javax.xml.parsers.DocumentBuilderFactory
|
||||
|
||||
|
||||
|
||||
data class InstalledPackage(val root: File) {
|
||||
val apk = File(root, "package.apk")
|
||||
val jar = File(root, "translated.jar")
|
||||
val icon = File(root, "icon.png")
|
||||
|
||||
val info: PackageInfo
|
||||
get() = ApkParsers.getMetaInfo(apk).toPackageInfo(apk).also {
|
||||
val parsed = ApkFile(apk)
|
||||
val dbFactory = DocumentBuilderFactory.newInstance()
|
||||
val dBuilder = dbFactory.newDocumentBuilder()
|
||||
val doc = parsed.manifestXml.byteInputStream().use {
|
||||
dBuilder.parse(it)
|
||||
get() =
|
||||
ApkParsers.getMetaInfo(apk).toPackageInfo(apk).also {
|
||||
val parsed = ApkFile(apk)
|
||||
val dbFactory = DocumentBuilderFactory.newInstance()
|
||||
val dBuilder = dbFactory.newDocumentBuilder()
|
||||
val doc =
|
||||
parsed.manifestXml.byteInputStream().use {
|
||||
dBuilder.parse(it)
|
||||
}
|
||||
|
||||
it.applicationInfo.metaData =
|
||||
Bundle().apply {
|
||||
val appTag = doc.getElementsByTagName("application").item(0)
|
||||
|
||||
appTag?.childNodes?.toList()?.filter {
|
||||
it.nodeType == Node.ELEMENT_NODE
|
||||
}?.map {
|
||||
it as Element
|
||||
}?.filter {
|
||||
it.tagName == "meta-data"
|
||||
}?.map {
|
||||
putString(
|
||||
it.attributes.getNamedItem("android:name").nodeValue,
|
||||
it.attributes.getNamedItem("android:value").nodeValue,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
it.signatures =
|
||||
(
|
||||
parsed.apkSingers.flatMap { it.certificateMetas }
|
||||
// + parsed.apkV2Singers.flatMap { it.certificateMetas }
|
||||
) // Blocked by: https://github.com/hsiafan/apk-parser/issues/72
|
||||
.map { Signature(it.data) }.toTypedArray()
|
||||
}
|
||||
|
||||
it.applicationInfo.metaData = Bundle().apply {
|
||||
val appTag = doc.getElementsByTagName("application").item(0)
|
||||
|
||||
appTag?.childNodes?.toList()?.filter {
|
||||
it.nodeType == Node.ELEMENT_NODE
|
||||
}?.map {
|
||||
it as Element
|
||||
}?.filter {
|
||||
it.tagName == "meta-data"
|
||||
}?.map {
|
||||
putString(it.attributes.getNamedItem("android:name").nodeValue,
|
||||
it.attributes.getNamedItem("android:value").nodeValue)
|
||||
}
|
||||
}
|
||||
|
||||
it.signatures = (parsed.apkSingers.flatMap { it.certificateMetas }
|
||||
/*+ parsed.apkV2Singers.flatMap { it.certificateMetas }*/) // Blocked by: https://github.com/hsiafan/apk-parser/issues/72
|
||||
.map { Signature(it.data) }.toTypedArray()
|
||||
}
|
||||
|
||||
fun verify(): Boolean {
|
||||
val res = ApkVerifier.Builder(apk)
|
||||
val res =
|
||||
ApkVerifier.Builder(apk)
|
||||
.build()
|
||||
.verify()
|
||||
|
||||
@@ -62,14 +69,15 @@ data class InstalledPackage(val root: File) {
|
||||
try {
|
||||
val icons = ApkFile(apk).allIcons
|
||||
|
||||
val read = icons.filter { it.isFile }.map {
|
||||
it.data.inputStream().use {
|
||||
ImageIO.read(it)
|
||||
}
|
||||
}.sortedByDescending { it.width * it.height }.firstOrNull() ?: return
|
||||
val read =
|
||||
icons.filter { it.isFile }.map {
|
||||
it.data.inputStream().use {
|
||||
ImageIO.read(it)
|
||||
}
|
||||
}.sortedByDescending { it.width * it.height }.firstOrNull() ?: return
|
||||
|
||||
ImageIO.write(read, "png", icon)
|
||||
} catch(e: Exception) {
|
||||
} catch (e: Exception) {
|
||||
icon.delete()
|
||||
}
|
||||
}
|
||||
@@ -77,7 +85,7 @@ data class InstalledPackage(val root: File) {
|
||||
fun writeJar() {
|
||||
try {
|
||||
Dex2jar.from(apk).to(jar.toPath())
|
||||
} catch(e: Exception) {
|
||||
} catch (e: Exception) {
|
||||
jar.delete()
|
||||
}
|
||||
}
|
||||
@@ -92,4 +100,4 @@ data class InstalledPackage(val root: File) {
|
||||
return out
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,10 @@ class PackageController {
|
||||
return File(androidFiles.packagesDir, pn)
|
||||
}
|
||||
|
||||
fun installPackage(apk: File, allowReinstall: Boolean) {
|
||||
fun installPackage(
|
||||
apk: File,
|
||||
allowReinstall: Boolean,
|
||||
) {
|
||||
val root = findRoot(apk)
|
||||
|
||||
if (root.exists()) {
|
||||
@@ -48,7 +51,7 @@ class PackageController {
|
||||
if (!installed.jar.exists()) {
|
||||
throw IllegalStateException("Failed to translate APK dex!")
|
||||
}
|
||||
} catch(t: Throwable) {
|
||||
} catch (t: Throwable) {
|
||||
root.deleteRecursively()
|
||||
throw t
|
||||
}
|
||||
@@ -63,7 +66,7 @@ class PackageController {
|
||||
}
|
||||
|
||||
fun deletePackage(pack: InstalledPackage) {
|
||||
if(!pack.root.exists()) error("Package was never installed!")
|
||||
if (!pack.root.exists()) error("Package was never installed!")
|
||||
|
||||
val packageName = pack.info.packageName
|
||||
pack.root.deleteRecursively()
|
||||
@@ -74,14 +77,15 @@ class PackageController {
|
||||
|
||||
fun findPackage(packageName: String): InstalledPackage? {
|
||||
val file = File(androidFiles.packagesDir, packageName)
|
||||
return if(file.exists())
|
||||
return if (file.exists()) {
|
||||
InstalledPackage(file)
|
||||
else
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
fun findJarFromApk(apkFile: File): File? {
|
||||
val pkgName = ApkParsers.getMetaInfo(apkFile).packageName
|
||||
return findPackage(pkgName)?.jar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,16 +12,18 @@ fun ApkMeta.toPackageInfo(apk: File): PackageInfo {
|
||||
it.versionCode = versionCode.toInt()
|
||||
it.versionName = versionName
|
||||
|
||||
it.reqFeatures = usesFeatures.map {
|
||||
FeatureInfo().apply {
|
||||
name = it.name
|
||||
}
|
||||
}.toTypedArray()
|
||||
it.reqFeatures =
|
||||
usesFeatures.map {
|
||||
FeatureInfo().apply {
|
||||
name = it.name
|
||||
}
|
||||
}.toTypedArray()
|
||||
|
||||
it.applicationInfo = ApplicationInfo().apply {
|
||||
packageName = it.packageName
|
||||
nonLocalizedLabel = label
|
||||
sourceDir = apk.absolutePath
|
||||
}
|
||||
it.applicationInfo =
|
||||
ApplicationInfo().apply {
|
||||
packageName = it.packageName
|
||||
nonLocalizedLabel = label
|
||||
sourceDir = apk.absolutePath
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,4 @@ interface Resource {
|
||||
fun getType(): Class<out Resource>
|
||||
|
||||
fun getValue(): Any?
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,10 @@ class ServiceSupport {
|
||||
|
||||
private val logger = KotlinLogging.logger {}
|
||||
|
||||
fun startService(context: Context, intent: Intent) {
|
||||
fun startService(
|
||||
@Suppress("UNUSED_PARAMETER") context: Context,
|
||||
intent: Intent,
|
||||
) {
|
||||
val name = intentToClassName(intent)
|
||||
|
||||
logger.debug { "Starting service: $name" }
|
||||
@@ -27,15 +30,18 @@ class ServiceSupport {
|
||||
|
||||
runningServices[name] = service
|
||||
|
||||
//Setup service
|
||||
// Setup service
|
||||
thread {
|
||||
callOnCreate(service)
|
||||
//TODO Handle more complex cases
|
||||
// TODO Handle more complex cases
|
||||
service.onStartCommand(intent, 0, 0)
|
||||
}
|
||||
}
|
||||
|
||||
fun stopService(context: Context, intent: Intent) {
|
||||
fun stopService(
|
||||
@Suppress("UNUSED_PARAMETER") context: Context,
|
||||
intent: Intent,
|
||||
) {
|
||||
val name = intentToClassName(intent)
|
||||
stopService(name)
|
||||
}
|
||||
@@ -43,7 +49,7 @@ class ServiceSupport {
|
||||
fun stopService(name: String) {
|
||||
logger.debug { "Stopping service: $name" }
|
||||
val service = runningServices.remove(name)
|
||||
if(service == null) {
|
||||
if (service == null) {
|
||||
logger.warn { "An attempt was made to stop a service that is not running: $name" }
|
||||
} else {
|
||||
thread {
|
||||
@@ -63,6 +69,6 @@ class ServiceSupport {
|
||||
fun serviceInstanceFromClass(className: String): Service {
|
||||
val clazzObj = Class.forName(className)
|
||||
return clazzObj.getDeclaredConstructor().newInstance() as? Service
|
||||
?: throw IllegalArgumentException("$className is not a Service!")
|
||||
?: throw IllegalArgumentException("$className is not a Service!")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,12 @@ object KodeinGlobalHelper {
|
||||
* Get a dependency
|
||||
*/
|
||||
@JvmStatic
|
||||
fun <T : Any> instance(type: Class<T>, kodein: DI? = null): T {
|
||||
return when(type) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun <T : Any> instance(
|
||||
type: Class<T>,
|
||||
kodein: DI? = null,
|
||||
): T {
|
||||
return when (type) {
|
||||
AndroidFiles::class.java -> {
|
||||
val instance: AndroidFiles by (kodein ?: kodein()).instance()
|
||||
instance as T
|
||||
@@ -63,5 +67,4 @@ object KodeinGlobalHelper {
|
||||
fun <T : Any> instance(type: Class<T>): T {
|
||||
return instance(type, null)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package suwayomi.tachidesk.manga.impl.util.storage
|
||||
package xyz.nulldev.androidcompat.util
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
@@ -24,5 +24,7 @@ import java.net.URI
|
||||
* Utilites to convert between Java and Android Uris.
|
||||
*/
|
||||
fun Uri.java() = URI(this.toString())
|
||||
|
||||
fun Uri.file() = File(this.path)
|
||||
|
||||
fun URI.android() = Uri.parse(this.toString())!!
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
package xyz.nulldev.androidcompat.webkit
|
||||
|
||||
import android.webkit.CookieManager
|
||||
import android.webkit.ValueCallback
|
||||
import android.webkit.WebView
|
||||
import java.net.CookieHandler
|
||||
import java.net.HttpCookie
|
||||
import java.net.URI
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
class CookieManagerImpl : CookieManager() {
|
||||
private val cookieHandler = CookieHandler.getDefault() as java.net.CookieManager
|
||||
private var acceptCookie = true
|
||||
private var acceptThirdPartyCookies = true
|
||||
private var allowFileSchemeCookies = false
|
||||
|
||||
override fun setAcceptCookie(accept: Boolean) {
|
||||
acceptCookie = accept
|
||||
}
|
||||
|
||||
override fun acceptCookie(): Boolean {
|
||||
return acceptCookie
|
||||
}
|
||||
|
||||
override fun setAcceptThirdPartyCookies(
|
||||
webview: WebView?,
|
||||
accept: Boolean,
|
||||
) {
|
||||
acceptThirdPartyCookies = accept
|
||||
}
|
||||
|
||||
override fun acceptThirdPartyCookies(webview: WebView?): Boolean {
|
||||
return acceptThirdPartyCookies
|
||||
}
|
||||
|
||||
override fun setCookie(
|
||||
url: String,
|
||||
value: String?,
|
||||
) {
|
||||
val uri =
|
||||
if (url.startsWith("http")) {
|
||||
URI(url)
|
||||
} else {
|
||||
URI("http://$url")
|
||||
}
|
||||
|
||||
HttpCookie.parse(value).forEach {
|
||||
cookieHandler.cookieStore.add(uri, it)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setCookie(
|
||||
url: String,
|
||||
value: String?,
|
||||
callback: ValueCallback<Boolean>?,
|
||||
) {
|
||||
setCookie(url, value)
|
||||
callback?.onReceiveValue(true)
|
||||
}
|
||||
|
||||
override fun getCookie(url: String): String {
|
||||
val uri =
|
||||
if (url.startsWith("http")) {
|
||||
URI(url)
|
||||
} else {
|
||||
URI("http://$url")
|
||||
}
|
||||
return cookieHandler.cookieStore.get(uri)
|
||||
.joinToString("; ") { "${it.name}=${it.value}" }
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun removeSessionCookie() {}
|
||||
|
||||
override fun removeSessionCookies(callback: ValueCallback<Boolean>?) {}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun removeExpiredCookie() {}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun removeAllCookie() {
|
||||
cookieHandler.cookieStore.removeAll()
|
||||
}
|
||||
|
||||
override fun removeAllCookies(callback: ValueCallback<Boolean>?) {
|
||||
val removedCookies = cookieHandler.cookieStore.removeAll()
|
||||
callback?.onReceiveValue(removedCookies)
|
||||
}
|
||||
|
||||
override fun hasCookies(): Boolean {
|
||||
return cookieHandler.cookieStore.cookies.isNotEmpty()
|
||||
}
|
||||
|
||||
override fun flush() {}
|
||||
|
||||
override fun allowFileSchemeCookiesImpl(): Boolean {
|
||||
return allowFileSchemeCookies
|
||||
}
|
||||
|
||||
override fun setAcceptFileSchemeCookiesImpl(accept: Boolean) {
|
||||
allowFileSchemeCookies = acceptCookie
|
||||
}
|
||||
}
|
||||
@@ -1,36 +1,12 @@
|
||||
# AndroidComapt Root dir
|
||||
androidcompat.rootDir = androidcompat-root
|
||||
|
||||
# Allow/disallow preference changes (useful for demos)
|
||||
ts.server.allowConfigChanges = true
|
||||
|
||||
# Enable the WebUI? Note: The API and multi-user sync server ui will remain available even if the WebUI is disabled
|
||||
ts.server.enableWebUi = true
|
||||
|
||||
# 'true' to use the old, buggy/memory-leaking WebUI
|
||||
ts.server.useOldWebUi = false
|
||||
|
||||
# 'true' to pretty print all JSON API responses
|
||||
ts.server.prettyPrintApi = false
|
||||
|
||||
# List of blacklisted/whitelisted API endpoints/operation IDs
|
||||
ts.server.disabledApiEndpoints = []
|
||||
ts.server.enabledApiEndpoints = []
|
||||
|
||||
# Message to print in the console when the API has finished booting
|
||||
ts.server.httpInitializedPrintMessage = ""
|
||||
|
||||
# Use external folder for static files
|
||||
ts.server.useExternalStaticFiles = false
|
||||
ts.server.externalStaticFilesFolder = ""
|
||||
|
||||
# Root storage dir
|
||||
ts.server.rootDir = tachiserver-data
|
||||
# Dir to store JVM patches
|
||||
ts.server.patchesDir = ${ts.server.rootDir}/patches
|
||||
####################### `android.files` (FilesConfigModule) #######################
|
||||
|
||||
# Storage dir for the emulated Android app
|
||||
android.files.rootDir = ${ts.server.rootDir}/android-compat/appdata
|
||||
android.files.rootDir = ${androidcompat.rootDir}/appdata
|
||||
# External storage dir for the emulated Android app's
|
||||
android.files.externalStorageDir = ${ts.server.rootDir}/android-compat/extappdata
|
||||
android.files.externalStorageDir = ${androidcompat.rootDir}/extappdata
|
||||
|
||||
# Internal Android directories
|
||||
android.files.dataDir = ${android.files.rootDir}/data
|
||||
@@ -48,37 +24,16 @@ android.files.externalCacheDirs = [${android.files.externalStorageDir}/cache]
|
||||
android.files.externalMediaDirs = [${android.files.externalStorageDir}/media]
|
||||
android.files.downloadCacheDir = ${android.files.externalStorageDir}/downloadCache
|
||||
|
||||
android.files.packageDir = ${ts.server.rootDir}/android-compat/packages
|
||||
android.files.packageDir = ${androidcompat.rootDir}/android-compat/packages
|
||||
|
||||
####################### `android.app` (ApplicationInfoConfigModule) #######################
|
||||
|
||||
# Emulated Android app package name
|
||||
android.app.packageName = eu.kanade.tachiyomi
|
||||
# Debug mode for the emulated Android app
|
||||
android.app.debug = true
|
||||
|
||||
####################### `android.system` (SystemConfigModule) #######################
|
||||
|
||||
# Whether or not the emulated Android system is debuggable
|
||||
android.system.isDebuggable = true
|
||||
|
||||
# Is the multi-user sync server enabled? Does not affect the single-user sync server included in the API.
|
||||
ts.syncd.enable = false
|
||||
|
||||
# The URL of this server (displayed in the sync server web ui)
|
||||
ts.syncd.baseUrl = "http://example.com"
|
||||
|
||||
# 'true' to disable the API and only enable the multi-user sync server
|
||||
ts.syncd.syncOnlyMode = false
|
||||
|
||||
# The root directory to store synchronized data
|
||||
ts.syncd.rootDir = ${ts.server.rootDir}/sync/accounts
|
||||
|
||||
# Location to store config files for the sandbox
|
||||
ts.syncd.sandboxedConfig = ${ts.server.rootDir}/sync/sandboxed_config.config
|
||||
|
||||
# Recaptcha stuff for signup/login
|
||||
ts.syncd.recaptcha.siteKey = ""
|
||||
ts.syncd.recaptcha.secret = ""
|
||||
|
||||
# Sync server display name
|
||||
ts.syncd.name = "Tachiyomi sync server"
|
||||
|
||||
# Header used to forward the IP to the multi-user sync server if the server is behind a reverse proxy
|
||||
ts.syncd.ipHeader = ""
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# Server: v0.X.Y-next + WebUI: rXXX
|
||||
## TL;DR
|
||||
- N/A
|
||||
|
||||
## Suwayomi-Server Changelog
|
||||
- N/A
|
||||
|
||||
## Suwayomi-WebUI Changelog
|
||||
- N/A
|
||||
|
||||
|
||||
+1522
File diff suppressed because it is too large
Load Diff
+74
-38
@@ -1,52 +1,88 @@
|
||||
# Contributing
|
||||
## Where should I start?
|
||||
Checkout [This Kanban Board](https://github.com/Suwayomi/Tachidesk/projects/1) to see the rough development roadmap.
|
||||
Checkout [This Kanban Board](https://github.com/Suwayomi/Suwayomi-Server/projects/1) to see the rough development roadmap.
|
||||
|
||||
**Note to potential contributors:** Notify the developers on Suwayomi discord (#programming channel) or open a WIP pull request before starting if you decide to take on working on anything from/not from the roadmap in order to avoid parallel efforts on the same issue/feature.
|
||||
### Important notes
|
||||
- Notify the developers on [Suwayomi discord](https://discord.gg/DDZdqZWaHA) (#tachidesk-server and #tachidesk-webui channels) or open a WIP pull request before starting if you decide to take on working on anything from/not from the roadmap in order to avoid parallel efforts on the same issue/feature.
|
||||
- Your pull request will be squashed into a single commit.
|
||||
- We hate big pull requests, make them as small as possible, change one meaningful thing. Spam pull requests, we don't mind.
|
||||
|
||||
## How does Tachidesk work?
|
||||
### Project goals and vision
|
||||
- Porting Tachiyomi and covering its features
|
||||
- Syncing with Tachiyomi, [main issue](https://github.com/Suwayomi/Suwayomi-Server/issues/159)
|
||||
- Generally rejecting features that Tachiyomi(main app) doesn't have,
|
||||
- Unless it's something that makes sense for desktop sizes or desktop form factor (keyboard + mouse)
|
||||
- Additional/crazy features can go in forks and alternative clients
|
||||
- [Suwayomi-WebUI](https://github.com/Suwayomi/Suwayomi-WebUI) should
|
||||
- be responsive
|
||||
- support both desktop and mobile form factors well
|
||||
|
||||
## How does Suwayomi-Server work?
|
||||
This project has two components:
|
||||
1. **server:** contains the implementation of [tachiyomi's extensions library](https://github.com/tachiyomiorg/extensions-lib) and uses an Android compatibility library to run apk extensions. All this concludes to serving a REST API to `webUI`.
|
||||
2. **webUI:** A react SPA(`create-react-app`) project that works with the server to do the presentation.
|
||||
1. **Server:** contains the implementation of [tachiyomi's extensions library](https://github.com/tachiyomiorg/extensions-lib) and uses an Android compatibility library to run jar libraries converted from apk extensions. All this concludes to serving a GraphQL API.
|
||||
2. **WebUI:** A React SPA(`create-react-app`) project that works with the server to do the presentation located at https://github.com/Suwayomi/Suwayomi-WebUI
|
||||
|
||||
### API
|
||||
#### GraphQL
|
||||
*Only available in the preview at the moment*
|
||||
|
||||
The GraphQL API can be queried with a POST request to `/api/graphql`. There is also the GraphiQL IDE accessible by the browser at `/api/graphql` to perform ad-hoc queries and explore the API.
|
||||
|
||||
#### REST
|
||||
> [!WARNING]
|
||||
>
|
||||
> Soon to be deprecated
|
||||
|
||||
The REST API can be queried at `/api/v1`. An interactive Swagger API explorer is available at `/api/swagger-ui`.
|
||||
|
||||
### Tracker client authorization
|
||||
#### OAuth
|
||||
Since the url of a Suwayomi-Server is not known, it is not possible to redirect directly to the client.<br/>
|
||||
Thus, to provide tracker support via oauth, the tracker clients redirect to the [suwayomi website](https://suwayomi.org/)
|
||||
and there the actual redirection to the client takes place.
|
||||
|
||||
When implementing the login process in your client you have to make sure to follow some preconditions:
|
||||
|
||||
To be able to redirect to the client you have to attach a `state` object to the query of the auth url
|
||||
- this `state` object has to have a `redirectUrl` which points to the client route at which you want to handle the auth result
|
||||
- besides the `redirectUrl` you can pass any information you require to handle the result (e.g. the server `id` of the tracker client)
|
||||
- example URL for AniList: `https://anilist.co/api/v2/oauth/authorize?client_id=ID&response_type=token&state={ redirectUrl: "http://localhost:4567/handle/oauth/result", trackerId: 1, anyOtherInfo: "your client requires" }`
|
||||
|
||||
Once the permission has been granted, you will get redirected to the client at the provided route (`redirectUrl`).<br/>
|
||||
- Example URL (decoded) for AniList: `http://localhost:4567/handle/oauth/result?access_token=TOKEN&token_type=Bearer&expires_in=31622400&state={ redirectUrl: "http://localhost:4567/handle/oauth/result", trackerId: 1, anyOtherInfo: "your client requires" }`).<br/>
|
||||
|
||||
Finally, to finish the login process, you just have to pass this URL to the server as the `callbackUrl`.
|
||||
|
||||
## Why a web app?
|
||||
This structure is chosen to
|
||||
- Achieve the maximum multi-platform-ness
|
||||
- Gives the ability to acces Tachidesk from a remote web browser e.g. your phone, tablet or smart TV
|
||||
- Eaise development of alternative user intefaces for Tachidesk
|
||||
|
||||
## User Interfaces for Tachidesk server
|
||||
Currently, there are three known interfaces for Tachidesk:
|
||||
1. [webUI](https://github.com/Suwayomi/Tachidesk/tree/master/webUI/react): The react SPA that Tachidesk is traditionally shipped with.
|
||||
2. [TachideskJUI](https://github.com/Suwayomi/TachideskJUI): A Jetbrains Compose Native app, re-uses components made for the upcoming Tachiyomi 1.x
|
||||
3. [Equinox](https://github.com/Suwayomi/Equinox): A web user interface made with Vue.js, in super early stages of development.
|
||||
- Gives the ability to access Suwayomi-Server from a remote client e.g., your phone, tablet or smart TV
|
||||
- Ease development of user interfaces for Suwayomi
|
||||
|
||||
## Building from source
|
||||
### Prerequisites
|
||||
You need these software packages installed in order to build the project
|
||||
### Server
|
||||
- Java Development Kit and Java Runtime Environment version 8 or newer(both Oracle JDK and OpenJDK works)
|
||||
- Android stubs jar
|
||||
- Manual download: Download [android.jar](https://raw.githubusercontent.com/Suwayomi/Tachidesk/android-jar/android.jar) and put it under `AndroidCompat/lib`.
|
||||
- Automated download: Run `AndroidCompat/getAndroid.sh`(MacOS/Linux) or `AndroidCompat/getAndroid.ps1`(Windows) from project's root directory to download and rebuild the jar file from Google's repository.
|
||||
### webUI
|
||||
- Nodejs LTS or latest
|
||||
- Yarn
|
||||
- Git
|
||||
### building the full-blown jar
|
||||
Run `./gradlew :webUI:copyBuild server:shadowJar`, the resulting built jar file will be `server/build/Tachidesk-vX.Y.Z-rxxx.jar`.
|
||||
### building without `webUI` bundled(server only)
|
||||
Delete the `server/src/main/resources/react` directory if exists from previous runs, then run `./gradlew server:shadowJar`, the resulting built jar file will be `server/build/Tachidesk-vX.Y.Z-rxxx.jar`.
|
||||
### building the Windows package
|
||||
First Build the jar, then cd into the `scripts` directory and run `./windows<bits>-bundler.sh` (or `./windows<bits>-bundler.ps1` if you are on windows), the resulting built zip package file will be `server/build/Tachidesk-vX.Y.Z-rxxx-win64.zip`.
|
||||
## Running in development mode
|
||||
First satisfy [the prerequisites](#prerequisites)
|
||||
### server
|
||||
run `./gradlew :server:run --stacktrace` to run the server
|
||||
### webUI
|
||||
How to do it is described in `webUI/react/README.md` but for short,
|
||||
first cd into `webUI/react` then run `yarn` to install the node modules(do this only once)
|
||||
then `yarn start` to start the development server, if a new browser window doesn't get opened automatically,
|
||||
then open `http://127.0.0.1:3000` in a modern browser. This is a `create-react-app` project
|
||||
and supports HMR and all the other goodies you'll need.
|
||||
|
||||
- Java Development Kit and Java Runtime Environment version 8 or newer(both Oracle JDK and OpenJDK works)
|
||||
|
||||
### building the full-blown jar (Suwayomi-Server + Suwayomi-WebUI bundle)
|
||||
Run `./gradlew server:downloadWebUI server:shadowJar`, the resulting built jar file will be `server/build/Suwayomi-Server-vX.Y.Z-rxxx.jar`.
|
||||
|
||||
### building without `webUI` bundled (server only)
|
||||
Delete `server/src/main/resources/WebUI.zip` if exists from previous runs, then run `./gradlew server:shadowJar`, the resulting built jar file will be `server/build/Suwayomi-Server-vX.Y.Z-rxxx.jar`.
|
||||
|
||||
### building the Windows package
|
||||
First Build the jar, then cd into the `scripts` directory and run `./windows-bundler.sh win32` or `./windows-bundler.sh win64` depending on the target architecture, the resulting built zip package file will be `server/build/Suwayomi-Server-vX.Y.Z-rxxx-winXX.zip`.
|
||||
|
||||
## Running in development mode
|
||||
run `./gradlew :server:run --stacktrace` to run the server
|
||||
|
||||
## Running tests
|
||||
run `./gradlew :server:test` to execute all tests
|
||||
to test a specific class run `./gradlew :server:test --tests <package.with.classname>`
|
||||
|
||||
## Building the android-jar maven repository
|
||||
Run `AndroidCompat/getAndroid.sh`(macOS/Linux) or `AndroidCompat/getAndroid.ps1`(Windows)
|
||||
from project's root directory to download and rebuild the jar file from Google's repository,
|
||||
then use `AndroidCompat/lib/android.jar` to manually create a maven repository inside the `android-jar` git branch.
|
||||
Update the dependency declaration afterwards.
|
||||
|
||||
@@ -1,58 +1,130 @@
|
||||
|
||||
| Build | Stable | Preview | Support Server |
|
||||
|-------|----------|---------|---------|
|
||||
|  | [](https://github.com/Suwayomi/Tachidesk/releases) | [](https://github.com/Suwayomi/Tachidesk-preview/releases/latest) | [](https://discord.gg/DDZdqZWaHA) |
|
||||
| Build | Stable | Preview | Support Server |
|
||||
|-----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
|
||||
|  | [](https://github.com/Suwayomi/Suwayomi-Server/releases) | [](https://github.com/Suwayomi/Suwayomi-Server-preview/releases/latest) | [](https://discord.gg/DDZdqZWaHA) |
|
||||
|
||||
# Tachidesk
|
||||
<img src="https://github.com/Suwayomi/Tachidesk/raw/master/server/src/main/resources/icon/faviconlogo.png" alt="drawing" width="200"/>
|
||||
## Table of Content
|
||||
- [What is Suwayomi?](#what-is-suwayomi)
|
||||
- [Suwayomi client projects](#Suwayomi-client-projects)
|
||||
* [Is this application usable? Should I test it?](#is-this-application-usable-should-i-test-it)
|
||||
- [Downloading and Running the app](#downloading-and-running-the-app)
|
||||
* [Using Operating System Specific Bundles](#using-operating-system-specific-bundles)
|
||||
- [Launcher Scripts](#launcher-scripts)
|
||||
+ [Windows](#windows)
|
||||
+ [macOS](#macos)
|
||||
+ [GNU/Linux](#gnulinux)
|
||||
* [Other methods of getting Suwayomi](#other-methods-of-getting-suwayomi)
|
||||
+ [Arch Linux](#arch-linux)
|
||||
+ [Ubuntu-based distributions](#ubuntu-based-distributions)
|
||||
+ [Docker](#docker)
|
||||
* [Advanced Methods](#advanced-methods)
|
||||
+ [Running the jar release directly](#running-the-jar-release-directly)
|
||||
+ [Using Suwayomi Remotely](#using-suwayomi-remotely)
|
||||
- [Syncing With Tachiyomi](#syncing-with-tachiyomi)
|
||||
- [Troubleshooting and Support](#troubleshooting-and-support)
|
||||
- [Contributing and Technical info](#contributing-and-technical-info)
|
||||
- [Credit](#credit)
|
||||
- [License](#license)
|
||||
<!-- Generated with https://ecotrust-canada.github.io/markdown-toc/ -->
|
||||
|
||||
A free and open source manga reader that runs extensions built for [Tachiyomi](https://tachiyomi.org/).
|
||||
# What is Suwayomi?
|
||||
<img src="https://github.com/Suwayomi/Suwayomi-Server/raw/master/server/src/main/resources/icon/faviconlogo.png" alt="drawing" width="200"/>
|
||||
|
||||
Tachidesk is an independent Tachiyomi compatible software and is **not a Fork of** Tachiyomi.
|
||||
A free and open source manga reader server that runs extensions built for [Tachiyomi](https://tachiyomi.org/).
|
||||
|
||||
Tachidesk is as multi-platform as you can get. Any platform that runs java and/or has a modern browser can run it. This includes Windows, Linux, macOS, chrome OS, etc. Follow [Downloading and Running the app](#downloading-and-running-the-app) for installation instructions.
|
||||
Suwayomi is an independent Tachiyomi compatible software and is **not a Fork of** Tachiyomi.
|
||||
|
||||
Ability to read and write Tachiyomi compatible backups and syncing is a planned feature.
|
||||
Suwayomi-Server is as multi-platform as you can get. Any platform that runs java and/or has a modern browser can run it. This includes Windows, Linux, macOS, chrome OS, etc. Follow [Downloading and Running the app](#downloading-and-running-the-app) for installation instructions.
|
||||
|
||||
**Tachidesk needs serious front-end dev help for it's reader and other parts, if you like the app and want to see it become better please don't hesitate to contribute some code!**
|
||||
Ability to sync with Tachiyomi is a planned feature, for more info look [here](#syncing-with-tachiyomi).
|
||||
|
||||
# Suwayomi client projects
|
||||
**You need a client/user interface app as a front-end for Suwayomi-Server, if you [Directly Download Suwayomi-Server](https://github.com/Suwayomi/Suwayomi-Server/releases/latest) you'll get a bundled version of [Suwayomi-WebUI](https://github.com/Suwayomi/Suwayomi-WebUI) with it.**
|
||||
|
||||
Here's a list of known clients/user interfaces for Suwayomi-Server:
|
||||
##### Actively Developed Clients
|
||||
- [Suwayomi-WebUI](https://github.com/Suwayomi/Suwayomi-WebUI): The web/ElectronJS front-end that Suwayomi-Server ships with by default.
|
||||
- [Tachidesk-JUI](https://github.com/Suwayomi/Tachidesk-JUI): The native desktop front-end for Suwayomi-Server. Currently, the most advanced.
|
||||
- [Tachidesk-Sorayomi](https://github.com/Suwayomi/Tachidesk-Sorayomi): A Flutter front-end for Desktop(Linux, windows, etc.), Web and Android with a User Interface inspired by Tachiyomi.
|
||||
- [Tachidesk-VaadinUI](https://github.com/Suwayomi/Tachidesk-VaadinUI): A Web front-end for Suwayomi-Server built with Vaadin.
|
||||
- [Suwayomi-VUI](https://github.com/Suwayomi/Suwayomi-VUI): A preview focused web frontend built with svelte with some features the other UIs might not have (migration)
|
||||
##### Inactive/Abandoned Clients
|
||||
- [Tachidesk-qtui](https://github.com/Suwayomi/Tachidesk-qtui): A C++/Qt front-end for mobile devices(Android/linux), feature support is basic.
|
||||
- [Tachidesk-GTK](https://github.com/mahor1221/Tachidesk-GTK): A native Rust/GTK desktop client.
|
||||
- [Equinox](https://github.com/Suwayomi/Equinox): A web user interface made with Vue.js.
|
||||
|
||||
## Is this application usable? Should I test it?
|
||||
Here is a list of current features:
|
||||
|
||||
- Installing and executing Tachiyomi's Extensions, So you'll get the same sources.
|
||||
- A library to save your mangas and categories to put them into.
|
||||
- Searching and browsing installed sources.
|
||||
- A decent chapter reader.
|
||||
- Installing and executing Tachiyomi's Extensions, So you'll get the same sources
|
||||
- A library to save your mangas and categories to put them into
|
||||
- Searching and browsing installed sources
|
||||
- Ability to download Manga for offline read
|
||||
- Backup and restore support powered by Tachiyomi Legacy Backups
|
||||
- Backup and restore support powered by Tachiyomi-compatible Backups
|
||||
- Viewing latest updated chapters.
|
||||
|
||||
**Note:** Keep in mind that Tachidesk is alpha software and can break rarely and/or with each update. See [Troubleshooting](https://github.com/Suwayomi/Tachidesk/wiki/Troubleshooting) if it happens.
|
||||
**Note:** These are capabilities of Suwayomi-Server, the actual working support is provided by each front-end app, checkout their respective readme for more info.
|
||||
|
||||
## Downloading and Running the app
|
||||
### All Operating Systems
|
||||
You should have The Java Runtime Environment(JRE) 8 or newer and a modern browser installed(Google is your friend for seeking assitance). Also an internet connection is required as almost everything this app does is downloading stuff.
|
||||
# Downloading and Running the app
|
||||
## Using Operating System Specific Bundles
|
||||
To facilitate the use of Suwayomi we provide bundle releases that include The Java Runtime Environment, ElectronJS and the Suwayomi-Launcher.
|
||||
|
||||
Download the latest "Stable" jar release from [the releases section](https://github.com/Suwayomi/Tachidesk/releases) or a preview jar build from [the preview repository](https://github.com/Suwayomi/Tachidesk-preview/releases).
|
||||
|
||||
Double click on the jar file or run `java -jar Tachidesk-vX.Y.Z-rxxx.jar` (or `java -jar Tachidesk-latest.jar` if you have the latest preview) from a Terminal/Command Prompt window to run the app which will open a new browser window automatically. Also the System Tray Icon is your friend if you need to open the browser window again or close Tachidesk.
|
||||
If a bundle for your operating system or cpu architecture is not provided then refer to [Advanced Methods](#advanced-methods)
|
||||
|
||||
### Windows
|
||||
Download the latest "Stable" win32 or win64 (depending on your system, usually you want win64) release from [the releases section](https://github.com/Suwayomi/Tachidesk/releases) or a preview one from [the preview repository](https://github.com/Suwayomi/Tachidesk-preview/releases).
|
||||
Download the latest `win32`(Windows 32-bit) or `win64`(Windows 64-bit) release from [the releases section](https://github.com/Suwayomi/Suwayomi-Server/releases) or a preview one from [the preview repository](https://github.com/Suwayomi/Suwayomi-Server-preview/releases).
|
||||
|
||||
The Windows specific build has java bundled inside, so you don't have to install java to use it. Unzip `Tachidesk-vX.Y.Z-rxxx-win64.zip` and run one of the Launcher files depending on what you want(see bellow). The rest works like the previous section.
|
||||
#### Windows Launchers
|
||||
- `Tachidesk Electron Launcher.bat`: Launches Tachidesk inside Electron as a desktop applicaton
|
||||
- `Tachidesk Browser Launcher.bat`: Launches Tachidesk in a browser window
|
||||
- `Tachidesk Debug Launcher.bat`: Launches Tachidesk with debug logs attached. If Tachidesk doesn't work for you, running this can give you insight into why.
|
||||
Unzip the downloaded file and double-click on one of the launcher scripts.
|
||||
|
||||
### macOS
|
||||
Download the latest `macOS-x64`(older macOS systems) or `macOS-arm64`(Apple M1 and newer) release from [the releases section](https://github.com/Suwayomi/Suwayomi-Server/releases) or a preview one from [the preview repository](https://github.com/Suwayomi/Suwayomi-Server-preview/releases).
|
||||
|
||||
Unzip the downloaded file and double-click on one of the launcher scripts.
|
||||
|
||||
### GNU/Linux
|
||||
Download the latest `linux-x64`(x86_64) release from [the releases section](https://github.com/Suwayomi/Suwayomi-Server/releases) or a preview one from [the preview repository](https://github.com/Suwayomi/Suwayomi-Server-preview/releases).
|
||||
|
||||
`tar xvf` the downloaded file and double-click on one of the launcher scripts or run them using the terminal.
|
||||
|
||||
## Other methods of getting Suwayomi
|
||||
### Arch Linux
|
||||
You can install Tachidesk from the AUR
|
||||
You can install Suwayomi from the AUR:
|
||||
```
|
||||
yay -S tachidesk
|
||||
```
|
||||
|
||||
### Debian/Ubuntu
|
||||
Download the latest deb package from the release section or Install from the MPR
|
||||
```
|
||||
git clone https://mpr.makedeb.org/suwayomi-server.git
|
||||
cd suwayomi-server
|
||||
makedeb -si
|
||||
```
|
||||
|
||||
### Ubuntu
|
||||
```
|
||||
sudo add-apt-repository ppa:suwayomi/suwayomi-server
|
||||
sudo apt update
|
||||
sudo apt install suwayomi-server
|
||||
```
|
||||
|
||||
### NixOS
|
||||
You can deploy Suwayomi on NixOS using the module `services.suwayomi-server` in your configuration:
|
||||
|
||||
```
|
||||
{
|
||||
services.suwayomi-server = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
For more information, see [the NixOS manual](https://nixos.org/manual/nixos/stable/#module-services-suwayomi-server).
|
||||
|
||||
You can also directly use the package from [nixpkgs](https://search.nixos.org/packages?channel=unstable&type=packages&query=suwayomi-server).
|
||||
|
||||
### Docker
|
||||
Check our Offical Docker release [Tachidesk Container](https://github.com/orgs/Suwayomi/packages/container/package/tachidesk) or use [arbuilder's](https://github.com/arbuilder/Tachidesk-docker) tachidesk docker repo for installation. Source code for our container is available at [docker-tachidesk](https://github.com/Suwayomi/docker-tachidesk). By default the server will be running on http://localhost:4567 open this url in your browser.
|
||||
Check our Official Docker release [Suwayomi Container](https://github.com/orgs/Suwayomi/packages/container/package/tachidesk) for running Suwayomi Server in a docker container. Source code for our container is available at [docker-tachidesk](https://github.com/Suwayomi/docker-tachidesk). By default, the server will be running on http://localhost:4567 open this url in your browser.
|
||||
|
||||
Install from the command line:
|
||||
```
|
||||
@@ -63,11 +135,38 @@ Run Container from the command line:
|
||||
$ docker run -p 4567:4567 ghcr.io/suwayomi/tachidesk
|
||||
```
|
||||
|
||||
### Using Tachidesk Remotely
|
||||
You can run Tachidesk on your computer or a server and connect to it remotely through the web interface with a web browser on any device including a mobile or tablet or even your smart TV!, this method of using Tachidesk is only recommended if you are a power user and know what you are doing.
|
||||
## Advanced Methods
|
||||
### Running the jar release directly
|
||||
In order to run the app you need the following:
|
||||
- The jar release of Suwayomi-Server
|
||||
- The Java Runtime Environment(JRE) 8 or newer
|
||||
- A Browser like Google Chrome, Firefox, Edge, etc.
|
||||
- ElectronJS (optional)
|
||||
|
||||
Download the latest `.jar` release from [the releases section](https://github.com/Suwayomi/Suwayomi-Server/releases) or a preview jar build from [the preview repository](https://github.com/Suwayomi/Suwayomi-Server-preview/releases).
|
||||
|
||||
Make sure you have The Java Runtime Environment installed on your system, Double-click on the jar file or run `java -jar Suwayomi-Server-vX.Y.Z-rxxxx.jar` from a Terminal/Command Prompt window to run the app which will open a new browser window automatically.
|
||||
|
||||
### Using Suwayomi Remotely
|
||||
You can run Suwayomi on your computer or a server and connect to it remotely through one of our clients or the bundled web interface with a web browser. This method of using Suwayomi is requiring a bit of networking/firewall/port forwarding/server configuration/etc. knowledge on your side, if you can run a Minecraft server and configure it, then you are good to go.
|
||||
|
||||
Check out [this wiki page](https://github.com/Suwayomi/Suwayomi-Server/wiki/Configuring-Tachidesk-Server) for a guide on configuring Suwayomi-Server.
|
||||
|
||||
If you face issues with your setup then we are happy to provide help, just join our discord server(a discord badge is on the top of the page, you are just a click-clack away!).
|
||||
|
||||
## Syncing With Tachiyomi
|
||||
### The Suwayomi extension and tracker
|
||||
- You can install the `Suwayomi` extension inside tachiyomi.
|
||||
- The extension will load your Suwayomi library.
|
||||
- By manipulating extension search filters you can browse your categories.
|
||||
- You can enable the Suwayomi tracker to track reading progress with your Suwayomi server.
|
||||
- Note: Tachiyomi [only allows tracking one way](https://github.com/tachiyomiorg/tachiyomi/issues/1626), meaning that by reading chapters on other Suwayomi clients the last read chapter number will update on the tracker but tachiyomi won't automatically mark them as read for you.
|
||||
|
||||
### Other methods
|
||||
Checkout [this issue](https://github.com/Suwayomi/Suwayomi-Server/issues/159) for tracking progress.
|
||||
|
||||
## Troubleshooting and Support
|
||||
See [this troubleshooting wiki page](https://github.com/Suwayomi/Tachidesk/wiki/Troubleshooting).
|
||||
See [this troubleshooting wiki page](https://github.com/Suwayomi/Suwayomi-Server/wiki/Troubleshooting).
|
||||
|
||||
## Contributing and Technical info
|
||||
See [CONTRIBUTING.md](./CONTRIBUTING.md).
|
||||
@@ -75,9 +174,9 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md).
|
||||
## Credit
|
||||
This project is a spiritual successor of [TachiWeb-Server](https://github.com/Tachiweb/TachiWeb-server), Many of the ideas and the groundwork adopted in this project comes from TachiWeb.
|
||||
|
||||
The `AndroidCompat` module was originally developed by [@null-dev](https://github.com/null-dev) for [TachiWeb-Server](https://github.com/Tachiweb/TachiWeb-server) and is licensed under `Apache License Version 2.0`.
|
||||
The `AndroidCompat` module was originally developed by [@null-dev](https://github.com/null-dev) for [TachiWeb-Server](https://github.com/Tachiweb/TachiWeb-server) and is licensed under `Apache License Version 2.0` and `Copyright 2019 Andy Bao and contributors`.
|
||||
|
||||
Parts of [tachiyomi](https://github.com/tachiyomiorg/tachiyomi) is adopted into this codebase, also licensed under `Apache License Version 2.0`.
|
||||
Parts of [tachiyomi](https://github.com/tachiyomiorg/tachiyomi) is adopted into this codebase, also licensed under `Apache License Version 2.0` and `Copyright 2015 Javier Tomás`.
|
||||
|
||||
You can obtain a copy of `Apache License Version 2.0` from http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
@@ -90,3 +189,7 @@ Changes to both codebases is licensed under `MPL v. 2.0` as the rest of this pro
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
## Disclaimer
|
||||
|
||||
The developer of this application does not have any affiliation with the content providers available.
|
||||
|
||||
+36
-72
@@ -1,8 +1,13 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
||||
import org.jlleitschuh.gradle.ktlint.KtlintExtension
|
||||
import org.jlleitschuh.gradle.ktlint.KtlintPlugin
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "1.4.32"
|
||||
kotlin("plugin.serialization") version "1.4.32" apply false
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
alias(libs.plugins.ktlint)
|
||||
alias(libs.plugins.buildconfig) apply false
|
||||
alias(libs.plugins.download)
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@@ -12,80 +17,39 @@ allprojects {
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://maven.google.com/")
|
||||
google()
|
||||
maven("https://github.com/Suwayomi/Suwayomi-Server/raw/android-jar/")
|
||||
maven("https://jitpack.io")
|
||||
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||
maven("https://dl.google.com/dl/android/maven2/")
|
||||
}
|
||||
}
|
||||
|
||||
val projects = listOf(
|
||||
project(":AndroidCompat"),
|
||||
project(":AndroidCompat:Config"),
|
||||
project(":server")
|
||||
)
|
||||
|
||||
configure(projects) {
|
||||
apply(plugin = "org.jetbrains.kotlin.jvm")
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||
subprojects {
|
||||
plugins.withType<JavaPlugin> {
|
||||
extensions.configure<JavaPluginExtension> {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Kotlin
|
||||
implementation(kotlin("stdlib-jdk8"))
|
||||
implementation(kotlin("reflect"))
|
||||
testImplementation(kotlin("test-junit5"))
|
||||
|
||||
// coroutines
|
||||
val coroutinesVersion = "1.4.3"
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$coroutinesVersion")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
|
||||
|
||||
val kotlinSerializationVersion = "1.1.0"
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:$kotlinSerializationVersion")
|
||||
|
||||
|
||||
// Dependency Injection
|
||||
implementation("org.kodein.di:kodein-di-conf-jvm:7.5.0")
|
||||
|
||||
// Logging
|
||||
implementation("org.slf4j:slf4j-api:1.7.30")
|
||||
implementation("ch.qos.logback:logback-classic:1.2.3")
|
||||
implementation("io.github.microutils:kotlin-logging:2.0.6")
|
||||
|
||||
// ReactiveX
|
||||
implementation("io.reactivex:rxjava:1.3.8")
|
||||
implementation("io.reactivex:rxkotlin:1.0.0")
|
||||
implementation("com.jakewharton.rxrelay:rxrelay:1.2.0")
|
||||
|
||||
// JSoup
|
||||
implementation("org.jsoup:jsoup:1.13.1")
|
||||
|
||||
// dependency of :AndroidCompat:Config
|
||||
implementation("com.typesafe:config:1.4.1")
|
||||
implementation("io.github.config4k:config4k:0.4.2")
|
||||
|
||||
// to get application content root
|
||||
implementation("net.harawata:appdirs:1.2.1")
|
||||
|
||||
// dex2jar: https://github.com/DexPatcher/dex2jar/releases/tag/v2.1-20190905-lanchon
|
||||
implementation("com.github.DexPatcher.dex2jar:dex-tools:v2.1-20190905-lanchon")
|
||||
|
||||
// APK parser
|
||||
implementation("net.dongliu:apk-parser:2.6.10")
|
||||
|
||||
// Jackson
|
||||
implementation("com.fasterxml.jackson.core:jackson-annotations:2.10.3")
|
||||
plugins.withType<KtlintPlugin> {
|
||||
extensions.configure<KtlintExtension>("ktlint") {
|
||||
version.set(libs.versions.ktlint.get())
|
||||
filter {
|
||||
exclude("**/generated/**")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<KotlinJvmCompile> {
|
||||
dependsOn("ktlintFormat")
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||
|
||||
freeCompilerArgs += listOf(
|
||||
"-Xcontext-receivers",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.zip4j)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
rootProject.name = "buildSrc"
|
||||
|
||||
dependencyResolutionManagement {
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../gradle/libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import java.io.BufferedReader
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const val MainClass = "suwayomi.tachidesk.MainKt"
|
||||
|
||||
// should be bumped with each stable release
|
||||
val tachideskVersion = System.getenv("ProductVersion") ?: "v1.1.0"
|
||||
|
||||
val webUIRevisionTag = System.getenv("WebUIRevision") ?: "r1689"
|
||||
|
||||
// counts commits on the current checked out branch
|
||||
val getTachideskRevision = {
|
||||
runCatching {
|
||||
System.getenv("ProductRevision") ?: ProcessBuilder()
|
||||
.command("git", "rev-list", "HEAD", "--count")
|
||||
.start()
|
||||
.let { process ->
|
||||
process.waitFor()
|
||||
val output = process.inputStream.use {
|
||||
it.bufferedReader().use(BufferedReader::readText)
|
||||
}
|
||||
process.destroy()
|
||||
"r" + output.trim()
|
||||
}
|
||||
}.getOrDefault("r0")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,233 @@
|
||||
[versions]
|
||||
kotlin = "1.9.10"
|
||||
coroutines = "1.7.3"
|
||||
serialization = "1.6.0"
|
||||
okhttp = "5.0.0-alpha.11" # Major version is locked by Tachiyomi extensions
|
||||
javalin = "4.6.8" # Javalin 5.0.0+ requires Java 11
|
||||
jackson = "2.13.3" # jackson version locked by javalin, ref: `io.javalin.core.util.OptionalDependency`
|
||||
exposed = "0.40.1"
|
||||
dex2jar = "v64" # Stuck until https://github.com/ThexXTURBOXx/dex2jar/issues/27 is fixed
|
||||
rhino = "1.7.14"
|
||||
settings = "1.0.0-RC"
|
||||
twelvemonkeys = "3.9.4"
|
||||
graphqlkotlin = "6.5.6"
|
||||
xmlserialization = "0.86.2"
|
||||
ktlint = "1.0.0"
|
||||
|
||||
[libraries]
|
||||
# Kotlin
|
||||
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
|
||||
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
|
||||
kotlin-test-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5", version.ref = "kotlin" }
|
||||
|
||||
# Coroutines
|
||||
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
|
||||
coroutines-jdk8 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8", version.ref = "coroutines" }
|
||||
coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
|
||||
|
||||
# Serialization
|
||||
serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
|
||||
serialization-json-okio = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json-okio", version.ref = "serialization" }
|
||||
serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "serialization" }
|
||||
serialization-xml-core = { module = "io.github.pdvrieze.xmlutil:core-jvm", version.ref = "xmlserialization" }
|
||||
serialization-xml = { module = "io.github.pdvrieze.xmlutil:serialization-jvm", version.ref = "xmlserialization" }
|
||||
|
||||
# Logging
|
||||
slf4japi = "org.slf4j:slf4j-api:2.0.9"
|
||||
logback = "ch.qos.logback:logback-classic:1.3.11"
|
||||
kotlinlogging = "io.github.microutils:kotlin-logging:3.0.5"
|
||||
|
||||
# OkHttp
|
||||
okhttp-core = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
|
||||
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
|
||||
okhttp-dnsoverhttps = { module = "com.squareup.okhttp3:okhttp-dnsoverhttps", version.ref = "okhttp" }
|
||||
okhttp-brotli = { module = "com.squareup.okhttp3:okhttp-brotli", version.ref = "okhttp" }
|
||||
okio = "com.squareup.okio:okio:3.3.0"
|
||||
|
||||
# Javalin api
|
||||
javalin-core = { module = "io.javalin:javalin", version.ref = "javalin" }
|
||||
javalin-openapi = { module = "io.javalin:javalin-openapi", version.ref = "javalin" }
|
||||
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
|
||||
jackson-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson" }
|
||||
jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" }
|
||||
|
||||
# GraphQL
|
||||
graphql-kotlin-server = { module = "com.expediagroup:graphql-kotlin-server", version.ref = "graphqlkotlin" }
|
||||
graphql-kotlin-scheme = { module = "com.expediagroup:graphql-kotlin-schema-generator", version.ref = "graphqlkotlin" }
|
||||
graphql-scalars = "com.graphql-java:graphql-java-extended-scalars:20.2"
|
||||
|
||||
# Exposed ORM
|
||||
exposed-core = { module = "org.jetbrains.exposed:exposed-core", version.ref = "exposed" }
|
||||
exposed-dao = { module = "org.jetbrains.exposed:exposed-dao", version.ref = "exposed" }
|
||||
exposed-jdbc = { module = "org.jetbrains.exposed:exposed-jdbc", version.ref = "exposed" }
|
||||
exposed-javatime = { module = "org.jetbrains.exposed:exposed-java-time", version.ref = "exposed" }
|
||||
h2 = "com.h2database:h2:1.4.200" # current database driver, can't update to h2 v2 without sql migration
|
||||
|
||||
# Exposed Migrations
|
||||
exposed-migrations = "com.github.Suwayomi:exposed-migrations:3.2.0"
|
||||
|
||||
# Dependency Injection
|
||||
kodein = "org.kodein.di:kodein-di-conf-jvm:7.20.2"
|
||||
|
||||
# tray icon
|
||||
systemtray-core = "com.dorkbox:SystemTray:4.2.1"
|
||||
systemtray-utils = "com.dorkbox:Utilities:1.39" # version locked by SystemTray
|
||||
systemtray-desktop = "com.dorkbox:Desktop:1.0"
|
||||
|
||||
# dependencies of Tachiyomi extensions
|
||||
injekt = "com.github.inorichi.injekt:injekt-core:65b0440"
|
||||
rxjava = "io.reactivex:rxjava:1.3.8"
|
||||
jsoup = "org.jsoup:jsoup:1.16.1"
|
||||
|
||||
# Config
|
||||
config = "com.typesafe:config:1.4.2"
|
||||
config4k = "io.github.config4k:config4k:0.5.0"
|
||||
|
||||
# Sort
|
||||
sort = "com.github.gpanther:java-nat-sort:natural-comparator-1.1"
|
||||
|
||||
# Android stub library
|
||||
android-stubs = "com.github.Suwayomi:android-jar:1.0.0"
|
||||
|
||||
# Asm modificiation
|
||||
asm = "org.ow2.asm:asm:9.5" # version locked by Dex2Jar
|
||||
dex2jar-translator = { module = "com.github.ThexXTURBOXx.dex2jar:dex-translator", version.ref = "dex2jar" }
|
||||
dex2jar-tools = { module = "com.github.ThexXTURBOXx.dex2jar:dex-tools", version.ref = "dex2jar" }
|
||||
|
||||
# APK
|
||||
apk-parser = "net.dongliu:apk-parser:2.6.10"
|
||||
apksig = "com.android.tools.build:apksig:7.2.1"
|
||||
|
||||
# Xml
|
||||
xmlpull = "xmlpull:xmlpull:1.1.3.4a"
|
||||
|
||||
# Disk & File
|
||||
appdirs = "net.harawata:appdirs:1.2.1"
|
||||
zip4j = "net.lingala.zip4j:zip4j:2.11.5"
|
||||
commonscompress = "org.apache.commons:commons-compress:1.24.0"
|
||||
junrar = "com.github.junrar:junrar:7.5.5"
|
||||
|
||||
# AES/CBC/PKCS7Padding Cypher provider
|
||||
bouncycastle = "org.bouncycastle:bcprov-jdk18on:1.76"
|
||||
|
||||
# AndroidX annotations
|
||||
android-annotations = "androidx.annotation:annotation:1.7.0"
|
||||
|
||||
# Substitute for duktape-android
|
||||
rhino-runtime = { module = "org.mozilla:rhino-runtime", version.ref = "rhino" } # slimmer version of 'org.mozilla:rhino'
|
||||
rhino-engine = { module = "org.mozilla:rhino-engine", version.ref = "rhino" } # provides the same interface as 'javax.script' a.k.a Nashorn
|
||||
|
||||
# Settings
|
||||
settings-core = { module = "com.russhwolf:multiplatform-settings-jvm", version.ref = "settings" }
|
||||
settings-serialization = { module = "com.russhwolf:multiplatform-settings-serialization-jvm", version.ref = "settings" }
|
||||
|
||||
# ICU4J
|
||||
icu4j = "com.ibm.icu:icu4j:73.2"
|
||||
|
||||
# Image Decoding implementation provider
|
||||
twelvemonkeys-common-lang = { module = "com.twelvemonkeys.common:common-lang", version.ref = "twelvemonkeys" }
|
||||
twelvemonkeys-common-io = { module = "com.twelvemonkeys.common:common-io", version.ref = "twelvemonkeys" }
|
||||
twelvemonkeys-common-image = { module = "com.twelvemonkeys.common:common-image", version.ref = "twelvemonkeys" }
|
||||
twelvemonkeys-imageio-core = { module = "com.twelvemonkeys.imageio:imageio-core", version.ref = "twelvemonkeys" }
|
||||
twelvemonkeys-imageio-metadata = { module = "com.twelvemonkeys.imageio:imageio-metadata", version.ref = "twelvemonkeys" }
|
||||
twelvemonkeys-imageio-jpeg = { module = "com.twelvemonkeys.imageio:imageio-jpeg", version.ref = "twelvemonkeys" }
|
||||
twelvemonkeys-imageio-webp = { module = "com.twelvemonkeys.imageio:imageio-webp", version.ref = "twelvemonkeys" }
|
||||
|
||||
# Testing
|
||||
mockk = "io.mockk:mockk:1.13.7"
|
||||
|
||||
# cron scheduler
|
||||
cron4j = "it.sauronsoftware.cron4j:cron4j:2.2.5"
|
||||
|
||||
# cron-utils
|
||||
cronUtils = "com.cronutils:cron-utils:9.2.1"
|
||||
|
||||
[plugins]
|
||||
# Kotlin
|
||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin"}
|
||||
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin"}
|
||||
|
||||
# Linter
|
||||
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version = "11.6.0"}
|
||||
|
||||
# Build config
|
||||
buildconfig = { id = "com.github.gmazzo.buildconfig", version = "3.1.0"}
|
||||
|
||||
# Download
|
||||
download = { id = "de.undercouch.download", version = "5.4.0"}
|
||||
|
||||
# ShadowJar
|
||||
shadowjar = { id = "com.github.johnrengelman.shadow", version = "8.1.1"}
|
||||
|
||||
[bundles]
|
||||
shared = [
|
||||
"kotlin-stdlib-jdk8",
|
||||
"kotlin-reflect",
|
||||
"coroutines-core",
|
||||
"coroutines-jdk8",
|
||||
"serialization-json",
|
||||
"serialization-json-okio",
|
||||
"serialization-protobuf",
|
||||
"kodein",
|
||||
"slf4japi",
|
||||
"logback",
|
||||
"kotlinlogging",
|
||||
"appdirs",
|
||||
"rxjava",
|
||||
"jsoup",
|
||||
"config",
|
||||
"config4k",
|
||||
"dex2jar-translator",
|
||||
"dex2jar-tools",
|
||||
"apk-parser",
|
||||
"jackson-annotations"
|
||||
]
|
||||
|
||||
sharedTest = [
|
||||
"kotlin-test-junit5",
|
||||
"coroutines-test",
|
||||
]
|
||||
|
||||
okhttp = [
|
||||
"okhttp-core",
|
||||
"okhttp-logging",
|
||||
"okhttp-dnsoverhttps",
|
||||
"okhttp-brotli",
|
||||
]
|
||||
javalin = [
|
||||
"javalin-core",
|
||||
"javalin-openapi",
|
||||
]
|
||||
jackson = [
|
||||
"jackson-databind",
|
||||
"jackson-kotlin",
|
||||
"jackson-annotations",
|
||||
]
|
||||
exposed = [
|
||||
"exposed-core",
|
||||
"exposed-dao",
|
||||
"exposed-jdbc",
|
||||
"exposed-javatime",
|
||||
]
|
||||
systemtray = [
|
||||
"systemtray-core",
|
||||
"systemtray-utils",
|
||||
"systemtray-desktop"
|
||||
]
|
||||
rhino = [
|
||||
"rhino-runtime",
|
||||
"rhino-engine",
|
||||
]
|
||||
settings = [
|
||||
"settings-core",
|
||||
"settings-serialization",
|
||||
]
|
||||
twelvemonkeys = [
|
||||
"twelvemonkeys-common-lang",
|
||||
"twelvemonkeys-common-io",
|
||||
"twelvemonkeys-common-image",
|
||||
"twelvemonkeys-imageio-core",
|
||||
"twelvemonkeys-imageio-metadata",
|
||||
"twelvemonkeys-imageio-jpeg",
|
||||
"twelvemonkeys-imageio-webp",
|
||||
]
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -17,67 +17,101 @@
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
@@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
@@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
@@ -106,80 +140,101 @@ location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
||||
Vendored
+8
-6
@@ -14,7 +14,7 @@
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@@ -25,7 +25,7 @@
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
@@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
Executable
+314
@@ -0,0 +1,314 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) Contributors to the Suwayomi project
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
main() {
|
||||
POSITIONAL_ARGS=()
|
||||
OUTPUT_DIR=.
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
-o|--output-dir)
|
||||
OUTPUT_DIR="$(readlink -e "$2" || exit 1)"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
POSITIONAL_ARGS+=("$1")
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
# restore positional parameters
|
||||
set -- "${POSITIONAL_ARGS[@]}"
|
||||
|
||||
OS="$1"
|
||||
JAR="$(ls server/build/*.jar | tail -n1)"
|
||||
RELEASE_NAME="$(echo "${JAR%.*}" | xargs basename)-$OS"
|
||||
RELEASE_VERSION="$(tmp="${JAR%-*}"; echo "${tmp##*-}" | tr -d v)"
|
||||
#RELEASE_REVISION_NUMBER="$(tmp="${JAR%.*}" && echo "${tmp##*-}" | tr -d r)"
|
||||
local electron_version="v28.1.3"
|
||||
|
||||
# clean temporary directory on function return
|
||||
trap "rm -rf $RELEASE_NAME/" RETURN
|
||||
mkdir "$RELEASE_NAME/"
|
||||
|
||||
download_launcher
|
||||
|
||||
case "$OS" in
|
||||
debian-all)
|
||||
RELEASE="$RELEASE_NAME.deb"
|
||||
make_deb_package
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
linux-assets)
|
||||
RELEASE="$RELEASE_NAME.tar.gz"
|
||||
copy_linux_package_assets_to "$RELEASE_NAME/"
|
||||
tar -I "gzip -9" -cvf "$RELEASE" "$RELEASE_NAME/"
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
linux-x64)
|
||||
# https://github.com/adoptium/temurin8-binaries/releases/
|
||||
JRE_RELEASE="jdk8u392-b08"
|
||||
JRE="OpenJDK8U-jre_x64_linux_hotspot_$(echo "$JRE_RELEASE" | sed 's/jdk//;s/-//g').tar.gz"
|
||||
JRE_DIR="$JRE_RELEASE-jre"
|
||||
JRE_URL="https://github.com/adoptium/temurin8-binaries/releases/download/$JRE_RELEASE/$JRE"
|
||||
ELECTRON="electron-$electron_version-linux-x64.zip"
|
||||
ELECTRON_URL="https://github.com/electron/electron/releases/download/$electron_version/$ELECTRON"
|
||||
download_jre_and_electron
|
||||
|
||||
RELEASE="$RELEASE_NAME.tar.gz"
|
||||
make_linux_bundle
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
macOS-x64)
|
||||
# https://github.com/adoptium/temurin8-binaries/releases/
|
||||
JRE_RELEASE="jdk8u392-b08"
|
||||
JRE="OpenJDK8U-jre_x64_mac_hotspot_$(echo "$JRE_RELEASE" | sed 's/jdk//;s/-//g').tar.gz"
|
||||
JRE_DIR="$JRE_RELEASE-jre"
|
||||
JRE_URL="https://github.com/adoptium/temurin8-binaries/releases/download/$JRE_RELEASE/$JRE"
|
||||
ELECTRON="electron-$electron_version-darwin-x64.zip"
|
||||
ELECTRON_URL="https://github.com/electron/electron/releases/download/$electron_version/$ELECTRON"
|
||||
download_jre_and_electron
|
||||
|
||||
RELEASE="$RELEASE_NAME.zip"
|
||||
make_macos_bundle
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
macOS-arm64)
|
||||
# https://cdn.azul.com/zulu/bin/
|
||||
JRE="zulu8.74.0.17-ca-jre8.0.392-macosx_aarch64.tar.gz"
|
||||
JRE_RELEASE="zulu8.74.0.17-ca-jre8.0.392-macosx_aarch64"
|
||||
JRE_DIR="$JRE_RELEASE/zulu-8.jre"
|
||||
JRE_URL="https://cdn.azul.com/zulu/bin/$JRE"
|
||||
ELECTRON="electron-$electron_version-darwin-arm64.zip"
|
||||
ELECTRON_URL="https://github.com/electron/electron/releases/download/$electron_version/$ELECTRON"
|
||||
download_jre_and_electron
|
||||
|
||||
RELEASE="$RELEASE_NAME.zip"
|
||||
make_macos_bundle
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
windows-x86)
|
||||
# https://github.com/adoptium/temurin8-binaries/releases/
|
||||
JRE_RELEASE="jdk8u392-b08"
|
||||
JRE="OpenJDK8U-jre_x86-32_windows_hotspot_$(echo "$JRE_RELEASE" | sed 's/jdk//;s/-//g').zip"
|
||||
JRE_DIR="$JRE_RELEASE-jre"
|
||||
JRE_URL="https://github.com/adoptium/temurin8-binaries/releases/download/$JRE_RELEASE/$JRE"
|
||||
ELECTRON="electron-$electron_version-win32-ia32.zip"
|
||||
ELECTRON_URL="https://github.com/electron/electron/releases/download/$electron_version/$ELECTRON"
|
||||
download_jre_and_electron
|
||||
|
||||
RELEASE="$RELEASE_NAME.zip"
|
||||
make_windows_bundle
|
||||
move_release_to_output_dir
|
||||
|
||||
RELEASE="$RELEASE_NAME.msi"
|
||||
make_windows_package
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
windows-x64)
|
||||
# https://github.com/adoptium/temurin8-binaries/releases/
|
||||
JRE_RELEASE="jdk8u392-b08"
|
||||
JRE="OpenJDK8U-jre_x64_windows_hotspot_$(echo "$JRE_RELEASE" | sed 's/jdk//;s/-//g').zip"
|
||||
JRE_DIR="$JRE_RELEASE-jre"
|
||||
JRE_URL="https://github.com/adoptium/temurin8-binaries/releases/download/$JRE_RELEASE/$JRE"
|
||||
ELECTRON="electron-$electron_version-win32-x64.zip"
|
||||
ELECTRON_URL="https://github.com/electron/electron/releases/download/$electron_version/$ELECTRON"
|
||||
download_jre_and_electron
|
||||
|
||||
RELEASE="$RELEASE_NAME.zip"
|
||||
make_windows_bundle
|
||||
move_release_to_output_dir
|
||||
|
||||
RELEASE="$RELEASE_NAME.msi"
|
||||
make_windows_package
|
||||
move_release_to_output_dir
|
||||
;;
|
||||
*)
|
||||
error $LINENO "Unsupported operating system: $OS" 2
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
move_release_to_output_dir() {
|
||||
# clean up from possible previous runs
|
||||
if [ -f "$OUTPUT_DIR/$RELEASE" ]; then
|
||||
rm "$OUTPUT_DIR/$RELEASE"
|
||||
fi
|
||||
mv "$RELEASE" "$OUTPUT_DIR/"
|
||||
}
|
||||
|
||||
download_launcher() {
|
||||
LAUNCHER_URL=$(curl -s "https://api.github.com/repos/Suwayomi/Suwayomi-Launcher/releases/latest" | grep "browser_download_url" | grep ".jar" | head -n 1 | cut -d '"' -f 4)
|
||||
curl -L "$LAUNCHER_URL" -o "Suwayomi-Launcher.jar"
|
||||
mv "Suwayomi-Launcher.jar" "$RELEASE_NAME/Suwayomi-Launcher.jar"
|
||||
}
|
||||
|
||||
download_jre_and_electron() {
|
||||
if [ ! -f "$JRE" ]; then
|
||||
curl -L "$JRE_URL" -o "$JRE"
|
||||
fi
|
||||
if [ ! -f "$ELECTRON" ]; then
|
||||
curl -L "$ELECTRON_URL" -o "$ELECTRON"
|
||||
fi
|
||||
|
||||
local ext="${JRE##*.}"
|
||||
if [ "$ext" = "zip" ]; then
|
||||
unzip "$JRE"
|
||||
else
|
||||
tar xvf "$JRE"
|
||||
fi
|
||||
mv "$JRE_DIR" "$RELEASE_NAME/jre"
|
||||
unzip "$ELECTRON" -d "$RELEASE_NAME/electron/"
|
||||
|
||||
mkdir "$RELEASE_NAME/bin"
|
||||
|
||||
tree
|
||||
}
|
||||
|
||||
copy_linux_package_assets_to() {
|
||||
local output_dir
|
||||
output_dir="$(readlink -e "$1" || exit 1)"
|
||||
|
||||
cp "scripts/resources/pkg/suwayomi-server.sh" "$output_dir/"
|
||||
cp "scripts/resources/pkg/suwayomi-server.desktop" "$output_dir/"
|
||||
cp "scripts/resources/pkg/suwayomi-launcher.sh" "$output_dir/"
|
||||
cp "scripts/resources/pkg/suwayomi-launcher.desktop" "$output_dir/"
|
||||
cp "scripts/resources/pkg/systemd"/* "$output_dir/"
|
||||
cp "server/src/main/resources/icon/faviconlogo-128.png" \
|
||||
"$output_dir/suwayomi-server.png"
|
||||
}
|
||||
|
||||
make_linux_bundle() {
|
||||
cp "$JAR" "$RELEASE_NAME/bin/Suwayomi-Server.jar"
|
||||
cp "scripts/resources/suwayomi-launcher.sh" "$RELEASE_NAME/"
|
||||
cp "scripts/resources/suwayomi-server.sh" "$RELEASE_NAME/"
|
||||
|
||||
tar -I "gzip -9" -cvf "$RELEASE" "$RELEASE_NAME/"
|
||||
}
|
||||
|
||||
make_macos_bundle() {
|
||||
cp "$JAR" "$RELEASE_NAME/bin/Suwayomi-Server.jar"
|
||||
cp "scripts/resources/Suwayomi Launcher.command" "$RELEASE_NAME/"
|
||||
|
||||
zip -9 -r "$RELEASE" "$RELEASE_NAME/"
|
||||
}
|
||||
|
||||
# https://wiki.debian.org/SimplePackagingTutorial
|
||||
# https://www.debian.org/doc/manuals/packaging-tutorial/packaging-tutorial.pdf
|
||||
make_deb_package() {
|
||||
#behind $RELEASE_VERSION is hyphen "-"
|
||||
local source_dir="suwayomi-server-$RELEASE_VERSION"
|
||||
#behind $RELEASE_VERSION is underscore "_"
|
||||
local upstream_source="suwayomi-server_$RELEASE_VERSION.orig.tar.gz"
|
||||
|
||||
mkdir "$RELEASE_NAME/$source_dir/"
|
||||
mv "$RELEASE_NAME/Suwayomi-Launcher.jar" "$RELEASE_NAME/$source_dir/Suwayomi-Launcher.jar"
|
||||
cp "$JAR" "$RELEASE_NAME/$source_dir/Suwayomi-Server.jar"
|
||||
copy_linux_package_assets_to "$RELEASE_NAME/$source_dir/"
|
||||
tar -I "gzip" -C "$RELEASE_NAME/" -cvf "$upstream_source" "$source_dir"
|
||||
|
||||
cp -r "scripts/resources/deb/" "$RELEASE_NAME/$source_dir/debian/"
|
||||
sed -i "s/\$pkgver/$RELEASE_VERSION/" "$RELEASE_NAME/$source_dir/debian/changelog"
|
||||
sed -i "s/\$pkgrel/1/" "$RELEASE_NAME/$source_dir/debian/changelog"
|
||||
|
||||
sudo apt update
|
||||
sudo apt install devscripts build-essential dh-exec
|
||||
cd "$RELEASE_NAME/$source_dir/"
|
||||
dpkg-buildpackage --no-sign --build=all
|
||||
cd -
|
||||
|
||||
local deb="suwayomi-server_$RELEASE_VERSION-1_all.deb"
|
||||
mv "$RELEASE_NAME/$deb" "$RELEASE"
|
||||
}
|
||||
|
||||
make_windows_bundle() {
|
||||
## I disabled this section until someone find a solution to this error:
|
||||
##E: Unable to correct problems, you have held broken packages.
|
||||
##./bundler.sh: line 250: wine: command not found
|
||||
|
||||
## check if running under github actions
|
||||
#if [ "$CI" = true ]; then
|
||||
## change electron executable's icon
|
||||
#sudo dpkg --add-architecture i386
|
||||
#wget -qO - https://dl.winehq.org/wine-builds/winehq.key \
|
||||
#| sudo apt-key add -
|
||||
#sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport
|
||||
#sudo apt-add-repository "deb https://dl.winehq.org/wine-builds/ubuntu \
|
||||
#$(lsb_release -cs) main"
|
||||
#sudo apt install --install-recommends winehq-stable
|
||||
#fi
|
||||
## this script assumes that wine is installed here on out
|
||||
|
||||
#local rcedit="rcedit-x85.exe"
|
||||
#local rcedit_url="https://github.com/electron/rcedit/releases/download/v0.1.1/$rcedit"
|
||||
## change electron's icon
|
||||
#if [ ! -f "$rcedit" ]; then
|
||||
#curl -L "$rcedit_url" -o "$rcedit"
|
||||
#fi
|
||||
|
||||
#local icon="server/src/main/resources/icon/faviconlogo.ico"
|
||||
#WINEARCH=win32 wine "$rcedit" "$RELEASE_NAME/electron/electron.exe" \
|
||||
# --set-icon "$icon"
|
||||
|
||||
cp "$JAR" "$RELEASE_NAME/bin/Suwayomi-Server.jar"
|
||||
cp "scripts/resources/Suwayomi Launcher.bat" "$RELEASE_NAME"
|
||||
|
||||
zip -9 -r "$RELEASE" "$RELEASE_NAME"
|
||||
}
|
||||
|
||||
make_windows_package() {
|
||||
if [ "$CI" = true ]; then
|
||||
sudo apt update
|
||||
sudo apt install -y wixl
|
||||
fi
|
||||
|
||||
find "$RELEASE_NAME/jre" \
|
||||
| wixl-heat --var var.SourceDir -p "$RELEASE_NAME/" \
|
||||
--directory-ref jre --component-group jre >"$RELEASE_NAME/jre.wxs"
|
||||
find "$RELEASE_NAME/electron" \
|
||||
| wixl-heat --var var.SourceDir -p "$RELEASE_NAME/" \
|
||||
--directory-ref electron --component-group electron >"$RELEASE_NAME/electron.wxs"
|
||||
|
||||
find "$RELEASE_NAME/bin" \
|
||||
| wixl-heat --var var.SourceDir -p "$RELEASE_NAME/" \
|
||||
--directory-ref bin --component-group bin >"$RELEASE_NAME/bin.wxs"
|
||||
|
||||
local icon="server/src/main/resources/icon/faviconlogo.ico"
|
||||
local arch=${OS##*-}
|
||||
|
||||
wixl -D ProductVersion="$RELEASE_VERSION" -D SourceDir="$RELEASE_NAME" \
|
||||
-D Icon="$icon" --arch "$arch" "scripts/resources/msi/suwayomi-server-$arch.wxs" \
|
||||
"$RELEASE_NAME/jre.wxs" "$RELEASE_NAME/electron.wxs" "$RELEASE_NAME/bin.wxs" -o "$RELEASE"
|
||||
}
|
||||
|
||||
# Error handler
|
||||
# set -u: Treat unset variables as an error when substituting.
|
||||
# set -o pipefail: Prevents errors in pipeline from being masked.
|
||||
# set -e: Immediatly exit if any command has a non-zero exit status.
|
||||
# set -E: Inherit the trap ERR function before exiting by set.
|
||||
#
|
||||
# set -e is not recommended and unpredictable.
|
||||
# see https://stackoverflow.com/questions/64786/error-handling-in-bash
|
||||
# and http://mywiki.wooledge.org/BashFAO/105
|
||||
set -uo pipefail
|
||||
error() {
|
||||
local parent_lineno="$1"
|
||||
local message="$2"
|
||||
local code="${3:-1}"
|
||||
if [ -z "$message" ]; then
|
||||
echo "$0: line $parent_lineno: exiting with status $code"
|
||||
else
|
||||
echo "$0: line $parent_lineno: $message: exiting with status $code"
|
||||
fi
|
||||
exit "$code"
|
||||
}
|
||||
trap 'error $LINENO ""' ERR
|
||||
|
||||
main "$@"; exit
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
start "" jre/bin/javaw -jar Suwayomi-Launcher.jar
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
cd "`dirname "$0"`"
|
||||
|
||||
./jre/Contents/Home/bin/java -jar Suwayomi-Launcher.jar
|
||||
@@ -1 +0,0 @@
|
||||
start "" jre/bin/javaw -jar Tachidesk.jar
|
||||
@@ -1 +0,0 @@
|
||||
jre\bin\java -Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true -jar Tachidesk.jar
|
||||
@@ -1 +0,0 @@
|
||||
jre\bin\javaw "-Dsuwayomi.tachidesk.config.server.webInterface=electron" "-Dsuwayomi.tachidesk.config.server.electronPath=electron/electron.exe" -jar Tachidesk.jar
|
||||
@@ -0,0 +1,5 @@
|
||||
suwayomi-server ($pkgver-$pkgrel) unstable; urgency=medium
|
||||
|
||||
* See CHANGELOG.md on https://github.com/Suwayomi/Suwayomi-Server
|
||||
|
||||
-- Mahor1221 <mahor1221@pm.me> Fri, 14 Jan 2022 00:00:00 +0000
|
||||
@@ -0,0 +1,14 @@
|
||||
Source: suwayomi-server
|
||||
Section: web
|
||||
Priority: optional
|
||||
Maintainer: Mahor1221 <mahor1221@pm.me>
|
||||
Build-Depends: debhelper-compat (= 13), dh-exec
|
||||
Standards-Version: 4.5.1
|
||||
Homepage: https://github.com/Suwayomi/Suwayomi-Server
|
||||
|
||||
Package: suwayomi-server
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}, java8-runtime, libc++-dev
|
||||
Description: Manga Reader
|
||||
A free and open source manga reader server that runs extensions built for Tachiyomi.
|
||||
Suwayomi is an independent Tachiyomi compatible software and is not a Fork of Tachiyomi.
|
||||
@@ -0,0 +1,381 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: suwayomi-server
|
||||
Upstream-Contact: https://discord.gg/DDZdqZWaHA
|
||||
Source: https://github.com/Suwayomi/Suwayomi-Server
|
||||
|
||||
Files: *
|
||||
Copyright: Contributors to the Suwayomi project
|
||||
License: MPL-2.0
|
||||
Mozilla Public License Version 2.0
|
||||
==================================
|
||||
.
|
||||
1. Definitions
|
||||
--------------
|
||||
.
|
||||
1.1. "Contributor"
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
.
|
||||
1.2. "Contributor Version"
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
.
|
||||
1.3. "Contribution"
|
||||
means Covered Software of a particular Contributor.
|
||||
.
|
||||
1.4. "Covered Software"
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
.
|
||||
1.5. "Incompatible With Secondary Licenses"
|
||||
means
|
||||
.
|
||||
(a) that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
.
|
||||
(b) that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
.
|
||||
1.6. "Executable Form"
|
||||
means any form of the work other than Source Code Form.
|
||||
.
|
||||
1.7. "Larger Work"
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
.
|
||||
1.8. "License"
|
||||
means this document.
|
||||
.
|
||||
1.9. "Licensable"
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
.
|
||||
1.10. "Modifications"
|
||||
means any of the following:
|
||||
.
|
||||
(a) any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
.
|
||||
(b) any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
.
|
||||
1.11. "Patent Claims" of a Contributor
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
.
|
||||
1.12. "Secondary License"
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
.
|
||||
1.13. "Source Code Form"
|
||||
means the form of the work preferred for making modifications.
|
||||
.
|
||||
1.14. "You" (or "Your")
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
.
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
.
|
||||
2.1. Grants
|
||||
.
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
.
|
||||
(a) under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
.
|
||||
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
.
|
||||
2.2. Effective Date
|
||||
.
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
.
|
||||
2.3. Limitations on Grant Scope
|
||||
.
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
.
|
||||
(a) for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
.
|
||||
(b) for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
.
|
||||
(c) under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
.
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
.
|
||||
2.4. Subsequent Licenses
|
||||
.
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
.
|
||||
2.5. Representation
|
||||
.
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
.
|
||||
2.6. Fair Use
|
||||
.
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
.
|
||||
2.7. Conditions
|
||||
.
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
.
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
.
|
||||
3.1. Distribution of Source Form
|
||||
.
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
.
|
||||
3.2. Distribution of Executable Form
|
||||
.
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
.
|
||||
(a) such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
.
|
||||
(b) You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
.
|
||||
3.3. Distribution of a Larger Work
|
||||
.
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
.
|
||||
3.4. Notices
|
||||
.
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
.
|
||||
3.5. Application of Additional Terms
|
||||
.
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
.
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
.
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
.
|
||||
5. Termination
|
||||
--------------
|
||||
.
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
.
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
.
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
.
|
||||
************************************************************************
|
||||
* *
|
||||
* 6. Disclaimer of Warranty *
|
||||
* ------------------------- *
|
||||
* *
|
||||
* Covered Software is provided under this License on an "as is" *
|
||||
* basis, without warranty of any kind, either expressed, implied, or *
|
||||
* statutory, including, without limitation, warranties that the *
|
||||
* Covered Software is free of defects, merchantable, fit for a *
|
||||
* particular purpose or non-infringing. The entire risk as to the *
|
||||
* quality and performance of the Covered Software is with You. *
|
||||
* Should any Covered Software prove defective in any respect, You *
|
||||
* (not any Contributor) assume the cost of any necessary servicing, *
|
||||
* repair, or correction. This disclaimer of warranty constitutes an *
|
||||
* essential part of this License. No use of any Covered Software is *
|
||||
* authorized under this License except under this disclaimer. *
|
||||
* *
|
||||
************************************************************************
|
||||
.
|
||||
************************************************************************
|
||||
* *
|
||||
* 7. Limitation of Liability *
|
||||
* -------------------------- *
|
||||
* *
|
||||
* Under no circumstances and under no legal theory, whether tort *
|
||||
* (including negligence), contract, or otherwise, shall any *
|
||||
* Contributor, or anyone who distributes Covered Software as *
|
||||
* permitted above, be liable to You for any direct, indirect, *
|
||||
* special, incidental, or consequential damages of any character *
|
||||
* including, without limitation, damages for lost profits, loss of *
|
||||
* goodwill, work stoppage, computer failure or malfunction, or any *
|
||||
* and all other commercial damages or losses, even if such party *
|
||||
* shall have been informed of the possibility of such damages. This *
|
||||
* limitation of liability shall not apply to liability for death or *
|
||||
* personal injury resulting from such party's negligence to the *
|
||||
* extent applicable law prohibits such limitation. Some *
|
||||
* jurisdictions do not allow the exclusion or limitation of *
|
||||
* incidental or consequential damages, so this exclusion and *
|
||||
* limitation may not apply to You. *
|
||||
* *
|
||||
************************************************************************
|
||||
.
|
||||
8. Litigation
|
||||
-------------
|
||||
.
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
.
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
.
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
.
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
.
|
||||
10.1. New Versions
|
||||
.
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
.
|
||||
10.2. Effect of New Versions
|
||||
.
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
.
|
||||
10.3. Modified Versions
|
||||
.
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
.
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
||||
Licenses
|
||||
.
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
.
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
.
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
.
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
.
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
.
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
.
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/dh-exec
|
||||
|
||||
Suwayomi-Server.jar usr/share/java/suwayomi-server/bin/
|
||||
Suwayomi-Launcher.jar usr/share/java/suwayomi-server/
|
||||
suwayomi-server.png usr/share/pixmaps/
|
||||
suwayomi-server.desktop usr/share/applications/
|
||||
suwayomi-launcher.desktop usr/share/applications/
|
||||
suwayomi-server.service usr/lib/systemd/system/
|
||||
suwayomi-server.sysusers => usr/lib/sysusers.d/suwayomi-server.conf
|
||||
suwayomi-server.tmpfiles => usr/lib/tmpfiles.d/suwayomi-server.conf
|
||||
suwayomi-server.conf => etc/suwayomi/server.conf
|
||||
suwayomi-server.sh => usr/bin/suwayomi-server
|
||||
suwayomi-launcher.sh => usr/bin/suwayomi-launcher
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/make -f
|
||||
# See debhelper(7) (uncomment to enable)
|
||||
# output every command that modifies files on the build system.
|
||||
#export DH_VERBOSE = 1
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
override_dh_strip_nondeterminism:
|
||||
true
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
3.0 (quilt)
|
||||
@@ -0,0 +1 @@
|
||||
suwayomi-server.png
|
||||
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" UpgradeCode="*"
|
||||
Version="$(var.ProductVersion)" Language="1033" Name="Suwayomi Server" Manufacturer="Suwayomi">
|
||||
<Package InstallerVersion="300" Compressed="yes" />
|
||||
<Media Id="1" Cabinet="Suwayomi_Server.cab" EmbedCab="yes" />
|
||||
|
||||
<Condition Message="This version of Windows does not support deploying 64-bit packages.">
|
||||
VersionNT64
|
||||
</Condition>
|
||||
|
||||
<!-- Directory -->
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="ProgramFiles64Folder">
|
||||
<Directory Id="INSTALLDIR" Name="Suwayomi-Server" >
|
||||
<Directory Id="jre"/>
|
||||
<Directory Id="electron"/>
|
||||
<Directory Id="bin"/>
|
||||
</Directory>
|
||||
</Directory>
|
||||
<Directory Id="ProgramMenuFolder">
|
||||
<Directory Id="ProgramMenuDir" Name="Suwayomi-Server">
|
||||
<Component Id="ProgramMenuDir" Guid="*">
|
||||
<RemoveFolder Id="ProgramMenuDir" On="uninstall"/>
|
||||
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value="" KeyPath="yes"/>
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
<Directory Id="DesktopFolder" />
|
||||
</Directory>
|
||||
|
||||
<!-- Component -->
|
||||
<DirectoryRef Id="INSTALLDIR">
|
||||
<Component Id="SuwayomiJAR" Guid="*" Win64="yes">
|
||||
<File Id="Suwayomi-Launcher.jar" Source="$(var.SourceDir)/Suwayomi-Launcher.jar" KeyPath="yes" />
|
||||
</Component>
|
||||
|
||||
<Component Id="SuwayomiLauncherBAT" Guid="*" Win64="yes">
|
||||
<File Id="SuwayomiLauncher.bat" Source="$(var.SourceDir)/Suwayomi Launcher.bat" KeyPath="yes" >
|
||||
<Shortcut Id="SuwayomiLauncher.lnk" Name="Suwayomi Launcher" Directory="INSTALLDIR"
|
||||
WorkingDirectory="INSTALLDIR" Icon="Suwayomi.ico" IconIndex="0" Advertise="yes" />
|
||||
<Shortcut Id="DesktopSuwayomiLauncher.lnk" Name="Suwayomi Launcher" Directory="DesktopFolder"
|
||||
WorkingDirectory="INSTALLDIR" Icon="Suwayomi.ico" IconIndex="0" Advertise="yes" />
|
||||
<Shortcut Id="ProgramMenuSuwayomiLauncher.lnk" Name="Suwayomi Launcher" Directory="ProgramMenuDir"
|
||||
WorkingDirectory="INSTALLDIR" Icon="Suwayomi.ico" IconIndex="0" Advertise="yes"
|
||||
Description="A free and open source manga reader that runs extensions built for Tachiyomi." />
|
||||
</File>
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
<!-- Feature -->
|
||||
<Feature Id="Suwayomi_Server" Title="Suwayomi-Server" Level="1">
|
||||
<ComponentGroupRef Id="jre" />
|
||||
<ComponentGroupRef Id="bin" />
|
||||
<ComponentRef Id="SuwayomiJAR" />
|
||||
<ComponentRef Id="SuwayomiLauncherBAT" />
|
||||
<ComponentRef Id="ProgramMenuDir" />
|
||||
<ComponentGroupRef Id="electron" />
|
||||
</Feature>
|
||||
|
||||
<Icon Id="Suwayomi.ico" SourceFile="$(var.Icon)" />
|
||||
<Property Id="ARPPRODUCTICON" Value="Suwayomi.ico" /> <!-- Icon in Add/Remove Programs -->
|
||||
</Product>
|
||||
</Wix>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" UpgradeCode="*"
|
||||
Version="$(var.ProductVersion)" Language="1033" Name="Suwayomi Server" Manufacturer="Suwayomi">
|
||||
<Package InstallerVersion="300" Compressed="yes" />
|
||||
<Media Id="1" Cabinet="Suwayomi_Server.cab" EmbedCab="yes" />
|
||||
|
||||
<!-- Directory -->
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="ProgramFilesFolder">
|
||||
<Directory Id="INSTALLDIR" Name="Suwayomi-Server" >
|
||||
<Directory Id="jre"/>
|
||||
<Directory Id="electron"/>
|
||||
<Directory Id="bin"/>
|
||||
</Directory>
|
||||
</Directory>
|
||||
<Directory Id="ProgramMenuFolder">
|
||||
<Directory Id="ProgramMenuDir" Name="Suwayomi-Server">
|
||||
<Component Id="ProgramMenuDir" Guid="*">
|
||||
<RemoveFolder Id="ProgramMenuDir" On="uninstall"/>
|
||||
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Value="" KeyPath="yes"/>
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
<Directory Id="DesktopFolder" />
|
||||
</Directory>
|
||||
|
||||
<!-- Component -->
|
||||
<DirectoryRef Id="INSTALLDIR">
|
||||
<Component Id="SuwayomiJAR" Guid="*">
|
||||
<File Id="Suwayomi-Launcher.jar" Source="$(var.SourceDir)/Suwayomi-Launcher.jar" KeyPath="yes" />
|
||||
</Component>
|
||||
|
||||
<Component Id="SuwayomiLauncherBAT" Guid="*" Win64="yes">
|
||||
<File Id="SuwayomiLauncher.bat" Source="$(var.SourceDir)/Suwayomi Launcher.bat" KeyPath="yes" >
|
||||
<Shortcut Id="SuwayomiLauncher.lnk" Name="Suwayomi Launcher" Directory="INSTALLDIR"
|
||||
WorkingDirectory="INSTALLDIR" Icon="Suwayomi.ico" IconIndex="0" Advertise="yes" />
|
||||
<Shortcut Id="DesktopSuwayomiLauncher.lnk" Name="Suwayomi Launcher" Directory="DesktopFolder"
|
||||
WorkingDirectory="INSTALLDIR" Icon="Suwayomi.ico" IconIndex="0" Advertise="yes" />
|
||||
<Shortcut Id="ProgramMenuSuwayomiLauncher.lnk" Name="Suwayomi Launcher" Directory="ProgramMenuDir"
|
||||
WorkingDirectory="INSTALLDIR" Icon="Suwayomi.ico" IconIndex="0" Advertise="yes"
|
||||
Description="A free and open source manga reader that runs extensions built for Tachiyomi." />
|
||||
</File>
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
<!-- Feature -->
|
||||
<Feature Id="Suwayomi_Server" Title="Suwayomi-Server" Level="1">
|
||||
<ComponentGroupRef Id="jre" />
|
||||
<ComponentGroupRef Id="bin" />
|
||||
<ComponentRef Id="SuwayomiJAR" />
|
||||
<ComponentRef Id="SuwayomiLauncherBAT" />
|
||||
<ComponentRef Id="ProgramMenuDir" />
|
||||
<ComponentGroupRef Id="electron" />
|
||||
</Feature>
|
||||
|
||||
<Icon Id="Suwayomi.ico" SourceFile="$(var.Icon)" />
|
||||
<Property Id="ARPPRODUCTICON" Value="Suwayomi.ico" /> <!-- Icon in Add/Remove Programs -->
|
||||
</Product>
|
||||
</Wix>
|
||||
@@ -0,0 +1,8 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Suwayomi-Launcher
|
||||
Comment=Manga Reader
|
||||
Exec=/usr/bin/java -jar /usr/share/java/suwayomi-server/Suwayomi-Launcher.jar "\\$@"
|
||||
Icon=suwayomi-server
|
||||
Terminal=false
|
||||
Categories=Network;
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec /usr/bin/java -jar /usr/share/java/suwayomi-server/Suwayomi-Launcher.jar
|
||||
@@ -0,0 +1,8 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Suwayomi-Server
|
||||
Comment=Manga Reader
|
||||
Exec=/usr/bin/java -jar /usr/share/java/suwayomi-server/bin/Suwayomi-Server.jar "\\$@"
|
||||
Icon=suwayomi-server
|
||||
Terminal=false
|
||||
Categories=Network;
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec /usr/bin/java -jar /usr/share/java/suwayomi-server/bin/Suwayomi-Server.jar
|
||||
@@ -0,0 +1,5 @@
|
||||
TACHIDESK_ROOT_DIR="/var/lib/suwayomi"
|
||||
|
||||
# Extra arguments passed to the java command
|
||||
# The default value disables the system tray icon, and launching a browser on service start.
|
||||
JAVA_ARGS=-Dsuwayomi.tachidesk.config.server.initialOpenInBrowserEnabled=false -Dsuwayomi.tachidesk.config.server.systemTrayEnabled=false
|
||||
@@ -0,0 +1,31 @@
|
||||
[Unit]
|
||||
Description=A free and open source manga reader server that runs extensions built for Tachiyomi.
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=suwayomi-server
|
||||
Group=suwayomi-server
|
||||
SyslogIdentifier=suwayomi-server
|
||||
|
||||
EnvironmentFile=/etc/suwayomi/server.conf
|
||||
ExecStart=/usr/bin/java $JAVA_ARGS -Dsuwayomi.tachidesk.config.server.rootDir="${TACHIDESK_ROOT_DIR}" -jar /usr/share/java/suwayomi-server/bin/Suwayomi-Server.jar
|
||||
Restart=on-failure
|
||||
|
||||
ProtectSystem=full
|
||||
ProtectHome=true
|
||||
PrivateTmp=yes
|
||||
PrivateDevices=yes
|
||||
ProtectClock=yes
|
||||
ProtectKernelTunables=yes
|
||||
ProtectKernelModules=yes
|
||||
ProtectKernelLogs=yes
|
||||
ProtectControlGroups=yes
|
||||
RestrictSUIDSGID=yes
|
||||
RestrictRealtime=yes
|
||||
RestrictNamespaces=yes
|
||||
NoNewPrivileges=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,2 @@
|
||||
#Type Name ID GECOS Home directory Shell
|
||||
u suwayomi-server - "Suwayomi Manga Server" /var/lib/suwayomi
|
||||
@@ -0,0 +1,2 @@
|
||||
#Type Path Mode User Group Age Argument
|
||||
d /var/lib/suwayomi 0755 suwayomi-server suwayomi-server
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec ./jre/bin/java -jar ./Suwayomi-Launcher.jar
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec ./jre/bin/java -jar ./bin/Suwayomi-Server.jar
|
||||
@@ -1,82 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) Contributors to the Suwayomi project
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
electron_version="v12.0.9"
|
||||
|
||||
if [ $1 = "win32" ]; then
|
||||
jre="OpenJDK8U-jre_x86-32_windows_hotspot_8u292b10.zip"
|
||||
arch="win32"
|
||||
electron="electron-$electron_version-win32-ia32.zip"
|
||||
else
|
||||
jre="OpenJDK8U-jre_x64_windows_hotspot_8u292b10.zip"
|
||||
arch="win64"
|
||||
electron="electron-$electron_version-win32-x64.zip"
|
||||
fi
|
||||
|
||||
jre_dir="jdk8u292-b10-jre"
|
||||
|
||||
echo "creating windows bundle"
|
||||
|
||||
jar=$(ls ../server/build/*.jar | tail -n1)
|
||||
jar_name=$(echo $jar | cut -d'/' -f4)
|
||||
release_name=$(echo $jar_name | sed 's/.jar//')-$arch
|
||||
|
||||
|
||||
# make release dir
|
||||
mkdir $release_name
|
||||
|
||||
|
||||
echo "Dealing with jre..."
|
||||
if [ ! -f $jre ]; then
|
||||
curl -L "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10/$jre" -o $jre
|
||||
fi
|
||||
unzip $jre
|
||||
mv $jre_dir $release_name/jre
|
||||
|
||||
echo "Dealing with electron"
|
||||
if [ ! -f $electron ]; then
|
||||
curl -L "https://github.com/electron/electron/releases/download/$electron_version/$electron" -o $electron
|
||||
fi
|
||||
unzip $electron -d $release_name/electron
|
||||
|
||||
# change electron's icon
|
||||
rcedit="rcedit-x86.exe"
|
||||
if [ ! -f $rcedit ]; then
|
||||
curl -L "https://github.com/electron/rcedit/releases/download/v1.1.1/$rcedit" -o $rcedit
|
||||
fi
|
||||
|
||||
# check if running under github actions
|
||||
if [ $CI = true ]; then
|
||||
# change electron executable's icon
|
||||
sudo dpkg --add-architecture i386
|
||||
wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
|
||||
sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport
|
||||
sudo apt-add-repository "deb https://dl.winehq.org/wine-builds/ubuntu $(lsb_release -cs) main"
|
||||
sudo apt install --install-recommends winehq-stable
|
||||
fi
|
||||
# this script assumes that wine is installed here on out
|
||||
|
||||
WINEARCH=win32 wine $rcedit $release_name/electron/electron.exe --set-icon ../server/src/main/resources/icon/faviconlogo.ico
|
||||
|
||||
# copy artifacts
|
||||
cp $jar $release_name/Tachidesk.jar
|
||||
cp "resources/Tachidesk Browser Launcher.bat" $release_name
|
||||
cp "resources/Tachidesk Debug Launcher.bat" $release_name
|
||||
cp "resources/Tachidesk Electron Launcher.bat" $release_name
|
||||
|
||||
zip_name=$release_name.zip
|
||||
zip -9 -r $zip_name $release_name
|
||||
|
||||
rm -rf $release_name
|
||||
|
||||
# clean up from possible previous runs
|
||||
if [ -f ../server/build/$zip_name ]; then
|
||||
rm ../server/build/$zip_name
|
||||
fi
|
||||
|
||||
mv $zip_name ../server/build/
|
||||
+124
-127
@@ -1,95 +1,89 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import org.jmailen.gradle.kotlinter.tasks.FormatTask
|
||||
import org.jmailen.gradle.kotlinter.tasks.LintTask
|
||||
import java.io.BufferedReader
|
||||
import de.undercouch.gradle.tasks.download.Download
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
||||
import java.time.Instant
|
||||
|
||||
plugins {
|
||||
id(libs.plugins.kotlin.jvm.get().pluginId)
|
||||
id(libs.plugins.kotlin.serialization.get().pluginId)
|
||||
id(libs.plugins.ktlint.get().pluginId)
|
||||
application
|
||||
id("com.github.johnrengelman.shadow") version "7.0.0"
|
||||
id("org.jmailen.kotlinter") version "3.4.3"
|
||||
id("de.fuerstenau.buildconfig") version "1.1.8"
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("https://repo1.maven.org/maven2/")
|
||||
}
|
||||
maven {
|
||||
url = uri("https://jitpack.io")
|
||||
}
|
||||
alias(libs.plugins.shadowjar)
|
||||
id(libs.plugins.buildconfig.get().pluginId)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// okhttp
|
||||
val okhttpVersion = "4.9.1" // version is locked by Tachiyomi extensions
|
||||
implementation("com.squareup.okhttp3:okhttp:$okhttpVersion")
|
||||
implementation("com.squareup.okhttp3:logging-interceptor:$okhttpVersion")
|
||||
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps:$okhttpVersion")
|
||||
implementation("com.squareup.okio:okio:2.10.0")
|
||||
// Shared
|
||||
implementation(libs.bundles.shared)
|
||||
testImplementation(libs.bundles.sharedTest)
|
||||
|
||||
// OkHttp
|
||||
implementation(libs.bundles.okhttp)
|
||||
implementation(libs.okio)
|
||||
|
||||
// Javalin api
|
||||
implementation("io.javalin:javalin:3.13.6")
|
||||
// jackson version is tied to javalin, ref: `io.javalin.core.util.OptionalDependency`
|
||||
implementation("com.fasterxml.jackson.core:jackson-databind:2.10.3")
|
||||
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.10.3")
|
||||
implementation(libs.bundles.javalin)
|
||||
implementation(libs.bundles.jackson)
|
||||
|
||||
// GraphQL
|
||||
implementation(libs.graphql.kotlin.server)
|
||||
implementation(libs.graphql.kotlin.scheme)
|
||||
implementation(libs.graphql.scalars)
|
||||
|
||||
// Exposed ORM
|
||||
val exposedVersion = "0.31.1"
|
||||
implementation("org.jetbrains.exposed:exposed-core:$exposedVersion")
|
||||
implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion")
|
||||
implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion")
|
||||
implementation("org.jetbrains.exposed:exposed-java-time:$exposedVersion")
|
||||
// current database driver
|
||||
implementation("com.h2database:h2:1.4.200")
|
||||
implementation(libs.bundles.exposed)
|
||||
implementation(libs.h2)
|
||||
|
||||
// Exposed Migrations
|
||||
val exposedMigrationsVersion = "3.1.0"
|
||||
implementation("com.github.Suwayomi:exposed-migrations:$exposedMigrationsVersion")
|
||||
implementation(libs.exposed.migrations)
|
||||
|
||||
// tray icon
|
||||
implementation("com.dorkbox:SystemTray:4.1")
|
||||
implementation("com.dorkbox:Utilities:1.9")
|
||||
|
||||
|
||||
implementation(libs.bundles.systemtray)
|
||||
|
||||
// dependencies of Tachiyomi extensions, some are duplicate, keeping it here for reference
|
||||
implementation("com.github.inorichi.injekt:injekt-core:65b0440")
|
||||
implementation("com.squareup.okhttp3:okhttp:4.9.1")
|
||||
implementation("io.reactivex:rxjava:1.3.8")
|
||||
implementation("org.jsoup:jsoup:1.13.1")
|
||||
implementation("com.google.code.gson:gson:2.8.6")
|
||||
implementation("com.github.salomonbrys.kotson:kotson:2.5.0")
|
||||
implementation(libs.injekt)
|
||||
implementation(libs.okhttp.core)
|
||||
implementation(libs.rxjava)
|
||||
implementation(libs.jsoup)
|
||||
|
||||
// ComicInfo
|
||||
implementation(libs.serialization.xml.core)
|
||||
implementation(libs.serialization.xml)
|
||||
|
||||
// asm for fixing SimpleDateFormat (must match Dex2Jar version)
|
||||
implementation("org.ow2.asm:asm-debug-all:5.0.3")
|
||||
// Sort
|
||||
implementation(libs.sort)
|
||||
|
||||
// extracting zip files
|
||||
implementation("net.lingala.zip4j:zip4j:2.9.0")
|
||||
// asm for ByteCodeEditor(fixing SimpleDateFormat) (must match Dex2Jar version)
|
||||
implementation(libs.asm)
|
||||
|
||||
// Source models and interfaces from Tachiyomi 1.x
|
||||
// using source class from tachiyomi commit 9493577de27c40ce8b2b6122cc447d025e34c477 to not depend on tachiyomi.sourceapi
|
||||
// implementation("tachiyomi.sourceapi:source-api:1.1")
|
||||
// Disk & File
|
||||
implementation(libs.zip4j)
|
||||
implementation(libs.commonscompress)
|
||||
implementation(libs.junrar)
|
||||
|
||||
// AES/CBC/PKCS7Padding Cypher provider for zh.copymanga
|
||||
implementation(libs.bouncycastle)
|
||||
|
||||
// AndroidCompat
|
||||
implementation(project(":AndroidCompat"))
|
||||
implementation(project(":AndroidCompat:Config"))
|
||||
implementation(projects.androidCompat)
|
||||
implementation(projects.androidCompat.config)
|
||||
|
||||
// uncomment to test extensions directly
|
||||
// implementation(fileTree("lib/"))
|
||||
implementation(kotlin("script-runtime"))
|
||||
|
||||
testImplementation(libs.mockk)
|
||||
|
||||
implementation(libs.cron4j)
|
||||
|
||||
implementation(libs.cronUtils)
|
||||
}
|
||||
|
||||
val MainClass = "suwayomi.tachidesk.MainKt"
|
||||
application {
|
||||
applicationDefaultJvmArgs =
|
||||
listOf(
|
||||
"-Djunrar.extractor.thread-keep-alive-seconds=30",
|
||||
)
|
||||
mainClass.set(MainClass)
|
||||
|
||||
// for testing electron
|
||||
// applicationDefaultJvmArgs = listOf(
|
||||
// "-Dsuwayomi.tachidesk.webInterface=electron",
|
||||
// "-Dsuwayomi.tachidesk.electronPath=/usr/bin/electron"
|
||||
// )
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
@@ -100,82 +94,59 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
// should be bumped with each stable release
|
||||
val tachideskVersion = System.getenv("ProductVersion") ?: "v0.4.5"
|
||||
val webUIRevisionTag = System.getenv("WebUIRevision") ?: "r23"
|
||||
|
||||
// counts commit count on master
|
||||
val tachideskRevision = runCatching {
|
||||
System.getenv("ProductRevision") ?: Runtime
|
||||
.getRuntime()
|
||||
.exec("git rev-list HEAD --count")
|
||||
.let { process ->
|
||||
process.waitFor()
|
||||
val output = process.inputStream.use {
|
||||
it.bufferedReader().use(BufferedReader::readText)
|
||||
}
|
||||
process.destroy()
|
||||
"r" + output.trim()
|
||||
}
|
||||
}.getOrDefault("r0")
|
||||
|
||||
buildConfig {
|
||||
clsName = "BuildConfig"
|
||||
packageName = "suwayomi.tachidesk.server"
|
||||
className("BuildConfig")
|
||||
packageName("suwayomi.tachidesk.server.generated")
|
||||
|
||||
useKotlinOutput()
|
||||
|
||||
buildConfigField("String", "NAME", rootProject.name)
|
||||
buildConfigField("String", "VERSION", tachideskVersion)
|
||||
buildConfigField("String", "REVISION", tachideskRevision)
|
||||
buildConfigField("String", "BUILD_TYPE", if (System.getenv("ProductBuildType") == "Stable") "Stable" else "Preview")
|
||||
fun quoteWrap(obj: Any): String = """"$obj""""
|
||||
|
||||
buildConfigField("String", "NAME", quoteWrap(rootProject.name))
|
||||
buildConfigField("String", "VERSION", quoteWrap(tachideskVersion))
|
||||
buildConfigField("String", "REVISION", quoteWrap(getTachideskRevision()))
|
||||
buildConfigField("String", "BUILD_TYPE", quoteWrap(if (System.getenv("ProductBuildType") == "Stable") "Stable" else "Preview"))
|
||||
buildConfigField("long", "BUILD_TIME", Instant.now().epochSecond.toString())
|
||||
|
||||
buildConfigField("String", "WEBUI_TAG", quoteWrap(webUIRevisionTag))
|
||||
|
||||
buildConfigField("String", "WEBUI_REPO", "https://github.com/Suwayomi/Tachidesk-WebUI-preview")
|
||||
buildConfigField("String", "WEBUI_TAG", webUIRevisionTag)
|
||||
|
||||
|
||||
buildConfigField("String", "GITHUB", "https://github.com/Suwayomi/Tachidesk")
|
||||
buildConfigField("String", "DISCORD", "https://discord.gg/DDZdqZWaHA")
|
||||
buildConfigField("String", "GITHUB", quoteWrap("https://github.com/Suwayomi/Suwayomi-Server"))
|
||||
buildConfigField("String", "DISCORD", quoteWrap("https://discord.gg/DDZdqZWaHA"))
|
||||
}
|
||||
|
||||
tasks {
|
||||
shadowJar {
|
||||
isZip64 = true
|
||||
manifest {
|
||||
attributes(
|
||||
mapOf(
|
||||
"Main-Class" to MainClass,
|
||||
"Implementation-Title" to rootProject.name,
|
||||
"Implementation-Vendor" to "The Suwayomi Project",
|
||||
"Specification-Version" to tachideskVersion,
|
||||
"Implementation-Version" to tachideskRevision
|
||||
)
|
||||
"Main-Class" to MainClass,
|
||||
"Implementation-Title" to rootProject.name,
|
||||
"Implementation-Vendor" to "The Suwayomi Project",
|
||||
"Specification-Version" to tachideskVersion,
|
||||
"Implementation-Version" to getTachideskRevision(),
|
||||
)
|
||||
}
|
||||
archiveBaseName.set(rootProject.name)
|
||||
archiveVersion.set(tachideskVersion)
|
||||
archiveClassifier.set(tachideskRevision)
|
||||
}
|
||||
withType<KotlinCompile> {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = listOf(
|
||||
"-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
||||
"-Xopt-in=kotlinx.coroutines.InternalCoroutinesApi"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnit()
|
||||
}
|
||||
|
||||
withType<ShadowJar> {
|
||||
archiveClassifier.set(getTachideskRevision())
|
||||
destinationDirectory.set(File("$rootDir/server/build"))
|
||||
}
|
||||
|
||||
named("run") {
|
||||
dependsOn("formatKotlin", "lintKotlin")
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
testLogging {
|
||||
showStandardStreams = true
|
||||
events("passed", "skipped", "failed")
|
||||
}
|
||||
}
|
||||
|
||||
withType<KotlinJvmCompile> {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs +=
|
||||
listOf(
|
||||
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
named<Copy>("processResources") {
|
||||
@@ -183,16 +154,42 @@ tasks {
|
||||
mustRunAfter("downloadWebUI")
|
||||
}
|
||||
|
||||
register<de.undercouch.gradle.tasks.download.Download>("downloadWebUI") {
|
||||
src("https://github.com/Suwayomi/Tachidesk-WebUI-preview/releases/download/$webUIRevisionTag/Tachidesk-WebUI-$webUIRevisionTag.zip")
|
||||
register<Download>("downloadWebUI") {
|
||||
src("https://github.com/Suwayomi/Suwayomi-WebUI-preview/releases/download/$webUIRevisionTag/Suwayomi-WebUI-$webUIRevisionTag.zip")
|
||||
dest("src/main/resources/WebUI.zip")
|
||||
|
||||
fun shouldOverwrite(): Boolean {
|
||||
val zipPath = project.projectDir.absolutePath + "/src/main/resources/WebUI.zip"
|
||||
val zipFile = net.lingala.zip4j.ZipFile(zipPath)
|
||||
|
||||
var shouldOverwrite = true
|
||||
if (zipFile.isValidZipFile) {
|
||||
val zipRevision =
|
||||
zipFile.getInputStream(zipFile.getFileHeader("revision")).bufferedReader().use {
|
||||
it.readText().trim()
|
||||
}
|
||||
|
||||
if (zipRevision == webUIRevisionTag) {
|
||||
shouldOverwrite = false
|
||||
}
|
||||
}
|
||||
|
||||
return shouldOverwrite
|
||||
}
|
||||
|
||||
overwrite(shouldOverwrite())
|
||||
}
|
||||
|
||||
withType<LintTask> {
|
||||
source(files("src/kotlin"))
|
||||
}
|
||||
|
||||
withType<FormatTask> {
|
||||
source(files("src/kotlin"))
|
||||
register("runElectron") {
|
||||
group = "application"
|
||||
finalizedBy(run)
|
||||
doFirst {
|
||||
application.applicationDefaultJvmArgs =
|
||||
listOf(
|
||||
"-Dsuwayomi.tachidesk.config.server.webUIInterface=electron",
|
||||
// Change this to the installed electron application
|
||||
"-Dsuwayomi.tachidesk.config.server.electronPath=/usr/bin/electron",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,15 +9,11 @@ package eu.kanade.tachiyomi
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
// import android.content.res.Configuration
|
||||
// import android.support.multidex.MultiDex
|
||||
// import timber.log.Timber
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.InjektScope
|
||||
import uy.kohesive.injekt.registry.default.DefaultRegistrar
|
||||
|
||||
open class App : Application() {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
Injekt = InjektScope(DefaultRegistrar())
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package eu.kanade.tachiyomi
|
||||
|
||||
import suwayomi.tachidesk.manga.impl.util.storage.ImageUtil
|
||||
import suwayomi.tachidesk.server.generated.BuildConfig
|
||||
|
||||
/**
|
||||
* Used by extensions.
|
||||
*
|
||||
* @since extension-lib 1.3
|
||||
*/
|
||||
object AppInfo {
|
||||
/**
|
||||
*
|
||||
* should be something like 74
|
||||
*
|
||||
* @since extension-lib 1.3
|
||||
*/
|
||||
fun getVersionCode() = BuildConfig.REVISION.substring(1).toInt()
|
||||
|
||||
/**
|
||||
* should be something like "0.13.1"
|
||||
*
|
||||
* @since extension-lib 1.3
|
||||
*/
|
||||
fun getVersionName() = BuildConfig.VERSION.substring(1)
|
||||
|
||||
/**
|
||||
* A list of supported image MIME types by the reader.
|
||||
* e.g. ["image/jpeg", "image/png", ...]
|
||||
*
|
||||
* @since extension-lib 1.5
|
||||
*/
|
||||
fun getSupportedImageMimeTypes(): List<String> = ImageUtil.ImageType.entries.map { it.mime }
|
||||
}
|
||||
@@ -7,8 +7,6 @@ package eu.kanade.tachiyomi
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import android.app.Application
|
||||
import com.google.gson.Gson
|
||||
// import eu.kanade.tachiyomi.data.cache.ChapterCache
|
||||
// import eu.kanade.tachiyomi.data.cache.CoverCache
|
||||
// import eu.kanade.tachiyomi.data.database.DatabaseHelper
|
||||
@@ -17,8 +15,15 @@ import com.google.gson.Gson
|
||||
// import eu.kanade.tachiyomi.data.sync.LibrarySyncManager
|
||||
// import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
// import eu.kanade.tachiyomi.extension.ExtensionManager
|
||||
import android.app.Application
|
||||
import eu.kanade.tachiyomi.network.JavaScriptEngine
|
||||
import eu.kanade.tachiyomi.network.NetworkHelper
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.protobuf.ProtoBuf
|
||||
import nl.adaptivity.xmlutil.serialization.XML
|
||||
import org.kodein.di.DI
|
||||
import org.kodein.di.conf.global
|
||||
import org.kodein.di.instance
|
||||
import rx.Observable
|
||||
import rx.schedulers.Schedulers
|
||||
import uy.kohesive.injekt.api.InjektModule
|
||||
@@ -28,9 +33,7 @@ import uy.kohesive.injekt.api.addSingletonFactory
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
class AppModule(val app: Application) : InjektModule {
|
||||
|
||||
override fun InjektRegistrar.registerInjectables() {
|
||||
|
||||
addSingleton(app)
|
||||
|
||||
// addSingletonFactory { PreferencesHelper(app) }
|
||||
@@ -43,6 +46,8 @@ class AppModule(val app: Application) : InjektModule {
|
||||
|
||||
addSingletonFactory { NetworkHelper(app) }
|
||||
|
||||
addSingletonFactory { JavaScriptEngine(app) }
|
||||
|
||||
// addSingletonFactory { SourceManager(app).also { get<ExtensionManager>().init(it) } }
|
||||
//
|
||||
// addSingletonFactory { ExtensionManager(app) }
|
||||
@@ -53,9 +58,20 @@ class AppModule(val app: Application) : InjektModule {
|
||||
//
|
||||
// addSingletonFactory { LibrarySyncManager(app) }
|
||||
|
||||
addSingletonFactory { Gson() }
|
||||
addSingletonFactory {
|
||||
val json by DI.global.instance<Json>()
|
||||
json
|
||||
}
|
||||
|
||||
addSingletonFactory { Json { ignoreUnknownKeys = true } }
|
||||
addSingletonFactory {
|
||||
val xml by DI.global.instance<XML>()
|
||||
xml
|
||||
}
|
||||
|
||||
addSingletonFactory {
|
||||
val protobuf by DI.global.instance<ProtoBuf>()
|
||||
protobuf
|
||||
}
|
||||
|
||||
// Asynchronously init expensive components for a faster cold start
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
package eu.kanade.tachiyomi.animesource
|
||||
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||
import eu.kanade.tachiyomi.animesource.model.AnimesPage
|
||||
import rx.Observable
|
||||
|
||||
interface AnimeCatalogueSource : AnimeSource {
|
||||
|
||||
/**
|
||||
* An ISO 639-1 compliant language code (two letters in lower case).
|
||||
*/
|
||||
override val lang: String
|
||||
|
||||
/**
|
||||
* Whether the source has support for latest updates.
|
||||
*/
|
||||
val supportsLatest: Boolean
|
||||
|
||||
/**
|
||||
* Returns an observable containing a page with a list of anime.
|
||||
*
|
||||
* @param page the page number to retrieve.
|
||||
*/
|
||||
fun fetchPopularAnime(page: Int): Observable<AnimesPage>
|
||||
|
||||
/**
|
||||
* Returns an observable containing a page with a list of anime.
|
||||
*
|
||||
* @param page the page number to retrieve.
|
||||
* @param query the search query.
|
||||
* @param filters the list of filters to apply.
|
||||
*/
|
||||
fun fetchSearchAnime(page: Int, query: String, filters: AnimeFilterList): Observable<AnimesPage>
|
||||
|
||||
/**
|
||||
* Returns an observable containing a page with a list of latest anime updates.
|
||||
*
|
||||
* @param page the page number to retrieve.
|
||||
*/
|
||||
fun fetchLatestUpdates(page: Int): Observable<AnimesPage>
|
||||
|
||||
/**
|
||||
* Returns the list of filters for the source.
|
||||
*/
|
||||
fun getFilterList(): AnimeFilterList
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
package eu.kanade.tachiyomi.animesource
|
||||
|
||||
import eu.kanade.tachiyomi.animesource.model.SAnime
|
||||
import eu.kanade.tachiyomi.animesource.model.SEpisode
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import rx.Observable
|
||||
|
||||
/**
|
||||
* A basic interface for creating a source. It could be an online source, a local source, etc...
|
||||
*/
|
||||
interface AnimeSource {
|
||||
|
||||
/**
|
||||
* Id for the source. Must be unique.
|
||||
*/
|
||||
val id: Long
|
||||
|
||||
/**
|
||||
* Name of the source.
|
||||
*/
|
||||
val name: String
|
||||
|
||||
val lang: String
|
||||
get() = ""
|
||||
|
||||
/**
|
||||
* Returns an observable with the updated details for a anime.
|
||||
*
|
||||
* @param anime the anime to update.
|
||||
*/
|
||||
// @Deprecated("Use getAnimeDetails instead")
|
||||
fun fetchAnimeDetails(anime: SAnime): Observable<SAnime>
|
||||
|
||||
/**
|
||||
* Returns an observable with all the available episodes for an anime.
|
||||
*
|
||||
* @param anime the anime to update.
|
||||
*/
|
||||
// @Deprecated("Use getEpisodeList instead")
|
||||
fun fetchEpisodeList(anime: SAnime): Observable<List<SEpisode>>
|
||||
|
||||
/**
|
||||
* Returns an observable with a list of video for the episode of an anime.
|
||||
*
|
||||
* @param episode the episode to get the link for.
|
||||
*/
|
||||
// @Deprecated("Use getEpisodeList instead")
|
||||
fun fetchVideoList(episode: SEpisode): Observable<List<Video>>
|
||||
|
||||
// /**
|
||||
// * [1.x API] Get the updated details for a anime.
|
||||
// */
|
||||
// @Suppress("DEPRECATION")
|
||||
// override suspend fun getAnimeDetails(anime: AnimeInfo): AnimeInfo {
|
||||
// val sAnime = anime.toSAnime()
|
||||
// val networkAnime = fetchAnimeDetails(sAnime).awaitSingle()
|
||||
// sAnime.copyFrom(networkAnime)
|
||||
// return sAnime.toAnimeInfo()
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * [1.x API] Get all the available episodes for a anime.
|
||||
// */
|
||||
// @Suppress("DEPRECATION")
|
||||
// override suspend fun getEpisodeList(anime: AnimeInfo): List<EpisodeInfo> {
|
||||
// return fetchEpisodeList(anime.toSAnime()).awaitSingle()
|
||||
// .map { it.toEpisodeInfo() }
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * [1.x API] Get a link for the episode of an anime.
|
||||
// */
|
||||
// @Suppress("DEPRECATION")
|
||||
// override suspend fun getEpisodeLink(episode: EpisodeInfo): String {
|
||||
// return fetchEpisodeLink(episode.toSEpisode()).awaitSingle()
|
||||
// }
|
||||
}
|
||||
|
||||
// fun AnimeSource.icon(): Drawable? = Injekt.get<AnimeExtensionManager>().getAppIconForSource(this)
|
||||
|
||||
fun AnimeSource.getPreferenceKey(): String = "source_$id"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user