public boolean appInstall(Context context, File files) { PrintWriter PrintWriter = null; Process process = null; try { process = Runtime.getRuntime().exec("su"); PrintWriter = new PrintWriter(process.getOutputStream()); PrintWriter.println("chmod 777 " + files); PrintWriter.println("export LD_LIBRARY_PATH=/vendor/lib:/system/lib"); PrintWriter.println("pm install -r " + files); PrintWriter.flush(); PrintWriter.close(); int value = process.waitFor(); return value == 0 ? true : false; } catch (Exception e) { e.printStackTrace(); } finally { if (process != null) { process.destroy(); } } return true; }
Android--应用静默安装
最新推荐文章于 2022-11-09 14:56:46 发布