Package com.topjohnwu.superuser
Class Shell.Initializer
java.lang.Object
com.topjohnwu.superuser.Shell.Initializer
- Enclosing class:
- Shell
The initializer when a new
Shell
is constructed.
This is an advanced feature. If you need to run specific operations when a new Shell
is constructed, extend this class, add your own implementation, and register it with
Shell.Builder.setInitializers(Class[])
.
The concept is similar to .bashrc
: run specific scripts/commands when the shell
starts up. onInit(Context, Shell)
will be called as soon as the shell is
constructed and tested as a valid shell.
An initializer will be constructed and the callbacks will be invoked each time a new shell is created.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Initializer
public Initializer()
-
-
Method Details
-
onInit
Called when a new shell is constructed.- Parameters:
context
- the application context.shell
- the newly constructed shell.- Returns:
false
when initialization fails, otherwisetrue
.
-