All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.dongliu.apk.parser.Main Maven / Gradle / Ivy

The newest version!
package net.dongliu.apk.parser;

import java.io.IOException;
import java.security.cert.CertificateException;
import java.util.Locale;

/**
 * Main method for parser apk
 *
 * @author Liu Dong {@literal }
 */
public class Main {
    public static void main(String[] args) throws IOException, CertificateException {
        String action = args[0];
        String apkPath = args[1];
        try (ApkFile apkFile = new ApkFile(apkPath)) {
            apkFile.setPreferredLocale(Locale.getDefault());
            switch (action) {
                case "meta":
                    System.out.println(apkFile.getApkMeta());
                    break;
                case "manifest":
                    System.out.println(apkFile.getManifestXml());
                    break;
                case "signer":
                    System.out.println(apkFile.getApkSingers());
                    break;
                default:
            }

        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy