Compare commits
653 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 22df7e3074 | |||
| 1d5323a477 | |||
| f8d73819ea | |||
| cbe26b7291 | |||
| 93477f60c2 | |||
| 9feebbfe17 | |||
| 6e365491a9 | |||
| 2e58658129 | |||
| 256c564b91 | |||
| 96b50f52ec | |||
| 3167d8aa15 | |||
| 78fd09c728 | |||
| 4c5598cedf | |||
| c3347d94ab | |||
| 7ca4aa75a8 | |||
| 226fad5594 | |||
| d0ee1ba5af | |||
| 439e0c8284 | |||
| 7d079a8728 | |||
| 945a52653e | |||
| bdafc86990 | |||
| 57d425ab9f | |||
| 395ac8e944 | |||
| 2f801e7571 | |||
| d7636045fe | |||
| b745f10870 | |||
| d76849942c | |||
| b7a8a3ffe8 | |||
| 95d9293fe0 | |||
| 3be165a551 | |||
| cb498e2128 | |||
| 973f4d66e2 | |||
| 2c80672f6e | |||
| 2599813ef1 | |||
| 86f849a185 | |||
| 875f1f1506 | |||
| e418375963 | |||
| d528fc7f9e | |||
| 633ea97848 | |||
| 36cb899b91 | |||
| c4d849d6a3 | |||
| c8bd39b4bf | |||
| 733ba16af2 | |||
| 37f57c0c55 | |||
| 013dbd79b4 | |||
| f76d0b3258 | |||
| c2f7cdd72e | |||
| 01c37cb0ba | |||
| 0dd0af1b84 | |||
| 26aa684300 | |||
| 9669cdfb76 | |||
| 2c5e5e283e | |||
| 303921c6ea | |||
| 593291a60f | |||
| 3af8e395bd | |||
| 0b192cfa52 | |||
| fb8f20f31a | |||
| e53386cf72 | |||
| b0e9b9b307 | |||
| 789678a45d | |||
| 4ad01d3451 | |||
| 6a87daa0b3 | |||
| aebef87076 | |||
| 32ff58598f | |||
| 2d56cbe227 | |||
| fbef5f592b | |||
| 090af36f5e | |||
| 885f27fcf1 | |||
| 8dc4eaf77a | |||
| a55bef08a8 | |||
| 0dc3089739 | |||
| 789ef0d783 | |||
| 092db1106d | |||
| 5f4b5bc570 | |||
| 32581fcd5a | |||
| b14d28c406 | |||
| 1d1535dc55 | |||
| de942440e3 | |||
| b58fc39cf1 | |||
| 2e3af25dd4 | |||
| 1d541a30ae | |||
| f926714544 | |||
| f68849d3a5 | |||
| 2111232f42 | |||
| 088552bf56 | |||
| 3eabbc9770 | |||
| 8e3b8df497 | |||
| 06a5aaaa72 | |||
| 97c4f14094 | |||
| 1fa7f18235 | |||
| b309d2fd4a | |||
| 372b56bb1b | |||
| 3325a36cae | |||
| 38673bbff4 | |||
| fb51834153 | |||
| 3a932a1e8a | |||
| 53c61bcb17 | |||
| 6951b4b20d | |||
| 746f9f1a11 | |||
| 9a7344ccbe | |||
| ab2fb8747f | |||
| 9cd8cb3d54 | |||
| ba1c2845b6 | |||
| 065aa19e9e | |||
| 4c2a05c3a6 | |||
| fd45c0740c | |||
| e44bf920fa | |||
| 8a327b2dff | |||
| 6ece7e2596 | |||
| 2e2ce98be3 | |||
| fe4c2392db | |||
| 320a0971b4 | |||
| bfb70b6a05 | |||
| a68af62748 | |||
| 52bd5ce5cc | |||
| b93d486348 | |||
| d193c58e5f | |||
| 6ac2a61793 | |||
| a45c6f2197 | |||
| 71d639bf19 | |||
| 9a51472726 | |||
| 0670f298cd | |||
| aa1e98544b | |||
| fa4607e232 | |||
| cb46420c09 | |||
| d88014fa90 | |||
| 168b76cb0c | |||
| f5680c6d69 | |||
| 654a3cc7ed | |||
| 841cdc474f | |||
| 0adbea3a43 | |||
| e12bada052 | |||
| 68dbefc46f | |||
| 9d71e9b177 | |||
| 5b5801c2cf | |||
| df1cc2b8e9 | |||
| 18d399b3f7 | |||
| e9687fd182 | |||
| 79137a074c | |||
| dae55ca386 | |||
| b7f040d89a | |||
| dc69df9f4f | |||
| 6c1fbfa63b | |||
| e968a2195a | |||
| 000bcea181 | |||
| 8edf508453 | |||
| bc9cc50130 | |||
| 71091d88fc | |||
| 70c1d7e21f | |||
| c07920978e | |||
| 954b2919ac | |||
| c630f731ed | |||
| aaefa7f74e | |||
| 2ec6b471f1 | |||
| a5c5ab68d2 | |||
| fb045c501a | |||
| 6a6e411492 | |||
| 76aac330fc | |||
| 07bdf31f66 | |||
| fe14928af6 | |||
| ad0c1033a4 | |||
| 0c2448fb99 | |||
| cedda145a5 | |||
| ee73187f1a | |||
| 89f91d6800 | |||
| 6714827694 | |||
| aad73f7d19 | |||
| c5985de1c3 | |||
| 86a5b0879a | |||
| 414972d545 | |||
| 9a74ae5844 | |||
| 301980ab14 | |||
| 5dced82e5a | |||
| 9a1e4df408 | |||
| 5b08b81239 | |||
| 7fac538ba3 | |||
| ef6be74ec2 | |||
| 9f49587245 | |||
| b7b733f351 | |||
| 06bfc33e72 | |||
| fbcd55d6c5 | |||
| 2484b5f14b | |||
| 6982659658 | |||
| 9e006166a8 | |||
| 25a62e33a1 | |||
| d05ed0a56c | |||
| eaffb2755c | |||
| e0fcae2ae3 | |||
| af9ad61174 | |||
| 7c54ad54fc | |||
| aee9f1032c | |||
| f7d0605e0a | |||
| f40dcafb43 | |||
| d9cb54b285 | |||
| f738a162d3 | |||
| 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 |
@@ -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
|
||||||
@@ -26,3 +26,6 @@
|
|||||||
*.swp binary
|
*.swp binary
|
||||||
*.pdf binary
|
*.pdf binary
|
||||||
*.exe binary
|
*.exe binary
|
||||||
|
*.avif binary
|
||||||
|
*.heif binary
|
||||||
|
*.jxl binary
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
---
|
|
||||||
name: "🐞 Bug report"
|
|
||||||
title: "[Bug] <short description>"
|
|
||||||
about: "Report a bug"
|
|
||||||
labels: "bug"
|
|
||||||
---
|
|
||||||
|
|
||||||
**PLEASE READ THIS**
|
|
||||||
|
|
||||||
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 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
|
|
||||||
|
|
||||||
Note that the issue will be automatically closed if you do not fill out the title or requested information.
|
|
||||||
|
|
||||||
**DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT**
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Device information
|
|
||||||
- Tachidesk version: (Example: v0.2.3-r255-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)
|
|
||||||
- Client Operating System: <usually the same as above Server Operating System>
|
|
||||||
- Client Web Browser: (Example: Google Chrome 89.0.4389.82)
|
|
||||||
|
|
||||||
## Steps to reproduce
|
|
||||||
1. First Step
|
|
||||||
2. Second Step
|
|
||||||
|
|
||||||
### Expected behavior
|
|
||||||
Describe what should have happened. Remove this line after you are done.
|
|
||||||
|
|
||||||
### Actual behavior
|
|
||||||
Describe what happens instead. Remove this line after you are done.
|
|
||||||
|
|
||||||
## Other details
|
|
||||||
Describe additional details If necessary. Remove this line after you are done.
|
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
name: 🐞 Bug report
|
||||||
|
description: Report a bug in Suwayomi-Server
|
||||||
|
labels: [bug]
|
||||||
|
body:
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: reproduce-steps
|
||||||
|
attributes:
|
||||||
|
label: Steps to reproduce
|
||||||
|
description: Provide an example of the issue.
|
||||||
|
placeholder: |
|
||||||
|
Example:
|
||||||
|
1. First step
|
||||||
|
2. Second step
|
||||||
|
3. Issue here
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: expected-behavior
|
||||||
|
attributes:
|
||||||
|
label: Expected behavior
|
||||||
|
description: Explain what you should expect to happen.
|
||||||
|
placeholder: |
|
||||||
|
Example: "This should happen..."
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: actual-behavior
|
||||||
|
attributes:
|
||||||
|
label: Actual behavior
|
||||||
|
description: Explain what actually happens.
|
||||||
|
placeholder: |
|
||||||
|
Example: "This happened instead..."
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: suwayomi-server-version
|
||||||
|
attributes:
|
||||||
|
label: Suwayomi-Server version
|
||||||
|
description: You can find your Suwayomi-Server version in **More → About**.
|
||||||
|
placeholder: |
|
||||||
|
Example: "v2.0.1727"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: server-os
|
||||||
|
attributes:
|
||||||
|
label: Server operating system
|
||||||
|
description: The operating system on which Suwayomi-Server is running on
|
||||||
|
placeholder: |
|
||||||
|
Example: "Windows 11 Pro 24H2 | Ubuntu 24.04.2 LTS"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: server-desktop-environment
|
||||||
|
attributes:
|
||||||
|
label: Server Desktop Environment
|
||||||
|
description:
|
||||||
|
placeholder: |
|
||||||
|
Example: "Gnome 40"
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: server-jvm-version
|
||||||
|
attributes:
|
||||||
|
label: Server JVM version
|
||||||
|
description: The java version used to run Suwayomi-Server
|
||||||
|
placeholder: |
|
||||||
|
Example: "openjdk 21.0.5 2024-10-15 LTS"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: client-name
|
||||||
|
attributes:
|
||||||
|
label: Used client name
|
||||||
|
description:
|
||||||
|
placeholder: |
|
||||||
|
Example: "Suwayomi-WebUI"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: client-version
|
||||||
|
attributes:
|
||||||
|
label: Client version
|
||||||
|
description:
|
||||||
|
placeholder: |
|
||||||
|
Example: "v1.2.3"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: client-browser
|
||||||
|
attributes:
|
||||||
|
label: Used web browser
|
||||||
|
description: The browser which is used to open Suwayomi-WebUI
|
||||||
|
placeholder: |
|
||||||
|
Example: "Chrome 134.0.6998.118 (64-Bit) | FireFox 136.0.2 (64-Bit) | Electron v35.0.2"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: client-os
|
||||||
|
attributes:
|
||||||
|
label: Client operating system
|
||||||
|
description: The system on which the Suwayomi-WebUI is running on
|
||||||
|
placeholder: |
|
||||||
|
Example: "Windows 11 Pro 24H2 | Ubuntu 24.04.2 LTS"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: other-details
|
||||||
|
attributes:
|
||||||
|
label: Other details
|
||||||
|
description: The more information that gets provided the better, especially via videos and images
|
||||||
|
placeholder: |
|
||||||
|
Additional details and attachments.
|
||||||
|
|
||||||
|
- type: checkboxes
|
||||||
|
id: acknowledgements
|
||||||
|
attributes:
|
||||||
|
label: Acknowledgements
|
||||||
|
description: Read this carefully, we will close and ignore your issue if you skimmed through this.
|
||||||
|
options:
|
||||||
|
- label: I have searched the existing issues and this is a new ticket, **NOT** a duplicate or related to another open or closed issue.
|
||||||
|
required: true
|
||||||
|
- label: I have written a short but informative title (ideally less than ~100 characters).
|
||||||
|
required: true
|
||||||
|
- label: I have tried the troubleshooting guide described in [README.md](https://github.com/Suwayomi/Suwayomi-Server?tab=readme-ov-file#troubleshooting-and-support)
|
||||||
|
required: true
|
||||||
|
- label: I have updated to the **[latest version](https://github.com/suwayomi/suwayomi-server/releases/latest)**.
|
||||||
|
required: true
|
||||||
|
- label: I have filled out all of the requested information in this form, including specific version numbers.
|
||||||
|
required: true
|
||||||
|
- label: I understand that **Suwayomi does not have or fix any extensions**, and I **will not receive help** for any issues related to sources or extensions.
|
||||||
|
required: true
|
||||||
@@ -1 +1,5 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: ☎️ Support
|
||||||
|
url: https://discord.gg/DDZdqZWaHA
|
||||||
|
about: Join our discord to get help for anything that is not a bug or a feature request
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
---
|
|
||||||
name: "🌟 Feature request"
|
|
||||||
title: "[Feature Request] <short description>"
|
|
||||||
about: "Suggest a feature to improve the project"
|
|
||||||
labels: "enhancement"
|
|
||||||
---
|
|
||||||
|
|
||||||
**PLEASE READ THIS**
|
|
||||||
|
|
||||||
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 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
|
|
||||||
|
|
||||||
Note that the issue will be automatically closed if you do not fill out the title or requested information.
|
|
||||||
|
|
||||||
**DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT**
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## What feature should be added to Tachidesk?
|
|
||||||
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
|
|
||||||
Explain why this should be added. Remove this line after you are done.
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
name: 🌟 Feature request
|
||||||
|
description: Suggest a feature to improve Suwayomi-Server
|
||||||
|
labels: [enhancement]
|
||||||
|
body:
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: feature-description
|
||||||
|
attributes:
|
||||||
|
label: Describe your suggested feature
|
||||||
|
description: How can Suwayomi-Server be improved?
|
||||||
|
placeholder: |
|
||||||
|
Example:
|
||||||
|
"It should work like this..."
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: other-details
|
||||||
|
attributes:
|
||||||
|
label: Other details
|
||||||
|
placeholder: |
|
||||||
|
Additional details and attachments.
|
||||||
|
|
||||||
|
- type: checkboxes
|
||||||
|
id: acknowledgements
|
||||||
|
attributes:
|
||||||
|
label: Acknowledgements
|
||||||
|
description: Read this carefully, we will close and ignore your issue if you skimmed through this.
|
||||||
|
options:
|
||||||
|
- label: I have searched the existing issues and this is a new ticket, **NOT** a duplicate or related to another open or closed issue.
|
||||||
|
required: true
|
||||||
|
- label: I have written a short but informative title (ideally less than ~100 characters).
|
||||||
|
required: true
|
||||||
|
- label: I have updated to the **[latest version](https://github.com/suwayomi/suwayomi-server/releases/latest)**.
|
||||||
|
required: true
|
||||||
|
- label: I have filled out all of the requested information in this form, including specific version numbers.
|
||||||
|
required: true
|
||||||
@@ -3,6 +3,10 @@ name: CI Pull Request
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_wrapper:
|
check_wrapper:
|
||||||
name: Validate Gradle Wrapper
|
name: Validate Gradle Wrapper
|
||||||
@@ -10,34 +14,32 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repo
|
- name: Clone repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Validate Gradle Wrapper
|
- name: Validate Gradle Wrapper
|
||||||
uses: gradle/wrapper-validation-action@v1
|
uses: gradle/wrapper-validation-action@v3
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build pull request
|
name: Build pull request
|
||||||
needs: check_wrapper
|
needs: check_wrapper
|
||||||
if: "!startsWith(github.event.head_commit.message, '[SKIP CI]')"
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Cancel previous runs
|
|
||||||
uses: styfle/cancel-workflow-action@0.9.0
|
|
||||||
with:
|
|
||||||
access_token: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Checkout pull request
|
- name: Checkout pull request
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
path: master
|
path: master
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up JDK 1.8
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: 21
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v4
|
||||||
|
|
||||||
- name: Copy CI gradle.properties
|
- name: Copy CI gradle.properties
|
||||||
run: |
|
run: |
|
||||||
@@ -45,13 +47,7 @@ jobs:
|
|||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
||||||
|
|
||||||
|
|
||||||
- name: Build Jar
|
- name: Build Jar
|
||||||
uses: eskatos/gradle-command-action@v1
|
working-directory: master
|
||||||
with:
|
run: ./gradlew ktlintCheck :server:shadowJar --stacktrace
|
||||||
build-root-directory: master
|
|
||||||
wrapper-directory: master
|
|
||||||
arguments: :server:shadowJar --stacktrace
|
|
||||||
wrapper-cache-enabled: true
|
|
||||||
dependencies-cache-enabled: true
|
|
||||||
configuration-cache-enabled: true
|
|
||||||
|
|||||||
@@ -5,41 +5,41 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_wrapper:
|
check_wrapper:
|
||||||
name: Validate Gradle Wrapper
|
name: Validate Gradle Wrapper
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repo
|
- name: Clone repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Validate Gradle Wrapper
|
- name: Validate Gradle Wrapper
|
||||||
uses: gradle/wrapper-validation-action@v1
|
uses: gradle/wrapper-validation-action@v3
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build artifacts and deploy preview
|
name: Build Jar
|
||||||
needs: check_wrapper
|
needs: check_wrapper
|
||||||
if: "!startsWith(github.event.head_commit.message, '[SKIP CI]')"
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Cancel previous runs
|
|
||||||
uses: styfle/cancel-workflow-action@0.9.0
|
|
||||||
with:
|
|
||||||
access_token: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Checkout master branch
|
- name: Checkout master branch
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: master
|
ref: master
|
||||||
path: master
|
path: master
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up JDK 1.8
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: 21
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v4
|
||||||
|
|
||||||
- name: Copy CI gradle.properties
|
- name: Copy CI gradle.properties
|
||||||
run: |
|
run: |
|
||||||
@@ -48,42 +48,167 @@ jobs:
|
|||||||
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
||||||
|
|
||||||
- name: Build Jar
|
- name: Build Jar
|
||||||
uses: eskatos/gradle-command-action@v1
|
|
||||||
env:
|
env:
|
||||||
ProductBuildType: "Preview"
|
ProductBuildType: "Preview"
|
||||||
|
working-directory: master
|
||||||
|
run: ./gradlew :server:shadowJar --stacktrace
|
||||||
|
|
||||||
|
- name: Upload Jar
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
build-root-directory: master
|
name: jar
|
||||||
wrapper-directory: master
|
path: master/server/build/*.jar
|
||||||
arguments: :server:shadowJar --stacktrace
|
if-no-files-found: error
|
||||||
wrapper-cache-enabled: true
|
|
||||||
dependencies-cache-enabled: true
|
- name: Upload icons
|
||||||
configuration-cache-enabled: true
|
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
|
||||||
|
|
||||||
|
jlink:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
name: linux-x64
|
||||||
|
- os: windows-latest
|
||||||
|
name: windows-x64
|
||||||
|
- os: macos-14
|
||||||
|
name: macOS-arm64
|
||||||
|
- os: macos-13
|
||||||
|
name: macOS-x64
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-14, macos-13]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Set up JDK
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: 21
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
|
- name: Package JDK
|
||||||
|
run: jlink --add-modules java.base,java.compiler,java.datatransfer,java.desktop,java.instrument,java.logging,java.management,java.naming,java.prefs,java.scripting,java.se,java.security.jgss,java.security.sasl,java.sql,java.transaction.xa,java.xml,jdk.attach,jdk.crypto.ec,jdk.jdi,jdk.management,jdk.net,jdk.random,jdk.unsupported,jdk.unsupported.desktop,jdk.zipfs --output suwa --strip-debug --no-man-pages --no-header-files --compress=2
|
||||||
|
|
||||||
|
- name: Upload JRE package
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.name }}-jre
|
||||||
|
path: suwa
|
||||||
|
|
||||||
|
bundle:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- debian-all
|
||||||
|
- linux-assets
|
||||||
|
- linux-x64
|
||||||
|
- macOS-x64
|
||||||
|
- macOS-arm64
|
||||||
|
- windows-x64
|
||||||
|
|
||||||
|
name: Make ${{ matrix.os }} release
|
||||||
|
needs: [build,jlink]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Download Jar
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: jar
|
||||||
|
path: server/build
|
||||||
|
|
||||||
|
- name: Download JRE
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
if: matrix.os != 'linux-assets' && matrix.os != 'debian-all'
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.os }}-jre
|
||||||
|
path: jre
|
||||||
|
|
||||||
|
- 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: |
|
||||||
|
mkdir upload
|
||||||
|
tar -xvpf scripts.tar.gz
|
||||||
|
scripts/bundler.sh -o upload/ ${{ matrix.os }}
|
||||||
|
|
||||||
|
- name: Upload ${{ matrix.os }} release
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.os }}
|
||||||
|
path: upload/*
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
release:
|
||||||
|
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
|
||||||
|
|
||||||
|
- name: Checkout Preview branch
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: "Suwayomi/Suwayomi-Server-preview"
|
||||||
|
ref: main
|
||||||
|
path: preview
|
||||||
|
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
|
||||||
|
|
||||||
- name: Generate Tag Name
|
- name: Generate Tag Name
|
||||||
id: GenTagName
|
id: GenTagName
|
||||||
run: |
|
run: |
|
||||||
cd master/server/build
|
cd release
|
||||||
genTag=$(ls *.jar | sed -e's/Tachidesk-Server-\|.jar//g')
|
genTag=$(ls *.jar | sed -e's/Suwayomi-Server-\|.jar//g')
|
||||||
echo "$genTag"
|
echo "$genTag"
|
||||||
echo "::set-output name=value::$genTag"
|
echo "value=$genTag" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: make bundle packages
|
|
||||||
run: |
|
|
||||||
cd master/scripts
|
|
||||||
./windows-bundler.sh win32
|
|
||||||
./windows-bundler.sh win64
|
|
||||||
./unix-bundler.sh linux-x64
|
|
||||||
./debian-packager.sh
|
|
||||||
./unix-bundler.sh macOS-x64
|
|
||||||
./unix-bundler.sh macOS-arm64
|
|
||||||
|
|
||||||
- name: Checkout preview branch
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
repository: 'Suwayomi/Tachidesk-Server-preview'
|
|
||||||
ref: main
|
|
||||||
path: preview
|
|
||||||
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
|
|
||||||
|
|
||||||
- name: Create Tag
|
- name: Create Tag
|
||||||
run: |
|
run: |
|
||||||
@@ -92,7 +217,8 @@ jobs:
|
|||||||
cd preview
|
cd preview
|
||||||
echo "{ \"latest\": \"$TAG\" }" > index.json
|
echo "{ \"latest\": \"$TAG\" }" > index.json
|
||||||
git add 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 config --global user.name "github-actions[bot]"
|
||||||
git commit -m "Updated to $TAG"
|
git commit -m "Updated to $TAG"
|
||||||
git push origin main
|
git push origin main
|
||||||
@@ -101,10 +227,10 @@ jobs:
|
|||||||
git push origin $TAG
|
git push origin $TAG
|
||||||
|
|
||||||
- name: Upload Preview Release
|
- name: Upload Preview Release
|
||||||
uses: ncipollo/release-action@v1
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
|
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
|
||||||
artifacts: "master/server/build/*.jar,master/server/build/*.msi,master/server/build/*.zip,master/server/build/*.tar.gz,master/server/build/*.deb"
|
repository: "Suwayomi/Suwayomi-Server-preview"
|
||||||
owner: "Suwayomi"
|
tag_name: ${{ steps.GenTagName.outputs.value }}
|
||||||
repo: "Tachidesk-Server-preview"
|
files: release/*
|
||||||
tag: ${{ steps.GenTagName.outputs.value }}
|
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
name: Issue closer
|
|
||||||
|
|
||||||
on:
|
|
||||||
issues:
|
|
||||||
types: [opened, edited, reopened]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
autoclose:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Autoclose issues
|
|
||||||
uses: arkon/issue-closer-action@v3.0
|
|
||||||
with:
|
|
||||||
repo-token: ${{ github.token }}
|
|
||||||
rules: |
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"type": "title",
|
|
||||||
"regex": ".*<short description>*",
|
|
||||||
"message": "You did not fill out the description in the title"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "body",
|
|
||||||
"regex": ".*DELETE THIS SECTION IF YOU HAVE READ AND ACKNOWLEDGED IT.*",
|
|
||||||
"message": "The acknowledgment section was not removed"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "body",
|
|
||||||
"regex": "(Tachidesk 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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "body",
|
|
||||||
"regex": ".*Remove this line after you are done.*",
|
|
||||||
"message": "The lines requesting to be removed were not removed."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
+167
-38
@@ -1,79 +1,208 @@
|
|||||||
name: CI Publish
|
name: CI Publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_wrapper:
|
check_wrapper:
|
||||||
name: Validate Gradle Wrapper
|
name: Validate Gradle Wrapper
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repo
|
- name: Clone repo
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Validate Gradle Wrapper
|
- name: Validate Gradle Wrapper
|
||||||
uses: gradle/wrapper-validation-action@v1
|
uses: gradle/wrapper-validation-action@v3
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build artifacts and release
|
name: Build Jar
|
||||||
needs: check_wrapper
|
needs: check_wrapper
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Cancel previous runs
|
|
||||||
uses: styfle/cancel-workflow-action@0.9.0
|
|
||||||
with:
|
|
||||||
access_token: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Checkout ${{ github.ref }}
|
- name: Checkout ${{ github.ref }}
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.ref }}
|
ref: ${{ github.ref }}
|
||||||
path: master
|
path: master
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up JDK 1.8
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: 21
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v4
|
||||||
|
|
||||||
- name: Copy CI gradle.properties
|
- name: Copy CI gradle.properties
|
||||||
run: |
|
run: |
|
||||||
cd master
|
cd master
|
||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
cp .github/runner-files/ci-gradle.properties \
|
||||||
|
~/.gradle/gradle.properties
|
||||||
|
|
||||||
- name: Build and copy webUI, Build Jar
|
- name: Build and copy webUI, Build Jar
|
||||||
uses: eskatos/gradle-command-action@v1
|
|
||||||
env:
|
env:
|
||||||
ProductBuildType: "Stable"
|
ProductBuildType: "Stable"
|
||||||
with:
|
working-directory: master
|
||||||
build-root-directory: master
|
run: ./gradlew :server:downloadWebUI :server:shadowJar --stacktrace
|
||||||
wrapper-directory: master
|
|
||||||
arguments: :server:downloadWebUI :server:shadowJar --stacktrace
|
|
||||||
wrapper-cache-enabled: true
|
|
||||||
dependencies-cache-enabled: true
|
|
||||||
configuration-cache-enabled: true
|
|
||||||
|
|
||||||
- name: Make bundle packages
|
- name: Upload Jar
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: jar
|
||||||
|
path: master/server/build/*.jar
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
jlink:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
name: linux-x64
|
||||||
|
- os: windows-latest
|
||||||
|
name: windows-x64
|
||||||
|
- os: macos-14
|
||||||
|
name: macOS-arm64
|
||||||
|
- os: macos-13
|
||||||
|
name: macOS-x64
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-14, macos-13]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Set up JDK
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: 21
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
|
- name: Package JDK
|
||||||
|
run: jlink --add-modules java.base,java.compiler,java.datatransfer,java.desktop,java.instrument,java.logging,java.management,java.naming,java.prefs,java.scripting,java.se,java.security.jgss,java.security.sasl,java.sql,java.transaction.xa,java.xml,jdk.attach,jdk.crypto.ec,jdk.jdi,jdk.management,jdk.net,jdk.random,jdk.unsupported,jdk.unsupported.desktop,jdk.zipfs --output suwa --strip-debug --no-man-pages --no-header-files --compress=2
|
||||||
|
|
||||||
|
- name: Upload JDK package
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.name }}-jre
|
||||||
|
path: suwa
|
||||||
|
|
||||||
|
bundle:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- debian-all
|
||||||
|
- linux-assets
|
||||||
|
- linux-x64
|
||||||
|
- macOS-x64
|
||||||
|
- macOS-arm64
|
||||||
|
- windows-x64
|
||||||
|
|
||||||
|
name: Make ${{ matrix.os }} release
|
||||||
|
needs: [build, jlink]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Download Jar
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: jar
|
||||||
|
path: server/build
|
||||||
|
|
||||||
|
- name: Download JRE
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
if: matrix.os != 'linux-assets' && matrix.os != 'debian-all'
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.os }}-jre
|
||||||
|
path: jre
|
||||||
|
|
||||||
|
- 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: |
|
run: |
|
||||||
cd master/scripts
|
mkdir upload/
|
||||||
./windows-bundler.sh win32
|
tar -xvpf scripts.tar.gz
|
||||||
./windows-bundler.sh win64
|
scripts/bundler.sh -o upload/ ${{ matrix.os }}
|
||||||
./unix-bundler.sh linux-x64
|
|
||||||
./debian-packager.sh
|
|
||||||
./unix-bundler.sh macOS-x64
|
|
||||||
./unix-bundler.sh macOS-arm64
|
|
||||||
|
|
||||||
- name: Upload Release
|
- name: Upload ${{ matrix.os }} files
|
||||||
uses: xresloader/upload-to-github-release@v1
|
uses: actions/upload-artifact@v4
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
with:
|
||||||
file: "master/server/build/*.jar;master/server/build/*.msi;master/server/build/*.zip;master/server/build/*.tar.gz;master/server/build/*.deb"
|
name: ${{ matrix.os }}
|
||||||
tags: true
|
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
|
||||||
|
|
||||||
|
- name: Generate checksums
|
||||||
|
run: cd release && sha256sum * > Checksums.sha256
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.DEPLOY_RELEASE_TOKEN }}
|
||||||
draft: true
|
draft: true
|
||||||
verbose: 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 }}
|
||||||
+2
-1
@@ -2,9 +2,10 @@
|
|||||||
.gradle
|
.gradle
|
||||||
.idea
|
.idea
|
||||||
gradle.properties
|
gradle.properties
|
||||||
|
.fleet
|
||||||
# But we need these
|
# But we need these
|
||||||
!.idea/runConfigurations
|
!.idea/runConfigurations
|
||||||
|
.kotlin
|
||||||
|
|
||||||
# Ignore Gradle build output directory
|
# Ignore Gradle build output directory
|
||||||
build
|
build
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
plugins {
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,6 +15,6 @@ val ApplicationRootDir: String
|
|||||||
get(): String {
|
get(): String {
|
||||||
return System.getProperty(
|
return System.getProperty(
|
||||||
"$CONFIG_PREFIX.server.rootDir",
|
"$CONFIG_PREFIX.server.rootDir",
|
||||||
AppDirsFactory.getInstance().getUserDataDir("Tachidesk", null, null)
|
AppDirsFactory.getInstance().getUserDataDir("Tachidesk", null, null),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
package xyz.nulldev.ts.config
|
|
||||||
|
|
||||||
import org.kodein.di.DI
|
|
||||||
import org.kodein.di.bind
|
|
||||||
import org.kodein.di.singleton
|
|
||||||
|
|
||||||
class ConfigKodeinModule {
|
|
||||||
fun create() = DI.Module("ConfigManager") {
|
|
||||||
// Config module
|
|
||||||
bind<ConfigManager>() with singleton { GlobalConfigManager }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -10,22 +10,31 @@ package xyz.nulldev.ts.config
|
|||||||
import ch.qos.logback.classic.Level
|
import ch.qos.logback.classic.Level
|
||||||
import com.typesafe.config.Config
|
import com.typesafe.config.Config
|
||||||
import com.typesafe.config.ConfigFactory
|
import com.typesafe.config.ConfigFactory
|
||||||
import com.typesafe.config.ConfigRenderOptions
|
import com.typesafe.config.ConfigValue
|
||||||
import mu.KotlinLogging
|
import com.typesafe.config.ConfigValueFactory
|
||||||
|
import com.typesafe.config.parser.ConfigDocument
|
||||||
|
import com.typesafe.config.parser.ConfigDocumentFactory
|
||||||
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
|
import kotlinx.coroutines.sync.Mutex
|
||||||
|
import kotlinx.coroutines.sync.withLock
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages app config.
|
* Manages app config.
|
||||||
*/
|
*/
|
||||||
open class ConfigManager {
|
open class ConfigManager {
|
||||||
|
val logger = KotlinLogging.logger {}
|
||||||
private val generatedModules = mutableMapOf<Class<out ConfigModule>, ConfigModule>()
|
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>
|
val loadedModules: Map<Class<out ConfigModule>, ConfigModule>
|
||||||
get() = generatedModules
|
get() = generatedModules
|
||||||
|
|
||||||
val logger = KotlinLogging.logger {}
|
private val mutex = Mutex()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a config module
|
* Get a config module
|
||||||
@@ -38,6 +47,11 @@ open class ConfigManager {
|
|||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
fun <T : ConfigModule> module(type: Class<T>): T = loadedModules[type] as T
|
fun <T : ConfigModule> module(type: Class<T>): T = loadedModules[type] as T
|
||||||
|
|
||||||
|
private fun getUserConfig(): Config =
|
||||||
|
userConfigFile.let {
|
||||||
|
ConfigFactory.parseFile(it)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load configs
|
* Load configs
|
||||||
*/
|
*/
|
||||||
@@ -48,30 +62,26 @@ open class ConfigManager {
|
|||||||
val baseConfig =
|
val baseConfig =
|
||||||
ConfigFactory.parseMap(
|
ConfigFactory.parseMap(
|
||||||
mapOf(
|
mapOf(
|
||||||
"androidcompat.rootDir" to "$ApplicationRootDir/android-compat" // override AndroidCompat's rootDir
|
// override AndroidCompat's rootDir
|
||||||
)
|
"androidcompat.rootDir" to "$ApplicationRootDir/android-compat",
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
// Load user config
|
// Load user config
|
||||||
val userConfig =
|
val userConfig = getUserConfig()
|
||||||
File(ApplicationRootDir, "server.conf").let {
|
|
||||||
ConfigFactory.parseFile(it)
|
|
||||||
}
|
|
||||||
|
|
||||||
val config = ConfigFactory.empty()
|
val config =
|
||||||
.withFallback(baseConfig)
|
ConfigFactory
|
||||||
.withFallback(userConfig)
|
.empty()
|
||||||
.withFallback(compatConfig)
|
.withFallback(baseConfig)
|
||||||
.withFallback(serverConfig)
|
.withFallback(userConfig)
|
||||||
.resolve()
|
.withFallback(compatConfig)
|
||||||
|
.withFallback(serverConfig)
|
||||||
|
.resolve()
|
||||||
|
|
||||||
// set log level early
|
// set log level early
|
||||||
if (debugLogsEnabled(config)) {
|
if (debugLogsEnabled(config)) {
|
||||||
setLogLevel(Level.DEBUG)
|
setLogLevelFor(BASE_LOGGER_NAME, Level.DEBUG)
|
||||||
}
|
|
||||||
|
|
||||||
logger.debug {
|
|
||||||
"Loaded config:\n" + config.root().render(ConfigRenderOptions.concise().setFormatted(true))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return config
|
return config
|
||||||
@@ -86,6 +96,73 @@ open class ConfigManager {
|
|||||||
registerModule(it)
|
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()
|
object GlobalConfigManager : ConfigManager()
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package xyz.nulldev.ts.config
|
||||||
|
|
||||||
|
import org.koin.core.module.Module
|
||||||
|
import org.koin.dsl.module
|
||||||
|
|
||||||
|
fun configManagerModule(): Module =
|
||||||
|
module {
|
||||||
|
single<ConfigManager> { GlobalConfigManager }
|
||||||
|
}
|
||||||
@@ -8,6 +8,8 @@ package xyz.nulldev.ts.config
|
|||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import com.typesafe.config.Config
|
import com.typesafe.config.Config
|
||||||
|
import com.typesafe.config.ConfigFactory
|
||||||
|
import com.typesafe.config.ConfigValueFactory
|
||||||
import io.github.config4k.getValue
|
import io.github.config4k.getValue
|
||||||
import kotlin.reflect.KProperty
|
import kotlin.reflect.KProperty
|
||||||
|
|
||||||
@@ -15,28 +17,47 @@ import kotlin.reflect.KProperty
|
|||||||
* Abstract config module.
|
* Abstract config module.
|
||||||
*/
|
*/
|
||||||
@Suppress("UNUSED_PARAMETER")
|
@Suppress("UNUSED_PARAMETER")
|
||||||
abstract class ConfigModule(config: Config)
|
abstract class ConfigModule(
|
||||||
|
getConfig: () -> Config,
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract jvm-commandline-argument-overridable config module.
|
* Abstract jvm-commandline-argument-overridable config module.
|
||||||
*/
|
*/
|
||||||
abstract class SystemPropertyOverridableConfigModule(config: Config, moduleName: String) : ConfigModule(config) {
|
abstract class SystemPropertyOverridableConfigModule(
|
||||||
val overridableConfig = SystemPropertyOverrideDelegate(config, moduleName)
|
getConfig: () -> Config,
|
||||||
|
moduleName: String,
|
||||||
|
) : ConfigModule(getConfig) {
|
||||||
|
val overridableConfig = SystemPropertyOverrideDelegate(getConfig, moduleName)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Defines a config property that is overridable with jvm `-D` commandline arguments prefixed with [CONFIG_PREFIX] */
|
/** Defines a config property that is overridable with jvm `-D` commandline arguments prefixed with [CONFIG_PREFIX] */
|
||||||
class SystemPropertyOverrideDelegate(val config: Config, val moduleName: String) {
|
class SystemPropertyOverrideDelegate(
|
||||||
inline operator fun <R, reified T> getValue(thisRef: R, property: KProperty<*>): T {
|
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 configValue: T = config.getValue(thisRef, property)
|
||||||
|
|
||||||
val combined = System.getProperty(
|
val combined =
|
||||||
"$CONFIG_PREFIX.$moduleName.${property.name}",
|
System.getProperty(
|
||||||
configValue.toString()
|
"$CONFIG_PREFIX.$moduleName.${property.name}",
|
||||||
)
|
if (T::class.simpleName == "List") {
|
||||||
|
ConfigValueFactory.fromAnyRef(configValue).render()
|
||||||
|
} else {
|
||||||
|
configValue.toString()
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
return when (T::class.simpleName) {
|
return when (T::class.simpleName) {
|
||||||
"Int" -> combined.toInt()
|
"Int" -> combined.toInt()
|
||||||
"Boolean" -> combined.toBoolean()
|
"Boolean" -> combined.toBoolean()
|
||||||
|
"Double" -> combined.toDouble()
|
||||||
|
"List" -> ConfigFactory.parseString("internal=" + combined).getStringList("internal").orEmpty()
|
||||||
// add more types as needed
|
// add more types as needed
|
||||||
else -> combined // covers String
|
else -> combined // covers String
|
||||||
} as T
|
} as T
|
||||||
|
|||||||
@@ -8,12 +8,131 @@ package xyz.nulldev.ts.config
|
|||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
import ch.qos.logback.classic.Level
|
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 com.typesafe.config.Config
|
||||||
import mu.KotlinLogging
|
import io.github.oshai.kotlinlogging.DelegatingKLogger
|
||||||
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import org.slf4j.Logger
|
import org.slf4j.Logger
|
||||||
|
import org.slf4j.LoggerFactory
|
||||||
|
|
||||||
fun setLogLevel(level: Level) {
|
private fun fileSizeValueOfOrDefault(
|
||||||
(KotlinLogging.logger(Logger.ROOT_LOGGER_NAME).underlyingLogger as ch.qos.logback.classic.Logger).level = level
|
fileSizeStr: String,
|
||||||
|
default: String,
|
||||||
|
): FileSize =
|
||||||
|
try {
|
||||||
|
FileSize.valueOf(fileSizeStr)
|
||||||
|
} catch (e: IllegalArgumentException) {
|
||||||
|
FileSize.valueOf(default)
|
||||||
|
}
|
||||||
|
|
||||||
|
private const val FILE_APPENDER_NAME = "SuwayomiDefaultAppender"
|
||||||
|
|
||||||
|
private fun createRollingFileAppender(
|
||||||
|
logContext: LoggerContext,
|
||||||
|
logDirPath: String,
|
||||||
|
maxFiles: Int,
|
||||||
|
maxFileSize: String,
|
||||||
|
maxTotalSize: 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_APPENDER_NAME
|
||||||
|
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"
|
||||||
|
maxHistory = maxFiles.coerceAtLeast(0)
|
||||||
|
setMaxFileSize(fileSizeValueOfOrDefault(maxFileSize, "10mb"))
|
||||||
|
setTotalSizeCap(fileSizeValueOfOrDefault(maxTotalSize, "100mb"))
|
||||||
|
start()
|
||||||
|
}
|
||||||
|
|
||||||
|
appender.rollingPolicy = rollingPolicy
|
||||||
|
appender.start()
|
||||||
|
|
||||||
|
return appender
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getBaseLogger(): ch.qos.logback.classic.Logger =
|
||||||
|
((KotlinLogging.logger(Logger.ROOT_LOGGER_NAME) as DelegatingKLogger<*>).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,
|
||||||
|
maxFiles: Int,
|
||||||
|
maxFileSize: String,
|
||||||
|
maxTotalSize: 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", maxFiles, maxFileSize, maxTotalSize))
|
||||||
|
|
||||||
|
// set "kotlin exposed" log level
|
||||||
|
setLogLevelFor("Exposed", Level.ERROR)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updateFileAppender(
|
||||||
|
maxFiles: Int,
|
||||||
|
maxFileSize: String,
|
||||||
|
maxTotalSize: String,
|
||||||
|
) {
|
||||||
|
val logger = getBaseLogger()
|
||||||
|
|
||||||
|
val appender = logger.getAppender(FILE_APPENDER_NAME) as RollingFileAppender<*>? ?: return
|
||||||
|
val rollingPolicy = appender.rollingPolicy as SizeAndTimeBasedRollingPolicy<*>
|
||||||
|
rollingPolicy.apply {
|
||||||
|
maxHistory = maxFiles
|
||||||
|
setMaxFileSize(FileSize.valueOf(maxFileSize))
|
||||||
|
setTotalSizeCap(FileSize.valueOf(maxTotalSize))
|
||||||
|
|
||||||
|
rollingPolicy.stop()
|
||||||
|
appender.stop()
|
||||||
|
|
||||||
|
rollingPolicy.start()
|
||||||
|
appender.start()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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) =
|
fun debugLogsEnabled(config: Config) =
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ package xyz.nulldev.ts.config.util
|
|||||||
|
|
||||||
import com.typesafe.config.Config
|
import com.typesafe.config.Config
|
||||||
|
|
||||||
operator fun Config.get(key: String) = getString(key)
|
operator fun Config.get(key: String) =
|
||||||
?: throw IllegalStateException("Could not find value for config entry: $key!")
|
getString(key)
|
||||||
|
?: throw IllegalStateException("Could not find value for config entry: $key!")
|
||||||
|
|||||||
@@ -1,28 +1,50 @@
|
|||||||
|
plugins {
|
||||||
|
id(
|
||||||
|
libs.plugins.kotlin.jvm
|
||||||
|
.get()
|
||||||
|
.pluginId,
|
||||||
|
)
|
||||||
|
id(
|
||||||
|
libs.plugins.kotlin.serialization
|
||||||
|
.get()
|
||||||
|
.pluginId,
|
||||||
|
)
|
||||||
|
id(
|
||||||
|
libs.plugins.ktlint
|
||||||
|
.get()
|
||||||
|
.pluginId,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
// Shared
|
||||||
|
implementation(libs.bundles.shared)
|
||||||
|
testImplementation(libs.bundles.sharedTest)
|
||||||
|
|
||||||
// Android stub library
|
// Android stub library
|
||||||
implementation("com.github.Suwayomi:android-jar:1.0.0")
|
implementation(libs.android.stubs)
|
||||||
|
|
||||||
// XML
|
// XML
|
||||||
compileOnly("xmlpull:xmlpull:1.1.3.4a")
|
compileOnly(libs.xmlpull)
|
||||||
|
|
||||||
// Config API
|
// Config API
|
||||||
implementation(project(":AndroidCompat:Config"))
|
implementation(projects.androidCompat.config)
|
||||||
|
|
||||||
// APK sig verifier
|
// APK sig verifier
|
||||||
compileOnly("com.android.tools.build:apksig:7.1.0-beta05")
|
compileOnly(libs.apksig)
|
||||||
|
|
||||||
// AndroidX annotations
|
// AndroidX annotations
|
||||||
compileOnly("androidx.annotation:annotation:1.3.0")
|
compileOnly(libs.android.annotations)
|
||||||
|
|
||||||
// substitute for duktape-android
|
// substitute for duktape-android/quickjs
|
||||||
implementation("org.mozilla:rhino-runtime:1.7.14") // slimmer version of 'org.mozilla:rhino'
|
implementation(libs.bundles.polyglot)
|
||||||
implementation("org.mozilla:rhino-engine:1.7.14") // provides the same interface as 'javax.script' a.k.a Nashorn
|
|
||||||
|
|
||||||
// Kotlin wrapper around Java Preferences, makes certain things easier
|
// Kotlin wrapper around Java Preferences, makes certain things easier
|
||||||
val multiplatformSettingsVersion = "0.8.1"
|
implementation(libs.bundles.settings)
|
||||||
implementation("com.russhwolf:multiplatform-settings-jvm:$multiplatformSettingsVersion")
|
|
||||||
implementation("com.russhwolf:multiplatform-settings-serialization-jvm:$multiplatformSettingsVersion")
|
|
||||||
|
|
||||||
// Android version of SimpleDateFormat
|
// Android version of SimpleDateFormat
|
||||||
implementation("com.ibm.icu:icu4j:70.1")
|
implementation(libs.icu4j)
|
||||||
|
|
||||||
|
// OpenJDK lacks native JPEG encoder and native WEBP decoder
|
||||||
|
implementation(libs.bundles.twelvemonkeys)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import android.os.IBinder;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import kotlin.NotImplementedError;
|
import kotlin.NotImplementedError;
|
||||||
import xyz.nulldev.androidcompat.service.ServiceSupport;
|
import xyz.nulldev.androidcompat.service.ServiceSupport;
|
||||||
import xyz.nulldev.androidcompat.util.KodeinGlobalHelper;
|
import xyz.nulldev.androidcompat.util.KoinGlobalHelper;
|
||||||
|
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
@@ -299,7 +299,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||||||
*/
|
*/
|
||||||
public abstract class Service extends ContextWrapper implements ComponentCallbacks2 {
|
public abstract class Service extends ContextWrapper implements ComponentCallbacks2 {
|
||||||
|
|
||||||
private static final ServiceSupport serviceSupport = KodeinGlobalHelper.instance(ServiceSupport.class);
|
private static final ServiceSupport serviceSupport = KoinGlobalHelper.instance(ServiceSupport.class);
|
||||||
|
|
||||||
private static final String TAG = "Service";
|
private static final String TAG = "Service";
|
||||||
/**
|
/**
|
||||||
@@ -328,7 +328,7 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac
|
|||||||
public Service() {
|
public Service() {
|
||||||
//==================[THIS LINE MODIFIED FROM ANDROID SOURCE!]==================
|
//==================[THIS LINE MODIFIED FROM ANDROID SOURCE!]==================
|
||||||
//Service must be initialized with a base context!
|
//Service must be initialized with a base context!
|
||||||
super(KodeinGlobalHelper.instance(Context.class));
|
super(KoinGlobalHelper.instance(Context.class));
|
||||||
}
|
}
|
||||||
/** Return the application that owns this service. */
|
/** Return the application that owns this service. */
|
||||||
public final Application getApplication() {
|
public final Application getApplication() {
|
||||||
|
|||||||
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package android.os;
|
package android.os;
|
||||||
|
|
||||||
import xyz.nulldev.androidcompat.io.AndroidFiles;
|
import xyz.nulldev.androidcompat.io.AndroidFiles;
|
||||||
import xyz.nulldev.androidcompat.util.KodeinGlobalHelper;
|
import xyz.nulldev.androidcompat.util.KoinGlobalHelper;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ import java.io.File;
|
|||||||
* Android compatibility layer for files
|
* Android compatibility layer for files
|
||||||
*/
|
*/
|
||||||
public class Environment {
|
public class Environment {
|
||||||
private static AndroidFiles androidFiles = KodeinGlobalHelper.instance(AndroidFiles.class);
|
private static AndroidFiles androidFiles = KoinGlobalHelper.instance(AndroidFiles.class);
|
||||||
|
|
||||||
public static String DIRECTORY_ALARMS = getHomeDirectory("Alarms").getAbsolutePath();
|
public static String DIRECTORY_ALARMS = getHomeDirectory("Alarms").getAbsolutePath();
|
||||||
public static String DIRECTORY_DCIM = getHomeDirectory("DCIM").getAbsolutePath();
|
public static String DIRECTORY_DCIM = getHomeDirectory("DCIM").getAbsolutePath();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class PreferenceManager {
|
|||||||
fun getDefaultSharedPreferences(context: Context) =
|
fun getDefaultSharedPreferences(context: Context) =
|
||||||
context.getSharedPreferences(
|
context.getSharedPreferences(
|
||||||
context.applicationInfo.packageName,
|
context.applicationInfo.packageName,
|
||||||
Context.MODE_PRIVATE
|
Context.MODE_PRIVATE,
|
||||||
)!!
|
)!!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ package android.text;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jsoup.Jsoup;
|
import org.jsoup.Jsoup;
|
||||||
import org.jsoup.safety.Whitelist;
|
import org.jsoup.safety.Safelist;
|
||||||
import org.xml.sax.XMLReader;
|
import org.xml.sax.XMLReader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -18,7 +18,7 @@ import org.xml.sax.XMLReader;
|
|||||||
public class Html {
|
public class Html {
|
||||||
|
|
||||||
public static Spanned fromHtml(String source) {
|
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) {
|
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" })
|
||||||
|
}
|
||||||
@@ -22,6 +22,7 @@ public class Preference {
|
|||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
protected Context context;
|
protected Context context;
|
||||||
|
|
||||||
|
private boolean isVisible;
|
||||||
private String key;
|
private String key;
|
||||||
private CharSequence title;
|
private CharSequence title;
|
||||||
private CharSequence summary;
|
private CharSequence summary;
|
||||||
@@ -100,6 +101,14 @@ public class Preference {
|
|||||||
return sharedPreferences;
|
return sharedPreferences;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setVisible(boolean visible) {
|
||||||
|
isVisible = visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getVisible() {
|
||||||
|
return isVisible;
|
||||||
|
}
|
||||||
|
|
||||||
/** Tachidesk specific API */
|
/** Tachidesk specific API */
|
||||||
public void setSharedPreferences(SharedPreferences sharedPreferences) {
|
public void setSharedPreferences(SharedPreferences sharedPreferences) {
|
||||||
this.sharedPreferences = sharedPreferences;
|
this.sharedPreferences = sharedPreferences;
|
||||||
|
|||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package app.cash.quickjs;
|
||||||
|
|
||||||
|
import org.graalvm.polyglot.*;
|
||||||
|
|
||||||
|
import java.io.Closeable;
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
public final class QuickJs implements Closeable {
|
||||||
|
private Context context;
|
||||||
|
|
||||||
|
public static QuickJs create() {
|
||||||
|
return new QuickJs();
|
||||||
|
}
|
||||||
|
|
||||||
|
public QuickJs() {
|
||||||
|
this.context = Context
|
||||||
|
.newBuilder("js")
|
||||||
|
.allowHostAccess(HostAccess.ALL)
|
||||||
|
.allowPolyglotAccess(PolyglotAccess.NONE)
|
||||||
|
.allowHostClassLoading(false)
|
||||||
|
.build();
|
||||||
|
context.enter();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object evaluate(String script, String ignoredFileName) {
|
||||||
|
return this.evaluate(script);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object evaluate(String script) {
|
||||||
|
try {
|
||||||
|
Value value = context.eval("js", script);
|
||||||
|
return translateType(value);
|
||||||
|
} catch (Exception exception) {
|
||||||
|
throw new QuickJsException(exception.getMessage(), exception);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Object translateType(Value obj) {
|
||||||
|
if (obj.isBoolean()) {
|
||||||
|
return obj.asBoolean();
|
||||||
|
} else if (obj.hasArrayElements()) {
|
||||||
|
if (obj.getArraySize() == 0) {
|
||||||
|
return new int[0];
|
||||||
|
} else {
|
||||||
|
Value element = obj.getArrayElement(0);
|
||||||
|
if (element.isBoolean()) {
|
||||||
|
return obj.as(boolean[].class);
|
||||||
|
} else if (element.isNumber()) {
|
||||||
|
if (element.fitsInInt()) {
|
||||||
|
return obj.as(int[].class);
|
||||||
|
} else if (element.fitsInBigInteger()) {
|
||||||
|
return Arrays.stream(obj.as(BigInteger[].class)).map(BigInteger::longValue).toArray();
|
||||||
|
} else {
|
||||||
|
return obj.as(double[].class);
|
||||||
|
}
|
||||||
|
} else if (element.isHostObject()) {
|
||||||
|
return obj.as(Object[].class);
|
||||||
|
} else if (element.isString()) {
|
||||||
|
return obj.as(String[].class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (obj.isNumber()) {
|
||||||
|
if (obj.fitsInInt()) {
|
||||||
|
return obj.asInt();
|
||||||
|
} else if (obj.fitsInBigInteger()) {
|
||||||
|
return obj.asBigInteger().longValue();
|
||||||
|
} else {
|
||||||
|
return obj.asDouble();
|
||||||
|
}
|
||||||
|
} else if (obj.isHostObject()) {
|
||||||
|
return obj.asHostObject();
|
||||||
|
} else if (obj.isString()) {
|
||||||
|
return obj.asString();
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] compile(String sourceCode, String ignoredFileName) {
|
||||||
|
return sourceCode.getBytes();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object execute(byte[] bytecode) {
|
||||||
|
return this.evaluate(new String(bytecode));
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> void set(String name, Class<T> ignoredType, T object) {
|
||||||
|
context.getBindings("js").putMember(name, object);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void close() {
|
||||||
|
if (this.context != null) {
|
||||||
|
this.context.leave();
|
||||||
|
this.context.close();
|
||||||
|
this.context = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package app.cash.quickjs;
|
||||||
|
|
||||||
|
public final class QuickJsException extends RuntimeException {
|
||||||
|
public QuickJsException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ package dalvik.system;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import xyz.nulldev.androidcompat.pm.PackageController;
|
import xyz.nulldev.androidcompat.pm.PackageController;
|
||||||
import xyz.nulldev.androidcompat.util.KodeinGlobalHelper;
|
import xyz.nulldev.androidcompat.util.KoinGlobalHelper;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -33,7 +33,7 @@ import java.util.Enumeration;
|
|||||||
* {@link ClassLoader} implementations.
|
* {@link ClassLoader} implementations.
|
||||||
*/
|
*/
|
||||||
public class BaseDexClassLoader extends ClassLoader {
|
public class BaseDexClassLoader extends ClassLoader {
|
||||||
private PackageController controller = KodeinGlobalHelper.instance(PackageController.class);
|
private PackageController controller = KoinGlobalHelper.instance(PackageController.class);
|
||||||
|
|
||||||
private final URLClassLoader realClassloader;
|
private final URLClassLoader realClassloader;
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
package xyz.nulldev.androidcompat
|
package xyz.nulldev.androidcompat
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import org.kodein.di.DI
|
import org.koin.mp.KoinPlatformTools
|
||||||
import org.kodein.di.conf.global
|
|
||||||
import org.kodein.di.instance
|
|
||||||
import xyz.nulldev.androidcompat.androidimpl.CustomContext
|
import xyz.nulldev.androidcompat.androidimpl.CustomContext
|
||||||
|
|
||||||
class AndroidCompat {
|
class AndroidCompat {
|
||||||
|
val context: CustomContext by KoinPlatformTools.defaultContext().get().inject()
|
||||||
val context: CustomContext by DI.global.instance()
|
|
||||||
|
|
||||||
fun startApp(application: Application) {
|
fun startApp(application: Application) {
|
||||||
application.attach(context)
|
application.attach(context)
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package xyz.nulldev.androidcompat
|
package xyz.nulldev.androidcompat
|
||||||
|
|
||||||
import org.kodein.di.DI
|
|
||||||
import org.kodein.di.conf.global
|
|
||||||
import xyz.nulldev.androidcompat.config.ApplicationInfoConfigModule
|
import xyz.nulldev.androidcompat.config.ApplicationInfoConfigModule
|
||||||
import xyz.nulldev.androidcompat.config.FilesConfigModule
|
import xyz.nulldev.androidcompat.config.FilesConfigModule
|
||||||
import xyz.nulldev.androidcompat.config.SystemConfigModule
|
import xyz.nulldev.androidcompat.config.SystemConfigModule
|
||||||
@@ -12,16 +10,17 @@ import xyz.nulldev.ts.config.GlobalConfigManager
|
|||||||
*/
|
*/
|
||||||
class AndroidCompatInitializer {
|
class AndroidCompatInitializer {
|
||||||
fun init() {
|
fun init() {
|
||||||
DI.global.addImport(AndroidCompatModule().create())
|
|
||||||
|
|
||||||
// Register config modules
|
// Register config modules
|
||||||
GlobalConfigManager.registerModules(
|
GlobalConfigManager.registerModules(
|
||||||
FilesConfigModule.register(GlobalConfigManager.config),
|
FilesConfigModule.register(GlobalConfigManager.config),
|
||||||
ApplicationInfoConfigModule.register(GlobalConfigManager.config),
|
ApplicationInfoConfigModule.register(GlobalConfigManager.config),
|
||||||
SystemConfigModule.register(GlobalConfigManager.config)
|
SystemConfigModule.register(GlobalConfigManager.config),
|
||||||
)
|
)
|
||||||
|
|
||||||
// Set some properties extensions use
|
// 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",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
package xyz.nulldev.androidcompat
|
package xyz.nulldev.androidcompat
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import org.kodein.di.DI
|
import org.koin.core.module.Module
|
||||||
import org.kodein.di.bind
|
import org.koin.dsl.module
|
||||||
import org.kodein.di.conf.global
|
|
||||||
import org.kodein.di.instance
|
|
||||||
import org.kodein.di.singleton
|
|
||||||
import xyz.nulldev.androidcompat.androidimpl.CustomContext
|
import xyz.nulldev.androidcompat.androidimpl.CustomContext
|
||||||
import xyz.nulldev.androidcompat.androidimpl.FakePackageManager
|
import xyz.nulldev.androidcompat.androidimpl.FakePackageManager
|
||||||
import xyz.nulldev.androidcompat.info.ApplicationInfoImpl
|
import xyz.nulldev.androidcompat.info.ApplicationInfoImpl
|
||||||
@@ -17,23 +14,19 @@ import xyz.nulldev.androidcompat.service.ServiceSupport
|
|||||||
* AndroidCompatModule
|
* AndroidCompatModule
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class AndroidCompatModule {
|
fun androidCompatModule(): Module =
|
||||||
fun create() = DI.Module("AndroidCompat") {
|
module {
|
||||||
bind<AndroidFiles>() with singleton { AndroidFiles() }
|
single { AndroidFiles() }
|
||||||
|
|
||||||
bind<ApplicationInfoImpl>() with singleton { ApplicationInfoImpl() }
|
single { ApplicationInfoImpl(get()) }
|
||||||
|
|
||||||
bind<ServiceSupport>() with singleton { ServiceSupport() }
|
single { ServiceSupport() }
|
||||||
|
|
||||||
bind<FakePackageManager>() with singleton { FakePackageManager() }
|
single { FakePackageManager() }
|
||||||
|
|
||||||
bind<PackageController>() with singleton { PackageController() }
|
single { PackageController() }
|
||||||
|
|
||||||
// Context
|
single { CustomContext() }
|
||||||
bind<CustomContext>() with singleton { CustomContext() }
|
|
||||||
bind<Context>() with singleton {
|
single<Context> { get<CustomContext>() }
|
||||||
val context: Context by DI.global.instance<CustomContext>()
|
|
||||||
context
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
+13
-27
@@ -32,15 +32,14 @@ import android.os.*;
|
|||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
import android.view.DisplayAdjustments;
|
import android.view.DisplayAdjustments;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.koin.core.Koin;
|
||||||
import org.kodein.di.*;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import xyz.nulldev.androidcompat.info.ApplicationInfoImpl;
|
import xyz.nulldev.androidcompat.info.ApplicationInfoImpl;
|
||||||
import xyz.nulldev.androidcompat.io.AndroidFiles;
|
import xyz.nulldev.androidcompat.io.AndroidFiles;
|
||||||
import xyz.nulldev.androidcompat.io.sharedprefs.JavaSharedPreferences;
|
import xyz.nulldev.androidcompat.io.sharedprefs.JavaSharedPreferences;
|
||||||
import xyz.nulldev.androidcompat.service.ServiceSupport;
|
import xyz.nulldev.androidcompat.service.ServiceSupport;
|
||||||
import xyz.nulldev.androidcompat.util.KodeinGlobalHelper;
|
import xyz.nulldev.androidcompat.util.KoinGlobalHelper;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -51,26 +50,25 @@ import java.util.Map;
|
|||||||
* Custom context implementation.
|
* Custom context implementation.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class CustomContext extends Context implements DIAware {
|
public class CustomContext extends Context {
|
||||||
private final DI kodein;
|
private final Koin koin;
|
||||||
public CustomContext() {
|
public CustomContext() {
|
||||||
this(KodeinGlobalHelper.kodein());
|
this(KoinGlobalHelper.koin());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CustomContext(DI kodein) {
|
public CustomContext(Koin koin) {
|
||||||
this.kodein = kodein;
|
this.koin = koin;
|
||||||
|
|
||||||
//Init configs
|
//Init configs
|
||||||
androidFiles = KodeinGlobalHelper.instance(AndroidFiles.class, getDi());
|
androidFiles = KoinGlobalHelper.instance(AndroidFiles.class, getDi());
|
||||||
applicationInfo = KodeinGlobalHelper.instance(ApplicationInfoImpl.class, getDi());
|
applicationInfo = KoinGlobalHelper.instance(ApplicationInfoImpl.class, getDi());
|
||||||
serviceSupport = KodeinGlobalHelper.instance(ServiceSupport.class, getDi());
|
serviceSupport = KoinGlobalHelper.instance(ServiceSupport.class, getDi());
|
||||||
fakePackageManager = KodeinGlobalHelper.instance(FakePackageManager.class, getDi());
|
fakePackageManager = KoinGlobalHelper.instance(FakePackageManager.class, getDi());
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
public Koin getDi() {
|
||||||
public DI getDi() {
|
return koin;
|
||||||
return kodein;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private AndroidFiles androidFiles;
|
private AndroidFiles androidFiles;
|
||||||
@@ -719,17 +717,5 @@ public class CustomContext extends Context implements DIAware {
|
|||||||
public boolean isCredentialProtectedStorage() {
|
public boolean isCredentialProtectedStorage() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
public DIContext<?> getDiContext() {
|
|
||||||
return getDi().getDiContext();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public DITrigger getDiTrigger() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -16,14 +16,14 @@ import android.os.UserHandle;
|
|||||||
import kotlin.NotImplementedError;
|
import kotlin.NotImplementedError;
|
||||||
import xyz.nulldev.androidcompat.pm.InstalledPackage;
|
import xyz.nulldev.androidcompat.pm.InstalledPackage;
|
||||||
import xyz.nulldev.androidcompat.pm.PackageController;
|
import xyz.nulldev.androidcompat.pm.PackageController;
|
||||||
import xyz.nulldev.androidcompat.util.KodeinGlobalHelper;
|
import xyz.nulldev.androidcompat.util.KoinGlobalHelper;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class FakePackageManager extends PackageManager {
|
public class FakePackageManager extends PackageManager {
|
||||||
private PackageController controller = KodeinGlobalHelper.instance(PackageController.class);
|
private PackageController controller = KoinGlobalHelper.instance(PackageController.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PackageInfo getPackageInfo(String packageName, int flags) throws NameNotFoundException {
|
public PackageInfo getPackageInfo(String packageName, int flags) throws NameNotFoundException {
|
||||||
|
|||||||
+6
-5
@@ -8,12 +8,13 @@ import xyz.nulldev.ts.config.ConfigModule
|
|||||||
* Application info config.
|
* Application info config.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ApplicationInfoConfigModule(config: Config) : ConfigModule(config) {
|
class ApplicationInfoConfigModule(
|
||||||
val packageName: String by config
|
getConfig: () -> Config,
|
||||||
val debug: Boolean by config
|
) : ConfigModule(getConfig) {
|
||||||
|
val packageName: String by getConfig()
|
||||||
|
val debug: Boolean by getConfig()
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun register(config: Config) =
|
fun register(config: Config) = ApplicationInfoConfigModule { config.getConfig("android.app") }
|
||||||
ApplicationInfoConfigModule(config.getConfig("android.app"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,27 +8,28 @@ import xyz.nulldev.ts.config.ConfigModule
|
|||||||
* Files configuration modules. Specifies where to store the Android files.
|
* Files configuration modules. Specifies where to store the Android files.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class FilesConfigModule(config: Config) : ConfigModule(config) {
|
class FilesConfigModule(
|
||||||
val dataDir: String by config
|
getConfig: () -> Config,
|
||||||
val filesDir: String by config
|
) : ConfigModule(getConfig) {
|
||||||
val noBackupFilesDir: String by config
|
val dataDir: String by getConfig()
|
||||||
val externalFilesDirs: MutableList<String> by config
|
val filesDir: String by getConfig()
|
||||||
val obbDirs: MutableList<String> by config
|
val noBackupFilesDir: String by getConfig()
|
||||||
val cacheDir: String by config
|
val externalFilesDirs: MutableList<String> by getConfig()
|
||||||
val codeCacheDir: String by config
|
val obbDirs: MutableList<String> by getConfig()
|
||||||
val externalCacheDirs: MutableList<String> by config
|
val cacheDir: String by getConfig()
|
||||||
val externalMediaDirs: MutableList<String> by config
|
val codeCacheDir: String by getConfig()
|
||||||
val rootDir: String by config
|
val externalCacheDirs: MutableList<String> by getConfig()
|
||||||
val externalStorageDir: String by config
|
val externalMediaDirs: MutableList<String> by getConfig()
|
||||||
val downloadCacheDir: String by config
|
val rootDir: String by getConfig()
|
||||||
val databasesDir: String by config
|
val externalStorageDir: String by getConfig()
|
||||||
|
val downloadCacheDir: String by getConfig()
|
||||||
|
val databasesDir: String by getConfig()
|
||||||
|
|
||||||
val prefsDir: String by config
|
val prefsDir: String by getConfig()
|
||||||
|
|
||||||
val packageDir: String by config
|
val packageDir: String by getConfig()
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun register(config: Config) =
|
fun register(config: Config) = FilesConfigModule { config.getConfig("android.files") }
|
||||||
FilesConfigModule(config.getConfig("android.files"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,19 +4,24 @@ import com.typesafe.config.Config
|
|||||||
import io.github.config4k.getValue
|
import io.github.config4k.getValue
|
||||||
import xyz.nulldev.ts.config.ConfigModule
|
import xyz.nulldev.ts.config.ConfigModule
|
||||||
|
|
||||||
class SystemConfigModule(val config: Config) : ConfigModule(config) {
|
class SystemConfigModule(
|
||||||
val isDebuggable: Boolean by config
|
val getConfig: () -> Config,
|
||||||
|
) : ConfigModule(getConfig) {
|
||||||
|
val isDebuggable: Boolean by getConfig()
|
||||||
|
|
||||||
val propertyPrefix = "properties."
|
val propertyPrefix = "properties."
|
||||||
|
|
||||||
fun getStringProperty(property: String) = config.getString("$propertyPrefix$property")!!
|
fun getStringProperty(property: String) = getConfig().getString("$propertyPrefix$property")!!
|
||||||
fun getIntProperty(property: String) = config.getInt("$propertyPrefix$property")
|
|
||||||
fun getLongProperty(property: String) = config.getLong("$propertyPrefix$property")
|
fun getIntProperty(property: String) = getConfig().getInt("$propertyPrefix$property")
|
||||||
fun getBooleanProperty(property: String) = config.getBoolean("$propertyPrefix$property")
|
|
||||||
fun hasProperty(property: String) = config.hasPath("$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 {
|
companion object {
|
||||||
fun register(config: Config) =
|
fun register(config: Config) = SystemConfigModule { config.getConfig("android.system") }
|
||||||
SystemConfigModule(config.getConfig("android.system"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,16 +1,12 @@
|
|||||||
package xyz.nulldev.androidcompat.info
|
package xyz.nulldev.androidcompat.info
|
||||||
|
|
||||||
import android.content.pm.ApplicationInfo
|
import android.content.pm.ApplicationInfo
|
||||||
import org.kodein.di.DI
|
|
||||||
import org.kodein.di.DIAware
|
|
||||||
import org.kodein.di.conf.global
|
|
||||||
import org.kodein.di.instance
|
|
||||||
import xyz.nulldev.androidcompat.config.ApplicationInfoConfigModule
|
import xyz.nulldev.androidcompat.config.ApplicationInfoConfigModule
|
||||||
import xyz.nulldev.ts.config.ConfigManager
|
import xyz.nulldev.ts.config.ConfigManager
|
||||||
|
|
||||||
class ApplicationInfoImpl(override val di: DI = DI.global) : ApplicationInfo(), DIAware {
|
class ApplicationInfoImpl(
|
||||||
val configManager: ConfigManager by di.instance()
|
private val configManager: ConfigManager,
|
||||||
|
) : ApplicationInfo() {
|
||||||
val appInfoConfig: ApplicationInfoConfigModule
|
val appInfoConfig: ApplicationInfoConfigModule
|
||||||
get() = configManager.module()
|
get() = configManager.module()
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ import java.io.File
|
|||||||
/**
|
/**
|
||||||
* Android file constants.
|
* Android file constants.
|
||||||
*/
|
*/
|
||||||
class AndroidFiles(val configManager: ConfigManager = GlobalConfigManager) {
|
class AndroidFiles(
|
||||||
|
val configManager: ConfigManager = GlobalConfigManager,
|
||||||
|
) {
|
||||||
val filesConfig: FilesConfigModule
|
val filesConfig: FilesConfigModule
|
||||||
get() = configManager.module()
|
get() = configManager.module()
|
||||||
|
|
||||||
@@ -30,9 +32,8 @@ class AndroidFiles(val configManager: ConfigManager = GlobalConfigManager) {
|
|||||||
|
|
||||||
val packagesDir: File get() = registerFile(filesConfig.packageDir)
|
val packagesDir: File get() = registerFile(filesConfig.packageDir)
|
||||||
|
|
||||||
fun registerFile(file: String): File {
|
fun registerFile(file: String): File =
|
||||||
return File(file).apply {
|
File(file).apply {
|
||||||
mkdirs()
|
mkdirs()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+173
-70
@@ -9,38 +9,87 @@ package xyz.nulldev.androidcompat.io.sharedprefs
|
|||||||
|
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import com.russhwolf.settings.ExperimentalSettingsApi
|
import com.russhwolf.settings.ExperimentalSettingsApi
|
||||||
import com.russhwolf.settings.ExperimentalSettingsImplementation
|
import com.russhwolf.settings.PropertiesSettings
|
||||||
import com.russhwolf.settings.JvmPreferencesSettings
|
import com.russhwolf.settings.Settings
|
||||||
import com.russhwolf.settings.serialization.decodeValue
|
import com.russhwolf.settings.serialization.decodeValue
|
||||||
import com.russhwolf.settings.serialization.decodeValueOrNull
|
import com.russhwolf.settings.serialization.decodeValueOrNull
|
||||||
import com.russhwolf.settings.serialization.encodeValue
|
import com.russhwolf.settings.serialization.encodeValue
|
||||||
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import kotlinx.serialization.ExperimentalSerializationApi
|
import kotlinx.serialization.ExperimentalSerializationApi
|
||||||
import kotlinx.serialization.SerializationException
|
import kotlinx.serialization.SerializationException
|
||||||
import kotlinx.serialization.builtins.SetSerializer
|
import kotlinx.serialization.builtins.SetSerializer
|
||||||
import kotlinx.serialization.builtins.serializer
|
import kotlinx.serialization.builtins.serializer
|
||||||
import java.util.prefs.PreferenceChangeListener
|
import xyz.nulldev.androidcompat.util.SafePath
|
||||||
import java.util.prefs.Preferences
|
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 {
|
class JavaSharedPreferences(
|
||||||
private val javaPreferences = Preferences.userRoot().node("suwayomi/tachidesk/$key")
|
key: String,
|
||||||
private val preferences = JvmPreferencesSettings(javaPreferences)
|
) : SharedPreferences {
|
||||||
private val listeners = mutableMapOf<SharedPreferences.OnSharedPreferenceChangeListener, PreferenceChangeListener>()
|
companion object {
|
||||||
|
private val logger = KotlinLogging.logger {}
|
||||||
// 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? {
|
private val file =
|
||||||
return if (defValue != null) {
|
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, *> = preferences.keys.associateWith { preferences.getStringOrNull(it) }.toMutableMap()
|
||||||
|
|
||||||
|
override fun getString(
|
||||||
|
key: String,
|
||||||
|
defValue: String?,
|
||||||
|
): String? =
|
||||||
|
if (defValue != null) {
|
||||||
preferences.getString(key, defValue)
|
preferences.getString(key, defValue)
|
||||||
} else {
|
} else {
|
||||||
preferences.getStringOrNull(key)
|
preferences.getStringOrNull(key)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
override fun getStringSet(key: String, defValues: Set<String>?): Set<String>? {
|
override fun getStringSet(
|
||||||
|
key: String,
|
||||||
|
defValues: Set<String>?,
|
||||||
|
): Set<String>? {
|
||||||
try {
|
try {
|
||||||
return if (defValues != null) {
|
return if (defValues != null) {
|
||||||
preferences.decodeValue(SetSerializer(String.serializer()), key, defValues)
|
preferences.decodeValue(SetSerializer(String.serializer()), key, defValues)
|
||||||
@@ -52,81 +101,117 @@ class JavaSharedPreferences(key: String) : SharedPreferences {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getInt(key: String, defValue: Int): Int {
|
override fun getInt(
|
||||||
return preferences.getInt(key, defValue)
|
key: String,
|
||||||
}
|
defValue: Int,
|
||||||
|
): Int = preferences.getInt(key, defValue)
|
||||||
|
|
||||||
override fun getLong(key: String, defValue: Long): Long {
|
override fun getLong(
|
||||||
return preferences.getLong(key, defValue)
|
key: String,
|
||||||
}
|
defValue: Long,
|
||||||
|
): Long = preferences.getLong(key, defValue)
|
||||||
|
|
||||||
override fun getFloat(key: String, defValue: Float): Float {
|
override fun getFloat(
|
||||||
return preferences.getFloat(key, defValue)
|
key: String,
|
||||||
}
|
defValue: Float,
|
||||||
|
): Float = preferences.getFloat(key, defValue)
|
||||||
|
|
||||||
override fun getBoolean(key: String, defValue: Boolean): Boolean {
|
override fun getBoolean(
|
||||||
return preferences.getBoolean(key, defValue)
|
key: String,
|
||||||
}
|
defValue: Boolean,
|
||||||
|
): Boolean = preferences.getBoolean(key, defValue)
|
||||||
|
|
||||||
override fun contains(key: String): Boolean {
|
override fun contains(key: String): Boolean = key in preferences.keys
|
||||||
return key in preferences.keys
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun edit(): SharedPreferences.Editor {
|
override fun edit(): SharedPreferences.Editor =
|
||||||
return Editor(preferences)
|
Editor(preferences) { key ->
|
||||||
}
|
listeners.forEach { (_, listener) ->
|
||||||
|
listener(key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class Editor(private val preferences: JvmPreferencesSettings) : SharedPreferences.Editor {
|
class Editor(
|
||||||
val itemsToAdd = mutableMapOf<String, Any>()
|
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) {
|
if (value != null) {
|
||||||
itemsToAdd[key] = value
|
actions += Action.Add(key, value)
|
||||||
} else {
|
} else {
|
||||||
remove(key)
|
actions += Action.Remove(key)
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun putStringSet(
|
override fun putStringSet(
|
||||||
key: String,
|
key: String,
|
||||||
values: MutableSet<String>?
|
values: MutableSet<String>?,
|
||||||
): SharedPreferences.Editor {
|
): SharedPreferences.Editor {
|
||||||
if (values != null) {
|
if (values != null) {
|
||||||
itemsToAdd[key] = values
|
actions += Action.Add(key, values)
|
||||||
} else {
|
} else {
|
||||||
remove(key)
|
actions += Action.Remove(key)
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun putInt(key: String, value: Int): SharedPreferences.Editor {
|
override fun putInt(
|
||||||
itemsToAdd[key] = value
|
key: String,
|
||||||
|
value: Int,
|
||||||
|
): SharedPreferences.Editor {
|
||||||
|
actions += Action.Add(key, value)
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun putLong(key: String, value: Long): SharedPreferences.Editor {
|
override fun putLong(
|
||||||
itemsToAdd[key] = value
|
key: String,
|
||||||
|
value: Long,
|
||||||
|
): SharedPreferences.Editor {
|
||||||
|
actions += Action.Add(key, value)
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun putFloat(key: String, value: Float): SharedPreferences.Editor {
|
override fun putFloat(
|
||||||
itemsToAdd[key] = value
|
key: String,
|
||||||
|
value: Float,
|
||||||
|
): SharedPreferences.Editor {
|
||||||
|
actions += Action.Add(key, value)
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun putBoolean(key: String, value: Boolean): SharedPreferences.Editor {
|
override fun putBoolean(
|
||||||
itemsToAdd[key] = value
|
key: String,
|
||||||
|
value: Boolean,
|
||||||
|
): SharedPreferences.Editor {
|
||||||
|
actions += Action.Add(key, value)
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun remove(key: String): SharedPreferences.Editor {
|
override fun remove(key: String): SharedPreferences.Editor {
|
||||||
itemsToAdd.remove(key)
|
actions += Action.Remove(key)
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun clear(): SharedPreferences.Editor {
|
override fun clear(): SharedPreferences.Editor {
|
||||||
itemsToAdd.clear()
|
actions.add(Action.Clear)
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,38 +225,56 @@ class JavaSharedPreferences(key: String) : SharedPreferences {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun addToPreferences() {
|
private fun addToPreferences() {
|
||||||
itemsToAdd.forEach { (key, value) ->
|
actions.forEach {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
when (value) {
|
when (it) {
|
||||||
is Set<*> -> preferences.encodeValue(SetSerializer(String.serializer()), key, value as Set<String>)
|
is Action.Add -> {
|
||||||
is String -> preferences.putString(key, value)
|
when (val value = it.value) {
|
||||||
is Int -> preferences.putInt(key, value)
|
is Set<*> -> preferences.encodeValue(SetSerializer(String.serializer()), it.key, value as Set<String>)
|
||||||
is Long -> preferences.putLong(key, value)
|
is String -> preferences.putString(it.key, value)
|
||||||
is Float -> preferences.putFloat(key, value)
|
is Int -> preferences.putInt(it.key, value)
|
||||||
is Double -> preferences.putDouble(key, value)
|
is Long -> preferences.putLong(it.key, value)
|
||||||
is Boolean -> preferences.putBoolean(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) {
|
override fun registerOnSharedPreferenceChangeListener(listener: SharedPreferences.OnSharedPreferenceChangeListener) {
|
||||||
val javaListener = PreferenceChangeListener {
|
val javaListener: (String) -> Unit = {
|
||||||
listener.onSharedPreferenceChanged(this, it.key)
|
listener.onSharedPreferenceChanged(this, it)
|
||||||
}
|
}
|
||||||
listeners[listener] = javaListener
|
listeners[listener] = javaListener
|
||||||
javaPreferences.addPreferenceChangeListener(javaListener)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun unregisterOnSharedPreferenceChangeListener(listener: SharedPreferences.OnSharedPreferenceChangeListener) {
|
override fun unregisterOnSharedPreferenceChangeListener(listener: SharedPreferences.OnSharedPreferenceChangeListener) {
|
||||||
val registeredListener = listeners.remove(listener)
|
listeners.remove(listener)
|
||||||
if (registeredListener != null) {
|
|
||||||
javaPreferences.removePreferenceChangeListener(registeredListener)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun deleteAll(): Boolean {
|
fun deleteAll(): Boolean {
|
||||||
javaPreferences.removeNode()
|
preferences.clear()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,48 +14,60 @@ import java.io.File
|
|||||||
import javax.imageio.ImageIO
|
import javax.imageio.ImageIO
|
||||||
import javax.xml.parsers.DocumentBuilderFactory
|
import javax.xml.parsers.DocumentBuilderFactory
|
||||||
|
|
||||||
data class InstalledPackage(val root: File) {
|
data class InstalledPackage(
|
||||||
|
val root: File,
|
||||||
|
) {
|
||||||
val apk = File(root, "package.apk")
|
val apk = File(root, "package.apk")
|
||||||
val jar = File(root, "translated.jar")
|
val jar = File(root, "translated.jar")
|
||||||
val icon = File(root, "icon.png")
|
val icon = File(root, "icon.png")
|
||||||
|
|
||||||
val info: PackageInfo
|
val info: PackageInfo
|
||||||
get() = ApkParsers.getMetaInfo(apk).toPackageInfo(apk).also {
|
get() =
|
||||||
val parsed = ApkFile(apk)
|
ApkParsers.getMetaInfo(apk).toPackageInfo(apk).also {
|
||||||
val dbFactory = DocumentBuilderFactory.newInstance()
|
val parsed = ApkFile(apk)
|
||||||
val dBuilder = dbFactory.newDocumentBuilder()
|
val dbFactory = DocumentBuilderFactory.newInstance()
|
||||||
val doc = parsed.manifestXml.byteInputStream().use {
|
val dBuilder = dbFactory.newDocumentBuilder()
|
||||||
dBuilder.parse(it)
|
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 {
|
fun verify(): Boolean {
|
||||||
val res = ApkVerifier.Builder(apk)
|
val res =
|
||||||
.build()
|
ApkVerifier
|
||||||
.verify()
|
.Builder(apk)
|
||||||
|
.build()
|
||||||
|
.verify()
|
||||||
|
|
||||||
return res.isVerified
|
return res.isVerified
|
||||||
}
|
}
|
||||||
@@ -64,11 +76,15 @@ data class InstalledPackage(val root: File) {
|
|||||||
try {
|
try {
|
||||||
val icons = ApkFile(apk).allIcons
|
val icons = ApkFile(apk).allIcons
|
||||||
|
|
||||||
val read = icons.filter { it.isFile }.map {
|
val read =
|
||||||
it.data.inputStream().use {
|
icons
|
||||||
ImageIO.read(it)
|
.filter { it.isFile }
|
||||||
}
|
.map {
|
||||||
}.sortedByDescending { it.width * it.height }.firstOrNull() ?: return
|
it.data.inputStream().use {
|
||||||
|
ImageIO.read(it)
|
||||||
|
}
|
||||||
|
}.sortedByDescending { it.width * it.height }
|
||||||
|
.firstOrNull() ?: return
|
||||||
|
|
||||||
ImageIO.write(read, "png", icon)
|
ImageIO.write(read, "png", icon)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
@@ -88,8 +104,9 @@ data class InstalledPackage(val root: File) {
|
|||||||
fun NodeList.toList(): List<Node> {
|
fun NodeList.toList(): List<Node> {
|
||||||
val out = mutableListOf<Node>()
|
val out = mutableListOf<Node>()
|
||||||
|
|
||||||
for (i in 0 until length)
|
for (i in 0 until length) {
|
||||||
out += item(i)
|
out += item(i)
|
||||||
|
}
|
||||||
|
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package xyz.nulldev.androidcompat.pm
|
package xyz.nulldev.androidcompat.pm
|
||||||
|
|
||||||
import net.dongliu.apk.parser.ApkParsers
|
import net.dongliu.apk.parser.ApkParsers
|
||||||
import org.kodein.di.DI
|
import org.koin.mp.KoinPlatformTools
|
||||||
import org.kodein.di.conf.global
|
|
||||||
import org.kodein.di.instance
|
|
||||||
import xyz.nulldev.androidcompat.io.AndroidFiles
|
import xyz.nulldev.androidcompat.io.AndroidFiles
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
class PackageController {
|
class PackageController {
|
||||||
private val androidFiles by DI.global.instance<AndroidFiles>()
|
private val androidFiles: AndroidFiles by KoinPlatformTools.defaultContext().get().inject()
|
||||||
private val uninstallListeners = mutableListOf<(String) -> Unit>()
|
private val uninstallListeners = mutableListOf<(String) -> Unit>()
|
||||||
|
|
||||||
fun registerUninstallListener(listener: (String) -> Unit) {
|
fun registerUninstallListener(listener: (String) -> Unit) {
|
||||||
@@ -25,7 +23,10 @@ class PackageController {
|
|||||||
return File(androidFiles.packagesDir, pn)
|
return File(androidFiles.packagesDir, pn)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun installPackage(apk: File, allowReinstall: Boolean) {
|
fun installPackage(
|
||||||
|
apk: File,
|
||||||
|
allowReinstall: Boolean,
|
||||||
|
) {
|
||||||
val root = findRoot(apk)
|
val root = findRoot(apk)
|
||||||
|
|
||||||
if (root.exists()) {
|
if (root.exists()) {
|
||||||
@@ -54,13 +55,15 @@ class PackageController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun listInstalled(): List<InstalledPackage> {
|
fun listInstalled(): List<InstalledPackage> =
|
||||||
return androidFiles.packagesDir.listFiles().orEmpty().filter {
|
androidFiles.packagesDir
|
||||||
it.isDirectory
|
.listFiles()
|
||||||
}.map {
|
.orEmpty()
|
||||||
InstalledPackage(it)
|
.filter {
|
||||||
}
|
it.isDirectory
|
||||||
}
|
}.map {
|
||||||
|
InstalledPackage(it)
|
||||||
|
}
|
||||||
|
|
||||||
fun deletePackage(pack: InstalledPackage) {
|
fun deletePackage(pack: InstalledPackage) {
|
||||||
if (!pack.root.exists()) error("Package was never installed!")
|
if (!pack.root.exists()) error("Package was never installed!")
|
||||||
@@ -74,10 +77,11 @@ class PackageController {
|
|||||||
|
|
||||||
fun findPackage(packageName: String): InstalledPackage? {
|
fun findPackage(packageName: String): InstalledPackage? {
|
||||||
val file = File(androidFiles.packagesDir, packageName)
|
val file = File(androidFiles.packagesDir, packageName)
|
||||||
return if (file.exists())
|
return if (file.exists()) {
|
||||||
InstalledPackage(file)
|
InstalledPackage(file)
|
||||||
else
|
} else {
|
||||||
null
|
null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun findJarFromApk(apkFile: File): File? {
|
fun findJarFromApk(apkFile: File): File? {
|
||||||
|
|||||||
@@ -6,22 +6,24 @@ import android.content.pm.PackageInfo
|
|||||||
import net.dongliu.apk.parser.bean.ApkMeta
|
import net.dongliu.apk.parser.bean.ApkMeta
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
fun ApkMeta.toPackageInfo(apk: File): PackageInfo {
|
fun ApkMeta.toPackageInfo(apk: File): PackageInfo =
|
||||||
return PackageInfo().also {
|
PackageInfo().also {
|
||||||
it.packageName = packageName
|
it.packageName = packageName
|
||||||
it.versionCode = versionCode.toInt()
|
it.versionCode = versionCode.toInt()
|
||||||
it.versionName = versionName
|
it.versionName = versionName
|
||||||
|
|
||||||
it.reqFeatures = usesFeatures.map {
|
it.reqFeatures =
|
||||||
FeatureInfo().apply {
|
usesFeatures
|
||||||
name = it.name
|
.map {
|
||||||
}
|
FeatureInfo().apply {
|
||||||
}.toTypedArray()
|
name = it.name
|
||||||
|
}
|
||||||
|
}.toTypedArray()
|
||||||
|
|
||||||
it.applicationInfo = ApplicationInfo().apply {
|
it.applicationInfo =
|
||||||
packageName = it.packageName
|
ApplicationInfo().apply {
|
||||||
nonLocalizedLabel = label
|
packageName = it.packageName
|
||||||
sourceDir = apk.absolutePath
|
nonLocalizedLabel = label
|
||||||
}
|
sourceDir = apk.absolutePath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package xyz.nulldev.androidcompat.res;
|
package xyz.nulldev.androidcompat.res;
|
||||||
|
|
||||||
import xyz.nulldev.androidcompat.info.ApplicationInfoImpl;
|
import xyz.nulldev.androidcompat.info.ApplicationInfoImpl;
|
||||||
import xyz.nulldev.androidcompat.util.KodeinGlobalHelper;
|
import xyz.nulldev.androidcompat.util.KoinGlobalHelper;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
@@ -10,7 +10,7 @@ import java.util.Calendar;
|
|||||||
* BuildConfig compat class.
|
* BuildConfig compat class.
|
||||||
*/
|
*/
|
||||||
public class BuildConfigCompat {
|
public class BuildConfigCompat {
|
||||||
private static ApplicationInfoImpl applicationInfo = KodeinGlobalHelper.instance(ApplicationInfoImpl.class);
|
private static ApplicationInfoImpl applicationInfo = KoinGlobalHelper.instance(ApplicationInfoImpl.class);
|
||||||
|
|
||||||
public static final boolean DEBUG = applicationInfo.getDebug();
|
public static final boolean DEBUG = applicationInfo.getDebug();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package xyz.nulldev.androidcompat.res
|
package xyz.nulldev.androidcompat.res
|
||||||
|
|
||||||
class DrawableResource(val location: String) : Resource {
|
class DrawableResource(
|
||||||
|
val location: String,
|
||||||
|
) : Resource {
|
||||||
override fun getType() = DrawableResource::class.java
|
override fun getType() = DrawableResource::class.java
|
||||||
|
|
||||||
override fun getValue() = javaClass.getResourceAsStream(location)
|
override fun getValue() = javaClass.getResourceAsStream(location)
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ package xyz.nulldev.androidcompat.res
|
|||||||
/**
|
/**
|
||||||
* String resource.
|
* String resource.
|
||||||
*/
|
*/
|
||||||
class StringResource(val string: String) : Resource {
|
class StringResource(
|
||||||
|
val string: String,
|
||||||
|
) : Resource {
|
||||||
override fun getValue() = string
|
override fun getValue() = string
|
||||||
|
|
||||||
override fun getType() = StringResource::class.java
|
override fun getType() = StringResource::class.java
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package xyz.nulldev.androidcompat.service
|
|||||||
import android.app.Service
|
import android.app.Service
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import mu.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
import kotlin.concurrent.thread
|
import kotlin.concurrent.thread
|
||||||
|
|
||||||
@@ -18,7 +18,10 @@ class ServiceSupport {
|
|||||||
|
|
||||||
private val logger = KotlinLogging.logger {}
|
private val logger = KotlinLogging.logger {}
|
||||||
|
|
||||||
fun startService(@Suppress("UNUSED_PARAMETER") context: Context, intent: Intent) {
|
fun startService(
|
||||||
|
@Suppress("UNUSED_PARAMETER") context: Context,
|
||||||
|
intent: Intent,
|
||||||
|
) {
|
||||||
val name = intentToClassName(intent)
|
val name = intentToClassName(intent)
|
||||||
|
|
||||||
logger.debug { "Starting service: $name" }
|
logger.debug { "Starting service: $name" }
|
||||||
@@ -35,7 +38,10 @@ class ServiceSupport {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun stopService(@Suppress("UNUSED_PARAMETER") context: Context, intent: Intent) {
|
fun stopService(
|
||||||
|
@Suppress("UNUSED_PARAMETER") context: Context,
|
||||||
|
intent: Intent,
|
||||||
|
) {
|
||||||
val name = intentToClassName(intent)
|
val name = intentToClassName(intent)
|
||||||
stopService(name)
|
stopService(name)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
package xyz.nulldev.androidcompat.util
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import org.kodein.di.DI
|
|
||||||
import org.kodein.di.conf.global
|
|
||||||
import org.kodein.di.instance
|
|
||||||
import xyz.nulldev.androidcompat.androidimpl.CustomContext
|
|
||||||
import xyz.nulldev.androidcompat.androidimpl.FakePackageManager
|
|
||||||
import xyz.nulldev.androidcompat.info.ApplicationInfoImpl
|
|
||||||
import xyz.nulldev.androidcompat.io.AndroidFiles
|
|
||||||
import xyz.nulldev.androidcompat.pm.PackageController
|
|
||||||
import xyz.nulldev.androidcompat.service.ServiceSupport
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper class to allow access to Kodein from Java
|
|
||||||
*/
|
|
||||||
object KodeinGlobalHelper {
|
|
||||||
/**
|
|
||||||
* Get the Kodein object
|
|
||||||
*/
|
|
||||||
@JvmStatic
|
|
||||||
fun kodein() = DI.global
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a dependency
|
|
||||||
*/
|
|
||||||
@JvmStatic
|
|
||||||
@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
|
|
||||||
}
|
|
||||||
ApplicationInfoImpl::class.java -> {
|
|
||||||
val instance: ApplicationInfoImpl by (kodein ?: kodein()).instance()
|
|
||||||
instance as T
|
|
||||||
}
|
|
||||||
ServiceSupport::class.java -> {
|
|
||||||
val instance: ServiceSupport by (kodein ?: kodein()).instance()
|
|
||||||
instance as T
|
|
||||||
}
|
|
||||||
FakePackageManager::class.java -> {
|
|
||||||
val instance: FakePackageManager by (kodein ?: kodein()).instance()
|
|
||||||
instance as T
|
|
||||||
}
|
|
||||||
PackageController::class.java -> {
|
|
||||||
val instance: PackageController by (kodein ?: kodein()).instance()
|
|
||||||
instance as T
|
|
||||||
}
|
|
||||||
CustomContext::class.java -> {
|
|
||||||
val instance: CustomContext by (kodein ?: kodein()).instance()
|
|
||||||
instance as T
|
|
||||||
}
|
|
||||||
Context::class.java -> {
|
|
||||||
val instance: Context by (kodein ?: kodein()).instance()
|
|
||||||
instance as T
|
|
||||||
}
|
|
||||||
else -> throw IllegalArgumentException("Kodein instance not found")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@JvmStatic
|
|
||||||
fun <T : Any> instance(type: Class<T>): T {
|
|
||||||
return instance(type, null)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package xyz.nulldev.androidcompat.util
|
||||||
|
|
||||||
|
import org.koin.core.Koin
|
||||||
|
import org.koin.mp.KoinPlatformTools
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper class to allow access to Kodein from Java
|
||||||
|
*/
|
||||||
|
object KoinGlobalHelper {
|
||||||
|
/**
|
||||||
|
* Get the Kodein object
|
||||||
|
*/
|
||||||
|
@JvmStatic
|
||||||
|
fun koin() = KoinPlatformTools.defaultContext().get()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a dependency
|
||||||
|
*/
|
||||||
|
@JvmStatic
|
||||||
|
fun <T : Any> instance(
|
||||||
|
type: Class<T>,
|
||||||
|
koin: Koin? = null,
|
||||||
|
): T = (koin ?: koin()).get(type.kotlin)
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun <T : Any> instance(type: Class<T>): T = 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
|
* Copyright (C) Contributors to the Suwayomi project
|
||||||
@@ -24,5 +24,7 @@ import java.net.URI
|
|||||||
* Utilites to convert between Java and Android Uris.
|
* Utilites to convert between Java and Android Uris.
|
||||||
*/
|
*/
|
||||||
fun Uri.java() = URI(this.toString())
|
fun Uri.java() = URI(this.toString())
|
||||||
|
|
||||||
fun Uri.file() = File(this.path)
|
fun Uri.file() = File(this.path)
|
||||||
|
|
||||||
fun URI.android() = Uri.parse(this.toString())!!
|
fun URI.android() = Uri.parse(this.toString())!!
|
||||||
|
|||||||
@@ -0,0 +1,96 @@
|
|||||||
|
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 = acceptCookie
|
||||||
|
|
||||||
|
override fun setAcceptThirdPartyCookies(
|
||||||
|
webview: WebView?,
|
||||||
|
accept: Boolean,
|
||||||
|
) {
|
||||||
|
acceptThirdPartyCookies = accept
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun acceptThirdPartyCookies(webview: WebView?): Boolean = 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 = cookieHandler.cookieStore.cookies.isNotEmpty()
|
||||||
|
|
||||||
|
override fun flush() {}
|
||||||
|
|
||||||
|
override fun allowFileSchemeCookiesImpl(): Boolean = allowFileSchemeCookies
|
||||||
|
|
||||||
|
override fun setAcceptFileSchemeCookiesImpl(accept: Boolean) {
|
||||||
|
allowFileSchemeCookies = acceptCookie
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
## TL;DR
|
## TL;DR
|
||||||
- N/A
|
- N/A
|
||||||
|
|
||||||
## Tachidesk-Server Changelog
|
## Suwayomi-Server Changelog
|
||||||
- N/A
|
- N/A
|
||||||
|
|
||||||
## Tachidesk-WebUI Changelog
|
## Suwayomi-WebUI Changelog
|
||||||
- N/A
|
- N/A
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1408
-147
File diff suppressed because it is too large
Load Diff
+47
-17
@@ -1,31 +1,61 @@
|
|||||||
# Contributing
|
# Contributing
|
||||||
## Where should I start?
|
## 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 1:** 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.
|
### 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.
|
||||||
**Note 2:** Your pull request will be squashed into a single commit.
|
- 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.
|
||||||
|
|
||||||
### Project goals and vision
|
### Project goals and vision
|
||||||
- Porting Tachiyomi and covering it's features
|
- Porting Mihon (Tachiyomi) and covering its features
|
||||||
- Syncing with Tachiyomi, [main issue](https://github.com/Suwayomi/Tachidesk-Server/issues/159)
|
- Syncing with Mihon (Tachiyomi), [main issue](https://github.com/Suwayomi/Suwayomi-Server/issues/159)
|
||||||
- Generally rejecting features that Tachiyomi(main app) doesn't have,
|
- Generally rejecting features that Mihon (Tachiyomi) (main app) doesn't have,
|
||||||
- Unless it's something that makes sense for desktop sizes or desktop form factor (keyboard + mouse)
|
- 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
|
- Additional/crazy features can go in forks and alternative clients
|
||||||
- [Tachidesk-WebUI](https://github.com/Suwayomi/Tachidesk-WebUI) should
|
- [Suwayomi-WebUI](https://github.com/Suwayomi/Suwayomi-WebUI) should
|
||||||
- be responsive
|
- be responsive
|
||||||
- support both desktop and mobile form factors well
|
- support both desktop and mobile form factors well
|
||||||
|
|
||||||
## How does Tachidesk-Server work?
|
## How does Suwayomi-Server work?
|
||||||
This project has two components:
|
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 jar libraries converted from apk extensions. All this concludes to serving a REST API.
|
1. **Server:** contains the implementation of [Mihon (Tachiyomi)'s source library](https://github.com/mihonapp/mihon/tree/main/source-api) 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/Tachidesk-WebUI
|
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
|
||||||
|
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?
|
## Why a web app?
|
||||||
This structure is chosen to
|
This structure is chosen to
|
||||||
- Achieve the maximum multi-platform-ness
|
- Achieve the maximum multi-platform-ness
|
||||||
- Gives the ability to access Tachidesk-Server from a remote client e.g., your phone, tablet or smart TV
|
- 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 Tachidesk
|
- Ease development of user interfaces for Suwayomi
|
||||||
|
|
||||||
## Building from source
|
## Building from source
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
@@ -33,14 +63,14 @@ You need these software packages installed in order to build the project
|
|||||||
|
|
||||||
- Java Development Kit and Java Runtime Environment version 8 or newer(both Oracle JDK and OpenJDK works)
|
- Java Development Kit and Java Runtime Environment version 8 or newer(both Oracle JDK and OpenJDK works)
|
||||||
|
|
||||||
### building the full-blown jar (Tachidesk-Server + Tachidesk-WebUI bundle)
|
### 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/Tachidesk-Server-vX.Y.Z-rxxx.jar`.
|
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)
|
### 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/Tachidesk-Server-vX.Y.Z-rxxx.jar`.
|
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
|
### 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/Tachidesk-Server-vX.Y.Z-rxxx-winXX.zip`.
|
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
|
## Running in development mode
|
||||||
run `./gradlew :server:run --stacktrace` to run the server
|
run `./gradlew :server:run --stacktrace` to run the server
|
||||||
|
|||||||
@@ -1,156 +1,172 @@
|
|||||||
|
|
||||||
| Build | Stable | Preview | Support Server |
|
| Build | Stable | Preview | Support Server |
|
||||||
|-------|----------|---------|---------|
|
|-----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
|
||||||
|  | [](https://github.com/Suwayomi/Tachidesk/releases) | [](https://github.com/Suwayomi/Tachidesk-preview/releases/latest) | [](https://discord.gg/DDZdqZWaHA) |
|
|  | [](https://github.com/Suwayomi/Suwayomi-Server/releases) | [](https://github.com/Suwayomi/Suwayomi-Server-preview/releases/latest) | [](https://discord.gg/DDZdqZWaHA) |
|
||||||
|
|
||||||
## Table of Content
|
## Table of Content
|
||||||
- [What is Tachidesk?](#what-is-tachidesk)
|
- [What is Suwayomi?](#what-is-suwayomi)
|
||||||
- [Tachidesk client projects](#tachidesk-client-projects)
|
- [Features](#Features)
|
||||||
* [Is this application usable? Should I test it?](#is-this-application-usable-should-i-test-it)
|
- [Suwayomi client projects](#Suwayomi-client-projects)
|
||||||
- [Downloading and Running the app](#downloading-and-running-the-app)
|
- [Downloading and Running the app](#downloading-and-running-the-app)
|
||||||
* [Using Operating System Specific Bundles](#using-operating-system-specific-bundles)
|
* [Using Operating System Specific Bundles](#using-operating-system-specific-bundles)
|
||||||
- [Launcher Scripts](#launcher-scripts)
|
- [Launcher Scripts](#launcher-scripts)
|
||||||
+ [Windows](#windows)
|
+ [Windows](#windows)
|
||||||
+ [macOS](#macos)
|
+ [macOS](#macos)
|
||||||
+ [GNU/Linux](#gnulinux)
|
+ [GNU/Linux](#gnulinux)
|
||||||
* [Other methods of getting Tachidesk](#other-methods-of-getting-tachidesk)
|
* [Other methods of getting Suwayomi](#other-methods-of-getting-suwayomi)
|
||||||
+ [Arch Linux](#arch-linux)
|
+ [Arch Linux](#arch-linux)
|
||||||
+ [Ubuntu-based distributions](#ubuntu-based-distributions)
|
+ [Ubuntu-based distributions](#ubuntu-based-distributions)
|
||||||
+ [Docker](#docker)
|
+ [Docker](#docker)
|
||||||
* [Advanced Methods](#advanced-methods)
|
* [Advanced Methods](#advanced-methods)
|
||||||
+ [Running the jar release directly](#running-the-jar-release-directly)
|
+ [Running the jar release directly](#running-the-jar-release-directly)
|
||||||
+ [Using Tachidesk Remotely](#using-tachidesk-remotely)
|
+ [Using Suwayomi Remotely](#using-suwayomi-remotely)
|
||||||
- [Syncing With Tachiyomi](#syncing-with-tachiyomi)
|
- [Syncing With Mihon (Tachiyomi)](#syncing-with-mihon-tachiyomi)
|
||||||
- [Troubleshooting and Support](#troubleshooting-and-support)
|
- [Troubleshooting and Support](#troubleshooting-and-support)
|
||||||
- [Contributing and Technical info](#contributing-and-technical-info)
|
- [Contributing and Technical info](#contributing-and-technical-info)
|
||||||
- [Credit](#credit)
|
- [Credit](#credit)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
<!-- Generated with https://ecotrust-canada.github.io/markdown-toc/ -->
|
<!-- Generated with https://ecotrust-canada.github.io/markdown-toc/ -->
|
||||||
|
|
||||||
# What is Tachidesk?
|
# What is Suwayomi?
|
||||||
<img src="https://github.com/Suwayomi/Tachidesk/raw/master/server/src/main/resources/icon/faviconlogo.png" alt="drawing" width="200"/>
|
<img src="https://github.com/Suwayomi/Suwayomi-Server/raw/master/server/src/main/resources/icon/faviconlogo.png" alt="drawing" width="200"/>
|
||||||
|
|
||||||
A free and open source manga reader server that runs extensions built for [Tachiyomi](https://tachiyomi.org/).
|
A free and open source manga reader server that runs extensions built for [Mihon (Tachiyomi)](https://mihon.app/).
|
||||||
|
|
||||||
Tachidesk is an independent Tachiyomi compatible software and is **not a Fork of** Tachiyomi.
|
Suwayomi is an independent Mihon (Tachiyomi) compatible software and is **not a Fork of** Mihon (Tachiyomi).
|
||||||
|
|
||||||
`Tachidesk` is a general term used to describe the combination of Tachidesk-Server(this project) and one of our clients.
|
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.
|
||||||
Think of it roughly like the concept of "distribution" in GNU/Linux distributions, in which Linux(Tachidesk-Server) is the kernel and the difference is which desktop environment(Tachidesk client) you get with it.
|
|
||||||
|
|
||||||
Tachidesk-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.
|
You can use Mihon (Tachiyomi) to access your Suwayomi-Server. For more info look [here](#syncing-with-mihon-tachiyomi).
|
||||||
|
|
||||||
Ability to sync with Tachiyomi is a planned feature.
|
## Features
|
||||||
|
> [!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.
|
||||||
|
|
||||||
# Tachidesk client projects
|
- Installing and executing Mihon (Tachiyomi)'s Extensions, So you'll get the same sources
|
||||||
**You need a client/user interface app as a front-end for Tachidesk-Server, if you Directly Download Tachidesk-Server you'll get a bundled version of [Tachidesk-WebUI](https://github.com/Suwayomi/Tachidesk-WebUI) with it.**
|
|
||||||
|
|
||||||
Here's a list of known clients/user interfaces for Tachidesk-Server:
|
|
||||||
##### Actively Developed Cients
|
|
||||||
- [Tachidesk-WebUI](https://github.com/Suwayomi/Tachidesk-WebUI): The web/ElectronJS front-end that Tachidesk-Server is traditionally shipped with. Usually gets new features faster.
|
|
||||||
- [Tachidesk-JUI](https://github.com/Suwayomi/Tachidesk-JUI): The native desktop front-end for Tachidesk-Server. Currently the most advanced.
|
|
||||||
- [Tachidesk-qtui](https://github.com/Suwayomi/Tachidesk-qtui): A C++/Qt front-end for mobile devices(Android/linux), in super early stage of development.
|
|
||||||
- [Tachidesk-Flutter](https://github.com/Suwayomi/Tachidesk-Flutter): A Flutter front-end for Desktop(Linux, windows, etc.), in early stage of development.
|
|
||||||
##### Inctive/Abandoned Cients
|
|
||||||
- [Equinox](https://github.com/Suwayomi/Equinox): A web user interface made with Vue.js, in super early stage of development.
|
|
||||||
- [Tachidesk-GTK](https://github.com/mahor1221/Tachidesk-GTK): A native Rust/GTK desktop client, in super early stage of development.
|
|
||||||
|
|
||||||
## 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
|
- Searching and browsing installed sources
|
||||||
|
- A library to save your mangas and categories to put them into
|
||||||
|
- Automated library updates to check for new chapters
|
||||||
|
- Automated download of new chapters
|
||||||
|
- Viewing latest updated chapters
|
||||||
- Ability to download Manga for offline read
|
- Ability to download Manga for offline read
|
||||||
- Backup and restore support powered by Tachiyomi-compatible Backups
|
- Backup and restore support powered by Mihon (Tachiyomi)-compatible Backups
|
||||||
- Viewing latest updated chapters.
|
- Automated backup creations
|
||||||
|
- Tracking via [MyAnimeList](https://myanimelist.net/), [AniList](https://anilist.co/), [MangaUpdates](https://www.mangaupdates.com/)
|
||||||
|
- [FlareSolverr](https://github.com/FlareSolverr/FlareSolverr) support to bypass Cloudflare protection
|
||||||
|
- Automated WebUI updates (supports the default WebUI and VUI)
|
||||||
|
|
||||||
**Note:** These are capabilities of Tachidesk-Server, the actual working support is provided by each front-end app, checkout their respective readme for more info.
|
# 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 (checkout the respective GitHub repository for their features):
|
||||||
|
##### Actively Developed Clients
|
||||||
|
- [Suwayomi-WebUI](https://github.com/Suwayomi/Suwayomi-WebUI): The web front-end that Suwayomi-Server ships with by default.
|
||||||
|
- [Suwayomi-VUI](https://github.com/Suwayomi/Suwayomi-VUI): A Suwayomi-Server preview focused web frontend built with svelte
|
||||||
|
- [Tachidesk-VaadinUI](https://github.com/Suwayomi/Tachidesk-VaadinUI): A Web front-end for Suwayomi-Server built with Vaadin.
|
||||||
|
##### Inactive Clients (functional but outdated)
|
||||||
|
- [Tachidesk-JUI](https://github.com/Suwayomi/Tachidesk-JUI): The native desktop front-end for Suwayomi-Server.
|
||||||
|
- [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 Mihon (Tachiyomi).
|
||||||
|
##### Abandoned Clients (functionality unknown)
|
||||||
|
- [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.
|
||||||
|
|
||||||
# Downloading and Running the app
|
# Downloading and Running the app
|
||||||
## Using Operating System Specific Bundles
|
## Using Operating System Specific Bundles
|
||||||
To facilitate the use of Tachidesk we provide bundle releases that include The Java Runtime Environment, ElectronJS and 3 Tachidesk Launcher Scripts.
|
To facilitate the use of Suwayomi we provide bundle releases that include The Java Runtime Environment, ElectronJS and the Suwayomi-Launcher.
|
||||||
|
|
||||||
If a bundle for your operating system or cpu architecture is not provided then refer to [Advanced Methods](#advanced-methods)
|
If a bundle for your operating system or cpu architecture is not provided then refer to [Advanced Methods](#advanced-methods)
|
||||||
|
|
||||||
#### Launcher Scripts
|
|
||||||
- `Tachidesk Electron Launcher`: Launches Tachidesk inside Electron as a desktop applicaton
|
|
||||||
- `Tachidesk Browser Launcher`: Launches Tachidesk in a browser window
|
|
||||||
- `Tachidesk Debug Launcher`: Launches Tachidesk with debug logs attached. If Tachidesk doesn't work for you, running this can give you insight into why.
|
|
||||||
|
|
||||||
**Node:** Linux launcher scripts are named a bit differently but work the same.
|
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
Download the latest `win32`(Windows 32-bit) or `win64`(Windows 64-bit) 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 `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).
|
||||||
|
|
||||||
Unzip the downloaded file and double click on one of the launcher scripts.
|
Unzip the downloaded file and double-click on one of the launcher scripts.
|
||||||
|
|
||||||
### macOS
|
### macOS
|
||||||
Download the latest `macOS-x64`(older macOS systems) or `macOS-arm64`(Apple M1) 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 `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.
|
Unzip the downloaded file and double-click on one of the launcher scripts.
|
||||||
|
|
||||||
### GNU/Linux
|
### GNU/Linux
|
||||||
Download the latest `linux-x64`(x86_64) 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 `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.
|
`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
|
||||||
|
### Docker
|
||||||
|
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), an example compose file can also be found there. By default, the server will be running on http://localhost:4567 open this url in your browser.
|
||||||
|
|
||||||
## Other methods of getting Tachidesk
|
|
||||||
### Arch Linux
|
### Arch Linux
|
||||||
You can install Tachidesk from the AUR
|
You can install Suwayomi from the AUR:
|
||||||
```
|
```
|
||||||
yay -S tachidesk
|
yay -S tachidesk
|
||||||
```
|
```
|
||||||
|
|
||||||
### Ubuntu-based distributions
|
### Debian/Ubuntu
|
||||||
More information can be found on the [PPA's page](https://launchpad.net/~suwayomi/+archive/ubuntu/tachidesk).
|
Download the latest deb package from the release section or Install from the MPR
|
||||||
```
|
```
|
||||||
sudo add-apt-repository ppa:suwayomi/tachidesk
|
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 update
|
||||||
sudo apt install tachidesk
|
sudo apt install suwayomi-server
|
||||||
```
|
```
|
||||||
|
|
||||||
### Docker
|
### NixOS
|
||||||
Check our Official Docker release [Tachidesk Container](https://github.com/orgs/Suwayomi/packages/container/package/tachidesk) for running Tachidesk 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.
|
You can deploy Suwayomi on NixOS using the module `services.suwayomi-server` in your configuration:
|
||||||
|
|
||||||
Install from the command line:
|
|
||||||
```
|
```
|
||||||
$ docker pull ghcr.io/suwayomi/tachidesk
|
{
|
||||||
```
|
services.suwayomi-server = {
|
||||||
Run Container from the command line:
|
enable = true;
|
||||||
```
|
};
|
||||||
$ docker run -p 4567:4567 ghcr.io/suwayomi/tachidesk
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
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).
|
||||||
|
|
||||||
## Advanced Methods
|
## Advanced Methods
|
||||||
### Running the jar release directly
|
### Running the jar release directly
|
||||||
In order to run the app you need the following:
|
In order to run the app you need the following:
|
||||||
- The jar release of Tachidesk-Server
|
- The jar release of Suwayomi-Server
|
||||||
- The Java Runtime Environment(JRE) 8 or newer
|
- The Java Runtime Environment(JRE) 21 or newer
|
||||||
- A Browser like Google Chrome, Firefox, Edge, etc.
|
- A Browser like Google Chrome, Firefox, Edge, etc.
|
||||||
- ElectronJS (optional)
|
- ElectronJS (optional)
|
||||||
|
|
||||||
Download the latest `.jar` release from [the releases section](https://github.com/Suwayomi/Tachidesk-Server/releases) or a preview jar build from [the preview repository](https://github.com/Suwayomi/Tachidesk-preview/releases).
|
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 Tachidesk-vX.Y.Z-rxxxx.jar` from a Terminal/Command Prompt window to run the app which will open a new browser window automatically.
|
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 Tachidesk Remotely
|
### Using Suwayomi Remotely
|
||||||
You can run Tachidesk 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 Tachidesk is requires 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.
|
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/Tachidesk-Server/wiki/Configuring-Tachidesk-Server) for a guide on configuring Tachidesk-Server.
|
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!).
|
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
|
## Syncing With Mihon (Tachiyomi)
|
||||||
### The Tachidesk extension
|
### The Suwayomi extension and tracker
|
||||||
- You can install the `Tachidesk` extension inside tachiyomi.
|
- You can install the `Suwayomi` extension inside Mihon (Tachiyomi).
|
||||||
- The extension will load Tachidesk library.
|
- The extension will load your Suwayomi library.
|
||||||
- By manipulating filters you can browse your categories.
|
- 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: to sync from
|
||||||
|
- Mihon (Tachiyomi) to Suwayomi: Mihon (Tachiyomi) automatically updates the chapters read status when it's updating the tracker (e.g. while reading)
|
||||||
|
- Suwayomi to Mihon (Tachiyomi): To sync Mihon (Tachiyomi) with Suwayomi, you have to open the manga's track information, then, Mihon (Tachiyomi) will automatically update its chapter list with the state from Suwayomi
|
||||||
|
|
||||||
### Other methods
|
### Other methods
|
||||||
Checkout [this issue](https://github.com/Suwayomi/Tachidesk-Server/issues/159) for tracking progress.
|
Checkout [this issue](https://github.com/Suwayomi/Suwayomi-Server/issues/159) for tracking progress.
|
||||||
|
|
||||||
## Troubleshooting and Support
|
## 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
|
## Contributing and Technical info
|
||||||
See [CONTRIBUTING.md](./CONTRIBUTING.md).
|
See [CONTRIBUTING.md](./CONTRIBUTING.md).
|
||||||
@@ -160,7 +176,7 @@ This project is a spiritual successor of [TachiWeb-Server](https://github.com/Ta
|
|||||||
|
|
||||||
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`.
|
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` and `Copyright 2015 Javier Tomás`.
|
Parts of [Mihon (Tachiyomi)](https://github.com/mihonapp/mihon) 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
|
You can obtain a copy of `Apache License Version 2.0` from http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
@@ -173,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
|
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
|
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/.
|
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.
|
||||||
|
|||||||
+29
-91
@@ -1,12 +1,14 @@
|
|||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
import org.jmailen.gradle.kotlinter.tasks.FormatTask
|
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
||||||
import org.jmailen.gradle.kotlinter.tasks.LintTask
|
import org.jlleitschuh.gradle.ktlint.KtlintExtension
|
||||||
|
import org.jlleitschuh.gradle.ktlint.KtlintPlugin
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version kotlinVersion
|
alias(libs.plugins.kotlin.jvm)
|
||||||
kotlin("plugin.serialization") version kotlinVersion
|
alias(libs.plugins.kotlin.serialization)
|
||||||
id("org.jmailen.kotlinter") version "3.8.0"
|
alias(libs.plugins.ktlint)
|
||||||
id("com.github.gmazzo.buildconfig") version "3.0.3" apply false
|
alias(libs.plugins.buildconfig) apply false
|
||||||
|
alias(libs.plugins.download)
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
@@ -17,99 +19,35 @@ allprojects {
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
|
maven("https://github.com/Suwayomi/Suwayomi-Server/raw/android-jar/")
|
||||||
maven("https://jitpack.io")
|
maven("https://jitpack.io")
|
||||||
maven("https://github.com/Suwayomi/Tachidesk-Server/raw/android-jar/")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val projects = listOf(
|
subprojects {
|
||||||
project(":AndroidCompat"),
|
plugins.withType<JavaPlugin> {
|
||||||
project(":AndroidCompat:Config"),
|
extensions.configure<JavaPluginExtension> {
|
||||||
project(":server")
|
sourceCompatibility = JavaVersion.VERSION_21
|
||||||
)
|
targetCompatibility = JavaVersion.VERSION_21
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
configure(projects) {
|
plugins.withType<KtlintPlugin> {
|
||||||
apply(plugin = "org.jetbrains.kotlin.jvm")
|
extensions.configure<KtlintExtension>("ktlint") {
|
||||||
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
|
version.set(libs.versions.ktlint.get())
|
||||||
apply(plugin = "org.jmailen.kotlinter")
|
filter {
|
||||||
|
exclude("**/generated/**")
|
||||||
java {
|
}
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
}
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
withType<KotlinCompile> {
|
withType<KotlinJvmCompile> {
|
||||||
dependsOn(formatKotlin)
|
dependsOn("ktlintFormat")
|
||||||
kotlinOptions {
|
compilerOptions {
|
||||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
jvmTarget = JvmTarget.JVM_21
|
||||||
freeCompilerArgs = listOf(
|
freeCompilerArgs.add("-Xcontext-receivers")
|
||||||
"-Xopt-in=kotlin.RequiresOptIn",
|
|
||||||
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
|
||||||
"-Xopt-in=kotlinx.coroutines.InternalCoroutinesApi",
|
|
||||||
"-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi",
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
withType<LintTask> {
|
|
||||||
source(files("src/kotlin"))
|
|
||||||
}
|
|
||||||
|
|
||||||
withType<FormatTask> {
|
|
||||||
source(files("src/kotlin"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
// Kotlin
|
|
||||||
implementation(kotlin("stdlib-jdk8"))
|
|
||||||
implementation(kotlin("reflect"))
|
|
||||||
testImplementation(kotlin("test-junit5"))
|
|
||||||
|
|
||||||
// coroutines
|
|
||||||
val coroutinesVersion = "1.6.0"
|
|
||||||
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.3.2"
|
|
||||||
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.10.0")
|
|
||||||
|
|
||||||
// Logging
|
|
||||||
implementation("org.slf4j:slf4j-api:1.7.32")
|
|
||||||
implementation("ch.qos.logback:logback-classic:1.2.6")
|
|
||||||
implementation("io.github.microutils:kotlin-logging:2.1.21")
|
|
||||||
|
|
||||||
// ReactiveX
|
|
||||||
implementation("io.reactivex:rxjava:1.3.8")
|
|
||||||
implementation("io.reactivex:rxkotlin:1.0.0")
|
|
||||||
implementation("com.jakewharton.rxrelay:rxrelay:1.2.0")
|
|
||||||
|
|
||||||
// dependency both in AndroidCompat and extensions, version locked by Tachiyomi app/extensions
|
|
||||||
implementation("org.jsoup:jsoup:1.14.3")
|
|
||||||
|
|
||||||
// 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
|
|
||||||
val dex2jarVersion = "v35"
|
|
||||||
implementation("com.github.ThexXTURBOXx.dex2jar:dex-translator:$dex2jarVersion")
|
|
||||||
implementation("com.github.ThexXTURBOXx.dex2jar:dex-tools:$dex2jarVersion")
|
|
||||||
|
|
||||||
// APK parser
|
|
||||||
implementation("net.dongliu:apk-parser:2.6.10")
|
|
||||||
|
|
||||||
// dependency both in AndroidCompat and server, version locked by javalin
|
|
||||||
implementation("com.fasterxml.jackson.core:jackson-annotations:2.12.4")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,5 +7,5 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("net.lingala.zip4j:zip4j:2.9.0")
|
implementation(libs.zip4j)
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
rootProject.name = "buildSrc"
|
||||||
|
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
versionCatalogs {
|
||||||
|
create("libs") {
|
||||||
|
from(files("../gradle/libs.versions.toml"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,27 +7,29 @@ import java.io.BufferedReader
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
const val kotlinVersion = "1.6.10"
|
|
||||||
|
|
||||||
const val MainClass = "suwayomi.tachidesk.MainKt"
|
const val MainClass = "suwayomi.tachidesk.MainKt"
|
||||||
|
|
||||||
// should be bumped with each stable release
|
// should be bumped with each stable release
|
||||||
val tachideskVersion = System.getenv("ProductVersion") ?: "v0.6.2"
|
val getTachideskVersion = { "v2.0.${getCommitCount()}" }
|
||||||
|
|
||||||
val webUIRevisionTag = System.getenv("WebUIRevision") ?: "r929"
|
val webUIRevisionTag = "r2467"
|
||||||
|
|
||||||
// counts commits on the master branch
|
private val getCommitCount = {
|
||||||
val tachideskRevision = runCatching {
|
runCatching {
|
||||||
System.getenv("ProductRevision") ?: Runtime
|
ProcessBuilder()
|
||||||
.getRuntime()
|
.command("git", "rev-list", "HEAD", "--count")
|
||||||
.exec("git rev-list HEAD --count")
|
.start()
|
||||||
.let { process ->
|
.let { process ->
|
||||||
process.waitFor()
|
process.waitFor()
|
||||||
val output = process.inputStream.use {
|
val output = process.inputStream.use {
|
||||||
it.bufferedReader().use(BufferedReader::readText)
|
it.bufferedReader().use(BufferedReader::readText)
|
||||||
|
}
|
||||||
|
process.destroy()
|
||||||
|
output.trim()
|
||||||
}
|
}
|
||||||
process.destroy()
|
}.getOrDefault("0")
|
||||||
"r" + output.trim()
|
}
|
||||||
}
|
|
||||||
}.getOrDefault("r0")
|
// counts commits on the current checked out branch
|
||||||
|
val getTachideskRevision = { "r${getCommitCount()}" }
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,239 @@
|
|||||||
|
[versions]
|
||||||
|
kotlin = "2.1.20"
|
||||||
|
coroutines = "1.10.1"
|
||||||
|
serialization = "1.8.0"
|
||||||
|
okhttp = "5.0.0-alpha.14" # Major version is locked by Tachiyomi extensions
|
||||||
|
javalin = "6.5.0"
|
||||||
|
jackson = "2.18.3" # jackson version locked by javalin, ref: `io.javalin.core.util.OptionalDependency`
|
||||||
|
exposed = "0.59.0"
|
||||||
|
dex2jar = "v64" # Stuck until https://github.com/ThexXTURBOXx/dex2jar/issues/27 is fixed
|
||||||
|
polyglot = "24.2.0"
|
||||||
|
settings = "1.3.0"
|
||||||
|
twelvemonkeys = "3.12.0"
|
||||||
|
graphqlkotlin = "8.4.0"
|
||||||
|
xmlserialization = "0.90.3"
|
||||||
|
ktlint = "1.5.0"
|
||||||
|
koin = "4.0.2"
|
||||||
|
|
||||||
|
[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", version.ref = "xmlserialization" }
|
||||||
|
serialization-xml = { module = "io.github.pdvrieze.xmlutil:serialization-jvm", version.ref = "xmlserialization" }
|
||||||
|
|
||||||
|
# Logging
|
||||||
|
slf4japi = "org.slf4j:slf4j-api:2.0.17"
|
||||||
|
logback = "ch.qos.logback:logback-classic:1.5.18"
|
||||||
|
kotlinlogging = "io.github.oshai:kotlin-logging-jvm:7.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.10.2"
|
||||||
|
|
||||||
|
# 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-java-core = "com.graphql-java:graphql-java:22.3" # Major version locked by graphql-kotlin
|
||||||
|
graphql-java-scalars = "com.graphql-java:graphql-java-extended-scalars:22.0"
|
||||||
|
|
||||||
|
# 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.7.0"
|
||||||
|
|
||||||
|
# Dependency Injection
|
||||||
|
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
|
||||||
|
|
||||||
|
# tray icon
|
||||||
|
systemtray-core = "com.dorkbox:SystemTray:4.4"
|
||||||
|
systemtray-utils = "com.dorkbox:Utilities:1.46" # version locked by SystemTray
|
||||||
|
systemtray-desktop = "com.dorkbox:Desktop:1.1" # version locked by SystemTray
|
||||||
|
|
||||||
|
# dependencies of Tachiyomi extensions
|
||||||
|
injekt = "com.github.null2264:injekt-koin:ee267b2e27"
|
||||||
|
rxjava = "io.reactivex:rxjava:1.3.8"
|
||||||
|
jsoup = "org.jsoup:jsoup:1.19.1"
|
||||||
|
|
||||||
|
# Config
|
||||||
|
config = "com.typesafe:config:1.4.3"
|
||||||
|
config4k = "io.github.config4k:config4k:0.7.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:8.9.0"
|
||||||
|
|
||||||
|
# Xml
|
||||||
|
xmlpull = "xmlpull:xmlpull:1.1.3.4a"
|
||||||
|
|
||||||
|
# Disk & File
|
||||||
|
appdirs = "net.harawata:appdirs:1.4.0"
|
||||||
|
cache4k = "io.github.reactivecircus.cache4k:cache4k:0.14.0"
|
||||||
|
zip4j = "net.lingala.zip4j:zip4j:2.11.5"
|
||||||
|
commonscompress = "org.apache.commons:commons-compress:1.27.1"
|
||||||
|
junrar = "com.github.junrar:junrar:7.5.5"
|
||||||
|
|
||||||
|
# AES/CBC/PKCS7Padding Cypher provider
|
||||||
|
bouncycastle = "org.bouncycastle:bcprov-jdk18on:1.80"
|
||||||
|
|
||||||
|
# AndroidX annotations
|
||||||
|
android-annotations = "androidx.annotation:annotation:1.9.1"
|
||||||
|
|
||||||
|
# Substitute for duktape-android
|
||||||
|
polyglot-core = { module = "org.graalvm.polyglot:polyglot", version.ref = "polyglot" }
|
||||||
|
polyglot-graaljs = { module = "org.graalvm.polyglot:js-community", version.ref = "polyglot" }
|
||||||
|
|
||||||
|
# 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:77.1"
|
||||||
|
|
||||||
|
# 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.17"
|
||||||
|
|
||||||
|
# cron scheduler
|
||||||
|
cron4j = "it.sauronsoftware.cron4j:cron4j:2.2.5"
|
||||||
|
|
||||||
|
# cron-utils
|
||||||
|
cronUtils = "com.cronutils:cron-utils:9.2.1"
|
||||||
|
|
||||||
|
# lint - used for renovate to update ktlint version
|
||||||
|
ktlint = { module = "com.pinterest.ktlint:ktlint-cli", version.ref = "ktlint" }
|
||||||
|
|
||||||
|
[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 = "12.2.0"}
|
||||||
|
|
||||||
|
# Build config
|
||||||
|
buildconfig = { id = "com.github.gmazzo.buildconfig", version = "5.5.4"}
|
||||||
|
|
||||||
|
# Download
|
||||||
|
download = { id = "de.undercouch.download", version = "5.6.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",
|
||||||
|
"koin-core",
|
||||||
|
"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"
|
||||||
|
]
|
||||||
|
polyglot = [
|
||||||
|
"polyglot-core",
|
||||||
|
"polyglot-graaljs",
|
||||||
|
]
|
||||||
|
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.
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright © 2015-2021 the original authors.
|
# Copyright © 2015-2021 the original authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -32,10 +34,10 @@
|
|||||||
# Busybox and similar reduced shells will NOT work, because this script
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
# requires all of these POSIX shell features:
|
# requires all of these POSIX shell features:
|
||||||
# * functions;
|
# * functions;
|
||||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
# * compound commands having a testable exit status, especially «case»;
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
# * various built-in commands including «command», «set», and «ulimit».
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
#
|
#
|
||||||
# Important for patching:
|
# Important for patching:
|
||||||
#
|
#
|
||||||
@@ -55,7 +57,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (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
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -80,13 +82,11 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@@ -133,22 +133,29 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
else
|
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.
|
if ! command -v java >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
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
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@@ -193,11 +200,15 @@ if "$cygwin" || "$msys" ; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
# double quotes to make sure that they get re-expanded; and
|
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# Collect all arguments for the java command:
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
|
# and any embedded shellness will be escaped.
|
||||||
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
@@ -205,6 +216,12 @@ set -- \
|
|||||||
org.gradle.wrapper.GradleWrapperMain \
|
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.
|
# Use "xargs" to parse quoted args.
|
||||||
#
|
#
|
||||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
|||||||
Vendored
+21
-16
@@ -13,8 +13,10 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@@ -25,7 +27,8 @@
|
|||||||
if "%OS%"=="Windows_NT" setlocal
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
@@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
|||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if "%ERRORLEVEL%" == "0" goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -56,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -75,13 +78,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
|
|
||||||
:fail
|
:fail
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
rem the _cmd.exe /c_ return code!
|
rem the _cmd.exe /c_ return code!
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
exit /b 1
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
|
exit /b %EXIT_CODE%
|
||||||
|
|
||||||
:mainEnd
|
:mainEnd
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": [
|
||||||
|
"config:recommended"
|
||||||
|
],
|
||||||
|
"semanticCommits": "disabled",
|
||||||
|
"customManagers": [
|
||||||
|
{
|
||||||
|
"customType": "regex",
|
||||||
|
"fileMatch": [
|
||||||
|
"scripts/bundler.sh"
|
||||||
|
],
|
||||||
|
"matchStrings": [
|
||||||
|
"JRE_RELEASE=[\"'](?<currentValue>.+?)[\"']\\s+"
|
||||||
|
],
|
||||||
|
"datasourceTemplate": "github-releases",
|
||||||
|
"depNameTemplate": "adoptium/temurin21-binaries",
|
||||||
|
"versioningTemplate": "regex:^jdk-?(?<major>\\d+).(?<minor>\\d+).+?(?<patch>[\\d+]+)$"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Executable
+313
@@ -0,0 +1,313 @@
|
|||||||
|
#!/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=$(echo "$JAR" | grep -oP "v\K[0-9]+\.[0-9]+\.[0-9]+")
|
||||||
|
#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/temurin21-binaries/releases/
|
||||||
|
JRE_RELEASE="jdk-21.0.6+7"
|
||||||
|
JRE="OpenJDK21U-jre_x64_linux_hotspot_$(echo "$JRE_RELEASE" | sed 's/jdk//;s/-//g;s/+/_/g').tar.gz"
|
||||||
|
JRE_DIR="$JRE_RELEASE-jre"
|
||||||
|
JRE_URL="https://github.com/adoptium/temurin21-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_electron
|
||||||
|
setup_jre
|
||||||
|
tree "$RELEASE_NAME"
|
||||||
|
|
||||||
|
RELEASE="$RELEASE_NAME.tar.gz"
|
||||||
|
make_linux_bundle
|
||||||
|
move_release_to_output_dir
|
||||||
|
;;
|
||||||
|
macOS-x64)
|
||||||
|
# https://github.com/adoptium/temurin21-binaries/releases/
|
||||||
|
JRE_RELEASE="jdk-21.0.6+7"
|
||||||
|
JRE="OpenJDK21U-jre_x64_mac_hotspot_$(echo "$JRE_RELEASE" | sed 's/jdk//;s/-//g;s/+/_/g').tar.gz"
|
||||||
|
JRE_DIR="$JRE_RELEASE-jre"
|
||||||
|
JRE_URL="https://github.com/adoptium/temurin21-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_electron
|
||||||
|
setup_jre
|
||||||
|
tree "$RELEASE_NAME"
|
||||||
|
|
||||||
|
RELEASE="$RELEASE_NAME.tar.gz"
|
||||||
|
make_macos_bundle
|
||||||
|
move_release_to_output_dir
|
||||||
|
;;
|
||||||
|
macOS-arm64)
|
||||||
|
# https://github.com/adoptium/temurin21-binaries/releases/
|
||||||
|
JRE_RELEASE="jdk-21.0.6+7"
|
||||||
|
JRE="OpenJDK21U-jre_aarch64_mac_hotspot_$(echo "$JRE_RELEASE" | sed 's/jdk//;s/-//g;s/+/_/g').tar.gz"
|
||||||
|
JRE_DIR="$JRE_RELEASE-jre"
|
||||||
|
JRE_URL="https://github.com/adoptium/temurin21-binaries/releases/download/$JRE_RELEASE/$JRE"
|
||||||
|
ELECTRON="electron-$electron_version-darwin-arm64.zip"
|
||||||
|
ELECTRON_URL="https://github.com/electron/electron/releases/download/$electron_version/$ELECTRON"
|
||||||
|
download_electron
|
||||||
|
setup_jre
|
||||||
|
tree "$RELEASE_NAME"
|
||||||
|
|
||||||
|
RELEASE="$RELEASE_NAME.tar.gz"
|
||||||
|
make_macos_bundle
|
||||||
|
move_release_to_output_dir
|
||||||
|
;;
|
||||||
|
windows-x64)
|
||||||
|
# https://github.com/adoptium/temurin21-binaries/releases/
|
||||||
|
JRE_RELEASE="jdk-21.0.6+7"
|
||||||
|
JRE="OpenJDK21U-jre_x64_windows_hotspot_$(echo "$JRE_RELEASE" | sed 's/jdk//;s/-//g;s/+/_/g').zip"
|
||||||
|
JRE_DIR="$JRE_RELEASE-jre"
|
||||||
|
JRE_URL="https://github.com/adoptium/temurin21-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_electron
|
||||||
|
setup_jre
|
||||||
|
tree "$RELEASE_NAME"
|
||||||
|
|
||||||
|
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_electron() {
|
||||||
|
if [ ! -f "$ELECTRON" ]; then
|
||||||
|
curl -L "$ELECTRON_URL" -o "$ELECTRON"
|
||||||
|
fi
|
||||||
|
|
||||||
|
unzip "$ELECTRON" -d "$RELEASE_NAME/electron/"
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_jre() {
|
||||||
|
if [ -d "jre" ]; then
|
||||||
|
chmod +x ./jre/bin/java
|
||||||
|
chmod +x ./jre/lib/jspawnhelper
|
||||||
|
mv "jre" "$RELEASE_NAME/jre"
|
||||||
|
else
|
||||||
|
if [ ! -f "$JRE" ]; then
|
||||||
|
curl -L "$JRE_URL" -o "$JRE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local ext="${JRE##*.}"
|
||||||
|
if [ "$ext" = "zip" ]; then
|
||||||
|
unzip "$JRE"
|
||||||
|
else
|
||||||
|
tar xvf "$JRE"
|
||||||
|
fi
|
||||||
|
mv "$JRE_DIR" "$RELEASE_NAME/jre"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
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() {
|
||||||
|
mkdir "$RELEASE_NAME/bin"
|
||||||
|
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() {
|
||||||
|
mkdir "$RELEASE_NAME/bin"
|
||||||
|
cp "$JAR" "$RELEASE_NAME/bin/Suwayomi-Server.jar"
|
||||||
|
cp "scripts/resources/Suwayomi Launcher.command" "$RELEASE_NAME/"
|
||||||
|
|
||||||
|
tar -I "gzip -9" -cvf "$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"
|
||||||
|
|
||||||
|
mkdir "$RELEASE_NAME/bin"
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
@@ -1,51 +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/.
|
|
||||||
|
|
||||||
echo "Creating DEB Package"
|
|
||||||
pkgname="tachidesk-server"
|
|
||||||
PkgName="Tachidesk-Server"
|
|
||||||
jar=$(ls ../server/build/*.jar | tail -n1)
|
|
||||||
pkgver="$(tmp="${jar%-*}" && echo "${tmp##*-}" | tr -d v)"
|
|
||||||
pkgrel=1
|
|
||||||
|
|
||||||
srcdir="$pkgname-$pkgver" # uses hyphen "-"
|
|
||||||
srctgz="${pkgname}_$pkgver.orig.tar.gz" # uses underscore "_"
|
|
||||||
deb="${pkgname}_$pkgver-${pkgrel}_all.deb"
|
|
||||||
Deb="${PkgName}_$pkgver-${pkgrel}_all.deb"
|
|
||||||
|
|
||||||
# Prepare
|
|
||||||
mkdir "$srcdir/"
|
|
||||||
cp "$jar" "$srcdir/$pkgname.jar"
|
|
||||||
cp "resources/$pkgname-browser-launcher.sh" "$srcdir/"
|
|
||||||
cp "resources/$pkgname-debug-launcher.sh" "$srcdir/"
|
|
||||||
cp "resources/$pkgname-electron-launcher-debian.sh" "$srcdir/$pkgname-electron-launcher.sh"
|
|
||||||
cp "resources/$pkgname.desktop" "$srcdir/"
|
|
||||||
cp "../server/src/main/resources/icon/faviconlogo.png" "$srcdir/$pkgname.png"
|
|
||||||
|
|
||||||
GZIP=-9 tar -cvzf "$srctgz" "$srcdir/"
|
|
||||||
|
|
||||||
cp -r "resources/debian" "$srcdir/"
|
|
||||||
sed -i "s/\${pkgver}/$pkgver/" "$srcdir/debian/changelog"
|
|
||||||
sed -i "s/\${pkgrel}/$pkgrel/" "$srcdir/debian/changelog"
|
|
||||||
|
|
||||||
# Build
|
|
||||||
mkdir "debuild/"
|
|
||||||
mv "$srctgz" "$srcdir/" "debuild/"
|
|
||||||
sudo apt install devscripts build-essential dh-exec
|
|
||||||
# --lintian-opts --profile are for building Debian packages on Ubuntu
|
|
||||||
cd "debuild/$srcdir/debian"
|
|
||||||
debuild -uc -us --lintian-opts --profile debian
|
|
||||||
cd -
|
|
||||||
|
|
||||||
# clean up from possible previous runs
|
|
||||||
if [ -f "../server/build/$Deb" ]; then
|
|
||||||
rm "../server/build/$Deb"
|
|
||||||
fi
|
|
||||||
|
|
||||||
mv "debuild/$deb" "../server/build/$Deb"
|
|
||||||
rm -rf "debuild/"
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
start "" jre/bin/javaw -jar Suwayomi-Launcher.jar
|
||||||
Executable
+3
@@ -0,0 +1,3 @@
|
|||||||
|
cd "`dirname "$0"`"
|
||||||
|
|
||||||
|
./jre/bin/java -jar Suwayomi-Launcher.jar
|
||||||
@@ -1 +0,0 @@
|
|||||||
start "" jre/bin/javaw -jar Tachidesk.jar
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
cd "`dirname "$0"`"
|
|
||||||
|
|
||||||
./jre/Contents/Home/bin/java -jar Tachidesk.jar
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
:: cleaner output
|
|
||||||
@echo off
|
|
||||||
|
|
||||||
jre\bin\java -Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true -jar Tachidesk.jar
|
|
||||||
|
|
||||||
:: Prevent cmd from closing when Tachidesk crashes
|
|
||||||
pause
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
cd "`dirname "$0"`"
|
|
||||||
|
|
||||||
./jre/Contents/Home/bin/java -Dsuwayomi.tachidesk.config.server.debugLogsEnabled=true -jar Tachidesk.jar
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
jre\bin\javaw "-Dsuwayomi.tachidesk.config.server.webUIInterface=electron" "-Dsuwayomi.tachidesk.config.server.electronPath=electron/electron.exe" -jar Tachidesk.jar
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
cd "`dirname "$0"`"
|
|
||||||
|
|
||||||
./jre/Contents/Home/bin/java "-Dsuwayomi.tachidesk.config.server.webUIInterface=electron" "-Dsuwayomi.tachidesk.config.server.electronPath=electron/Electron.app/Contents/MacOS/Electron" -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}, openjdk-21-jre, 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.
|
||||||
Executable → Regular
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
Upstream-Name: tachidesk-server
|
Upstream-Name: suwayomi-server
|
||||||
Upstream-Contact: https://discord.gg/DDZdqZWaHA
|
Upstream-Contact: https://discord.gg/DDZdqZWaHA
|
||||||
Source: https://github.com/Suwayomi/Tachidesk-Server
|
Source: https://github.com/Suwayomi/Suwayomi-Server
|
||||||
|
|
||||||
Files: *
|
Files: *
|
||||||
Copyright: Contributors to the Suwayomi project
|
Copyright: Contributors to the Suwayomi project
|
||||||
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 → Regular
@@ -0,0 +1 @@
|
|||||||
|
suwayomi-server.png
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
tachidesk-server (${pkgver}-${pkgrel}) unstable; urgency=medium
|
|
||||||
|
|
||||||
* See CHANGELOG.md on https://github.com/Suwayomi/Tachidesk-Server
|
|
||||||
|
|
||||||
-- Mahor Foruzesh <mahorforuzesh@pm.me> Fri, 14 Jan 2022 00:00:00 +0000
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
Source: tachidesk-server
|
|
||||||
Section: web
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: Mahor Foruzesh <mahorforuzesh@pm.me>
|
|
||||||
Build-Depends: debhelper-compat (= 12), dh-exec
|
|
||||||
Standards-Version: 4.5.1
|
|
||||||
Homepage: https://github.com/Suwayomi/Tachidesk-Server
|
|
||||||
|
|
||||||
Package: tachidesk-server
|
|
||||||
Architecture: all
|
|
||||||
Depends: ${misc:Depends}, default-jre-headless (>= 8)
|
|
||||||
Description: Manga Reader
|
|
||||||
A free and open source manga reader server that runs extensions built for Tachiyomi.
|
|
||||||
Tachidesk is an independent Tachiyomi compatible software and is not a Fork of Tachiyomi.
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/dh-exec
|
|
||||||
|
|
||||||
tachidesk-server-browser-launcher.sh => usr/bin/tachidesk-server-browser
|
|
||||||
tachidesk-server-debug-launcher.sh => usr/bin/tachidesk-server-debug
|
|
||||||
tachidesk-server-electron-launcher.sh => usr/bin/tachidesk-server-electron
|
|
||||||
tachidesk-server.jar usr/share/java/tachidesk-server/
|
|
||||||
tachidesk-server.png usr/share/pixmaps/
|
|
||||||
tachidesk-server.desktop usr/share/applications/
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
tachidesk-server.png
|
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||||
|
<Product Id="*" UpgradeCode="174c8f36-0bec-4585-9ddd-469c3d889dc1"
|
||||||
|
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>
|
||||||
|
|
||||||
|
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
|
||||||
|
|
||||||
|
<!-- 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>
|
||||||
|
|
||||||
|
<InstallExecuteSequence>
|
||||||
|
<RemoveExistingProducts After="InstallValidate" />
|
||||||
|
</InstallExecuteSequence>
|
||||||
|
|
||||||
|
<!-- 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>
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
<?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="Tachidesk Server" Manufacturer="Suwayomi">
|
|
||||||
<Package InstallerVersion="300" Compressed="yes" />
|
|
||||||
<Media Id="1" Cabinet="Tachidesk_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="Tachidesk-Server" >
|
|
||||||
<Directory Id="jre"/>
|
|
||||||
<Directory Id="electron"/>
|
|
||||||
</Directory>
|
|
||||||
</Directory>
|
|
||||||
<Directory Id="ProgramMenuFolder">
|
|
||||||
<Directory Id="ProgramMenuDir" Name="Tachidesk-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="TachideskJAR" Guid="*" Win64="yes">
|
|
||||||
<File Id="Tachidesk.jar" Source="$(var.SourceDir)/Tachidesk.jar" KeyPath="yes" />
|
|
||||||
</Component>
|
|
||||||
|
|
||||||
<Component Id="TachideskBrowserBAT" Guid="*" Win64="yes">
|
|
||||||
<File Id="TachideskBrowser.bat" Source="$(var.SourceDir)/Tachidesk Browser Launcher.bat" KeyPath="yes" >
|
|
||||||
<Shortcut Id="TachideskBrowser.lnk" Name="Tachidesk Browser" Directory="INSTALLDIR"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes" />
|
|
||||||
<Shortcut Id="DesktopTachideskBrowser.lnk" Name="Tachidesk Browser" Directory="DesktopFolder"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes" />
|
|
||||||
<Shortcut Id="ProgramMenuTachideskBrowser.lnk" Name="Tachidesk Browser" Directory="ProgramMenuDir"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes"
|
|
||||||
Description="A free and open source manga reader that runs extensions built for Tachiyomi." />
|
|
||||||
</File>
|
|
||||||
</Component>
|
|
||||||
|
|
||||||
<Component Id="TachideskDebugBAT" Guid="*" Win64="yes">
|
|
||||||
<File Id="TachideskDebug.bat" Source="$(var.SourceDir)/Tachidesk Debug Launcher.bat" KeyPath="yes">
|
|
||||||
<Shortcut Id="TachideskDebug.lnk" Name="Tachidesk Debug" Directory="INSTALLDIR"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes" />
|
|
||||||
<Shortcut Id="ProgramMenuTachideskDebug.lnk" Name="Tachidesk Debug" Directory="ProgramMenuDir"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes"
|
|
||||||
Description="Launches Tachidesk with debug logs attached. If Tachidesk doesn't work for you, running this can give you insight into why." />
|
|
||||||
</File>
|
|
||||||
</Component>
|
|
||||||
|
|
||||||
<Component Id="TachideskElectronBAT" Guid="*" Win64="yes">
|
|
||||||
<File Id="TachideskElectron.bat" Source="$(var.SourceDir)/Tachidesk Electron Launcher.bat" KeyPath="yes">
|
|
||||||
<Shortcut Id="TachideskElectron.lnk" Name="Tachidesk Electron" Directory="INSTALLDIR"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes" />
|
|
||||||
<Shortcut Id="DesktopTachideskElectron.lnk" Name="Tachidesk Electron" Directory="DesktopFolder"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes" />
|
|
||||||
<Shortcut Id="ProgramMenuTachideskElectron.lnk" Name="Tachidesk Electron" Directory="ProgramMenuDir"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes"
|
|
||||||
Description="Launches Tachidesk inside Electron as a desktop applicaton." />
|
|
||||||
</File>
|
|
||||||
</Component>
|
|
||||||
</DirectoryRef>
|
|
||||||
|
|
||||||
<!-- Feature -->
|
|
||||||
<Feature Id="Tachidesk_Server" Title="Tachidesk-Server" Level="1">
|
|
||||||
<ComponentGroupRef Id="jre" />
|
|
||||||
<ComponentRef Id="TachideskJAR" />
|
|
||||||
<ComponentRef Id="TachideskBrowserBAT" />
|
|
||||||
<ComponentRef Id="TachideskDebugBAT" />
|
|
||||||
<ComponentRef Id="ProgramMenuDir" />
|
|
||||||
<ComponentGroupRef Id="electron" />
|
|
||||||
<ComponentRef Id="TachideskElectronBAT" />
|
|
||||||
</Feature>
|
|
||||||
|
|
||||||
<Icon Id="Tachidesk.ico" SourceFile="$(var.Icon)" />
|
|
||||||
<Property Id="ARPPRODUCTICON" Value="Tachidesk.ico" /> <!-- Icon in Add/Remove Programs -->
|
|
||||||
</Product>
|
|
||||||
</Wix>
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
<?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="Tachidesk Server" Manufacturer="Suwayomi">
|
|
||||||
<Package InstallerVersion="300" Compressed="yes" />
|
|
||||||
<Media Id="1" Cabinet="Tachidesk_Server.cab" EmbedCab="yes" />
|
|
||||||
|
|
||||||
<!-- Directory -->
|
|
||||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
|
||||||
<Directory Id="ProgramFilesFolder">
|
|
||||||
<Directory Id="INSTALLDIR" Name="Tachidesk-Server" >
|
|
||||||
<Directory Id="jre"/>
|
|
||||||
<Directory Id="electron"/>
|
|
||||||
</Directory>
|
|
||||||
</Directory>
|
|
||||||
<Directory Id="ProgramMenuFolder">
|
|
||||||
<Directory Id="ProgramMenuDir" Name="Tachidesk-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="TachideskJAR" Guid="*">
|
|
||||||
<File Id="Tachidesk.jar" Source="$(var.SourceDir)/Tachidesk.jar" KeyPath="yes" />
|
|
||||||
</Component>
|
|
||||||
|
|
||||||
<Component Id="TachideskBrowserBAT" Guid="*">
|
|
||||||
<File Id="TachideskBrowser.bat" Source="$(var.SourceDir)/Tachidesk Browser Launcher.bat" KeyPath="yes" >
|
|
||||||
<Shortcut Id="TachideskBrowser.lnk" Name="Tachidesk Browser" Directory="INSTALLDIR"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes" />
|
|
||||||
<Shortcut Id="DesktopTachideskBrowser.lnk" Name="Tachidesk Browser" Directory="DesktopFolder"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes" />
|
|
||||||
<Shortcut Id="ProgramMenuTachideskBrowser.lnk" Name="Tachidesk Browser" Directory="ProgramMenuDir"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes"
|
|
||||||
Description="A free and open source manga reader that runs extensions built for Tachiyomi." />
|
|
||||||
</File>
|
|
||||||
</Component>
|
|
||||||
|
|
||||||
<Component Id="TachideskDebugBAT" Guid="*">
|
|
||||||
<File Id="TachideskDebug.bat" Source="$(var.SourceDir)/Tachidesk Debug Launcher.bat" KeyPath="yes">
|
|
||||||
<Shortcut Id="TachideskDebug.lnk" Name="Tachidesk Debug" Directory="INSTALLDIR"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes" />
|
|
||||||
<Shortcut Id="ProgramMenuTachideskDebug.lnk" Name="Tachidesk Debug" Directory="ProgramMenuDir"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes"
|
|
||||||
Description="Launches Tachidesk with debug logs attached. If Tachidesk doesn't work for you, running this can give you insight into why." />
|
|
||||||
</File>
|
|
||||||
</Component>
|
|
||||||
|
|
||||||
<Component Id="TachideskElectronBAT" Guid="*">
|
|
||||||
<File Id="TachideskElectron.bat" Source="$(var.SourceDir)/Tachidesk Electron Launcher.bat" KeyPath="yes">
|
|
||||||
<Shortcut Id="TachideskElectron.lnk" Name="Tachidesk Electron" Directory="INSTALLDIR"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes" />
|
|
||||||
<Shortcut Id="DesktopTachideskElectron.lnk" Name="Tachidesk Electron" Directory="DesktopFolder"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes" />
|
|
||||||
<Shortcut Id="ProgramMenuTachideskElectron.lnk" Name="Tachidesk Electron" Directory="ProgramMenuDir"
|
|
||||||
WorkingDirectory="INSTALLDIR" Icon="Tachidesk.ico" IconIndex="0" Advertise="yes"
|
|
||||||
Description="Launches Tachidesk inside Electron as a desktop applicaton." />
|
|
||||||
</File>
|
|
||||||
</Component>
|
|
||||||
</DirectoryRef>
|
|
||||||
|
|
||||||
<!-- Feature -->
|
|
||||||
<Feature Id="Tachidesk_Server" Title="Tachidesk-Server" Level="1">
|
|
||||||
<ComponentGroupRef Id="jre" />
|
|
||||||
<ComponentRef Id="TachideskJAR" />
|
|
||||||
<ComponentRef Id="TachideskBrowserBAT" />
|
|
||||||
<ComponentRef Id="TachideskDebugBAT" />
|
|
||||||
<ComponentRef Id="ProgramMenuDir" />
|
|
||||||
<ComponentGroupRef Id="electron" />
|
|
||||||
<ComponentRef Id="TachideskElectronBAT" />
|
|
||||||
</Feature>
|
|
||||||
|
|
||||||
<Icon Id="Tachidesk.ico" SourceFile="$(var.Icon)" />
|
|
||||||
<Property Id="ARPPRODUCTICON" Value="Tachidesk.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
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user