Search in sources :

Example 1 with ApkSignerEngine

use of com.android.apksig.ApkSignerEngine in project LSPatch by LSPosed.

the class SigningExtension method onZipEntryOutput.

private void onZipEntryOutput(StoredEntry entry) throws IOException {
    setDirty();
    String entryName = entry.getCentralDirectoryHeader().getName();
    // report the addition of the entry to ApkSignerEngine.
    if (entry.isDeleted()) {
        return;
    }
    ApkSignerEngine.InspectJarEntryRequest inspectEntryRequest = signer.outputJarEntry(entryName);
    signerProcessedOutputEntryNames.add(entryName);
    if (inspectEntryRequest != null) {
        try (InputStream inputStream = new BufferedInputStream(entry.open())) {
            copyStreamToDataSink(inputStream, inspectEntryRequest.getDataSink());
        }
        inspectEntryRequest.done();
    }
}
Also used : BufferedInputStream(java.io.BufferedInputStream) BufferedInputStream(java.io.BufferedInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) ApkSignerEngine(com.android.apksig.ApkSignerEngine) DefaultApkSignerEngine(com.android.apksig.DefaultApkSignerEngine)

Aggregations

ApkSignerEngine (com.android.apksig.ApkSignerEngine)1 DefaultApkSignerEngine (com.android.apksig.DefaultApkSignerEngine)1 BufferedInputStream (java.io.BufferedInputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1