首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Java > 简单的工具来标志一个罐子

简单的工具来标志一个罐子

  • 资源大小:8.16 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: 简单 工具 一个 标志 罐子

资 源 简 介

create a signed jar in quick way. It can run directly on android devices. Here is an example ``` // sign asset/unsigned.apk and install it public void a(Context ctx, File orgJar) { // create a tmp dir for extract content in unsigend.jar final File dir = ctx.getDir("tmp", Context.MODE_PRIVATE); InputStream in = ctx.getAssets().open("unsigned.apk"); // do extract to tmp dir extract(in, dir); in.close(); File distFile = ctx.getFileStreamPath("signed.apk"); FileOutputStream fos = new FileOutputStream(distFile); // do sign TinySign.sign(dir, fos); fos.close(); // install it Intent promptInstall = new Intent(Intent.ACTION_VIEW); promptInstall.setDataAndType(Uri.fromFile(distFile), "application/vnd.android.package-archive"); ctx.startActivity(promptInstall); } public static void extract(InputStream in, File dir) throws IOException { ZipInputStream zis = new ZipInputStream(in); for (ZipEntry e = zis.getNextEntry(); e !
VIP VIP
0.176238s