JPype is a tool that allows Python code to easily call Java code.

JvmPath = jpype.getDefaultJvmpath () Jvmpath gets the jvm.dll path

JarPath = './tools/unidbg-android.jar' JarPath is the path to the jar package to call

jpype.startJVM(jvmPath, "-ea", "-djava.class. path=%s" % jarpath," -dfile.encoding =utf-8",convertStrings=True) The startJVM() function starts the Java virtual machine (instantiation) -dfile.encoding =utf-8 ConvertStrings is added when the result of the run is different from that of debugging to indicate whether to convert a Java type string to a Python type string when a dependent JAR exists, Be sure to use the -djava.ext.dirs parameter for import

JClass = jpype.jClass (' com.du_app.du_sign ')(False) Class instantiates False: If the class does not pass an argument, it can not write it

JClass.encodebyte (sb2).strip(" "") calls the method with arguments

Jpype.shutdownJVM () # Shut down the virtual machine