登录
  • 欢迎访问 Sharezer Blog

Android查看自己的应用签名及三方APK签名信息

一、查看自己的应用签名: 首先在Terminal控制台中,输入:keytool -list -keystore -v -keystore + jks文件的绝对路径, keytool -list -keystore -v -keystore C:\Users\Administrator\Desktop\test.jks .输入密钥库命令:(这里输入的就是你设置的密码,千万别说你忘记了) 然后就可以查看指纹证书了 二、查看三方的APK签名信息: 用winrar或7-zip等压缩工具打开待查看的apk,将其中META-INF文件夹解压出来,得到其中的CERT.RSA文件(例子:CER……继续阅读 »

sharezer 6年前 (2018-06-01) 4580浏览 0评论 1个赞

Android 单例模式最好的写法

一般来说,通常写法是这样的: public class Singleton { private static Singleton instance; private Singleton (){} public static Singleton getInstance() { if (instance == null) { instance = new Singleton(); } return instance; } } 这种写法线程不安全,所以有的是加线程锁,加了之后是这样的: pub……继续阅读 »

sharezer 6年前 (2018-05-28) 2150浏览 0评论 0个赞

I420Frame转YuvImage

private YuvImage i420ToYuvImage(ByteBuffer[] yuvPlanes, int[] yuvStrides, int width, int height) { if (yuvStrides[0] != width) { return fastI420ToYuvImage(yuvPlanes, yuvStrides, width, height); } if (yuvStrides[1] != width / 2) { return fastI420ToYuvImage(yuvPlanes, yuvSt……继续阅读 »

sharezer 7年前 (2017-07-13) 2382浏览 0评论 0个赞

通过adb获取task id

/** * 通过包名获取task id,不存在为-1 * * @param packageName * @return */ public int getTaskId(String packageName) { String result = execRootCmd("dumpsys activity | grep " + packageName); int start = result.indexOf("TaskRecord{"); if(start > 0){ int end = result……继续阅读 »

sharezer 7年前 (2017-07-03) 3388浏览 0评论 0个赞

adb获取应用的pid

这里使用的是ps命令,不用root或系统权限。 public int getPid(String name) { String cmd = ("ps | grep " + name); String str = execRootCmd(cmd); if (str == null || str == "" || str.length() < 1) return -1; else { String[] arr = str.split("\\s+"); ……继续阅读 »

sharezer 7年前 (2017-06-02) 3347浏览 0评论 5个赞

Android 执行su命令

// 执行命令并且输出结果 private String execRootCmd(String cmd) { Log.d(TAG, "cmd: " + cmd); String result = ""; DataOutputStream dos = null; DataInputStream dis = null; try { Process p = Runtime.getRuntime().exec("su");// 经过Root处理的android系统即有su命令 ……继续阅读 »

sharezer 7年前 (2017-06-02) 2488浏览 0评论 2个赞