- This repository is a template repository for the extension system of the project
fas-rs
. - This repository is also a template repository for the
magisk/ksu
module, because thefas-rs
extension is recommended to exist as a stand-alone module.
- The extension script is self-documenting, check the corresponding version of
main.lua
for API description fas-rs
is committed to maintain backwards compatibility. That is, even if the extension API is updated in newerfas-rs
, the old extension can still work normally.
extension api | Minimum fas-rs version |
---|---|
v0 (default when no api version is declared) | v2.3.0 |
v1 | v3.0.0 |
v2 | v3.2.0 |
v3 | v3.6.0 |
v4 | v4.2.0 |
- The standard of the
magisk/ksu
module can refer to the Magisk Official Description, the module template of this repository is ready to use out of the box, if there is no special need to modify the module name and main.lua. - The code that the extension is actually called by fas-rs should be all written in main.lua.
- main.lua is self-documented and contains instructions on how to write extension scripts.
- Remember to change module/module.prop to change the module name > module id
- Run python ./package.py to package the module, which is located in the output folder after packaging.
- ps: You can check the output of
getprop fas-rs-installed
to confirm if the user has installedfas-rs
.
-
Why is it recommended to develop extensions in the form of
magisk/ksu
module?- There are the following reasons:
- The ID of the module is unique, so conflicts caused by duplicate names of extensions are avoided.
- Convenient for users to manage extensions.
- Easy to do dependency checking, e.g. templates refuse to be installed.
-
Is it possible to create a extension in other ways/What is the most basic way to register a extension?
- Copy the lua script with the suffix
.lua
to the/dev/fas_rs/extensions
folder (when it appears) with the same requirements as the documentation and main.lua. - When deleting/creating/modifying a lua script under
/dev/fas_rs/extensions
,fas-rs
will re-read all extension scripts, which means that the extension can be updated instantly.
- Copy the lua script with the suffix