This article was reproduced from: https://www.zybuluo.com/oro-oro/note/142707
JEB API
Official address: https://www.pnfsoftware.com/apidoc/
Local Path: Jeb/doc
1. Iscript
This is the interface of the Jeb script, which supports both Java and Python, and the following examples are explained in Python.
Any Jeb script must implement this interface. The class of any script must be like the file name, similar to Java.
Iscript There is only one method, the entrance to the script, equivalent to the main function.
Run (jebinstance instance) Script entry point.
Write a Hello world.
-hello.py
#Coding:utf-8 fromJeb.apiImportIscriptclassHello (iscript):defrun (self, Jeb): Jeb.Print("Hello world!") Jeb.Print(U"Hello, JEB, I'm here too ...") Jeb.Print("Hello, JEB, I'm here too ...")
Open Jeb,file. Run script and select the script to execute.
Hello World!
你好,JEB,我来也……
?? ?¥????JEB????????¥?1?a?|a?|
Chinese strings are preceded by U, otherwise the display will be garbled.
2. Jebinstance
The Run method passes in an JebInstance
object.
It is the instantiation of Jeb, which is done in Jeb, such as Disassembly, decompile, renaming method names, renaming class names, and so on.
The following is a list of methods of interest, other detailed reference JEBAPI documentation.
Method |
Description |
Getdex () |
Get the Dex object, Jeb.api.dex.Dex |
Print (java.lang.String s) |
Print a string at the Jeb terminal |
Renameclass (java.lang.String partial_sig, java.lang.String new_name) |
Rename class name |
Renamefield (java.lang.String partial_sig, java.lang.String new_name) |
Rename variable name |
Renamemethod (java.lang.String partial_sig, java.lang.String new_name) |
Rename Method name |
Getui () |
Get the Jeb Interface interface |
Reproduced 1. Jebapi's Jeb.api