导入jar包不需要dll
下载root.bat放在D盘
获取电池电量
package information;
import org.jsoup.Jsoup;
import org.jsoup.select.Elements;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
public class Test1 {
public static void main(String[] args) throws InterruptedException, IOException {
Runtime.getRuntime().exec("D:\\root.bat").getInputStream().readAllBytes();//获取管理员权限
Runtime.getRuntime().exec("powercfg /batteryreport");//生成电池信息
String s;
while (true) {
try {