App签名

待续

import java.math.BigInteger;
import java.util.Base64;

public class Main {
    public static void main(String[] args) {
        String s = toByteArray("1985f800b4cd27c69343ebffb3adcca2e995e6ffc51a8cf85fc4ad33c02b132a");
        String s1 = new BigInteger("1985f800b4cd27c69343ebffb3adcca2e995e6ffc51a8cf85fc4ad33c02b132a", 16).toString();


        System.out.println(s1);
    }
    public static String toByteArray(String str) {
        //String str = "bd777384b573f06a6d8b060e5df6bc2f70cdb6c97f4c8a72808f8f64bd27fd7d";
        byte[] src = new byte[str.length() / 2];
        int k = 0;
        for (int i = 0; i < src.length; i++) {
            byte high = (byte) (Character.digit(str.charAt(k), 16) & 0xff);
            byte low = (byte) (Character.digit(str.charAt(k + 1), 16) & 0xff);
            src[i] = (byte) (high << 4 | low);
            k += 2;
        }
        String des = "";
        try {
            des = Base64.getEncoder().encodeToString(src);
        } catch (Exception e) {
        }
        return des;
    }
}

你可能感兴趣的:(Android逆向学习)