A framework for rhino.
git clone https://github.com/npofsi/PowerLauncher.git
cd PowerLauncher
Now,you can write your own JS file in ./source
and put assets in ./assets
Then build it and get Release Edition from ./release
run ./build.js
or ./beta.js
in createjs
./release/Name-versionName.js
Certainly,you can pack it into an apk with createjs|autojs.
important
Please write "
//
" at the end of .js files to avoid illegal character exception.
./assets/*(name)
icon/icon.png|
src.mp4 |}PL.a(name)
... |
./source/*(name)(.js)
init(.js)|
main(.js)|}PL.i(name)&PL.c(name)
... |
Get byte array of file:
PL.a("icon/icon.png")
Import script in function:
var init = PL.i("init") //no ".js"
Run script in function:
PL.i("init")() //no ".js"
Get script source code:
var code=PL.c("init")//no ".js"
Run script in global field:
rewrite the package.json
{
...
"entrance":["main","beforemain","beforebeforemain"],
...
}
Use dexClass( 感谢 @那个谁 的帮助 ):
Place dex file in ./libs/dex/
.
Place so file in ./libs/so/
.
Edit libs.json
to set label for dex&so file.
var DexClassLoader=PL.x(DexLabel,SoLabel);
var Class=DexClassLoader.loadClass("ClassName");
Logger:
rewrite the logLevel : dev
to logLevel : rel
to close logger.
PL.l("Log")
Adapt to autojs:
rewrite the package.json
{
...
"ajmode":"ui"
...
}