Skip to content

Commit da2edef

Browse files
committed
removed jar/apk signer code
1 parent fae5fb3 commit da2edef

File tree

4 files changed

+0
-1281
lines changed

4 files changed

+0
-1281
lines changed

mode/src/processing/mode/android/AndroidBuild.java

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -784,81 +784,6 @@ public File exportPackage(String keyStorePassword) throws Exception {
784784
Util.copyDir(new File(projectFolder, getPathToAPK()), exportFolder);
785785
return exportFolder;
786786
}
787-
788-
789-
/*
790-
private File signPackage(File projectFolder, String keyStorePassword, String fileExt) throws Exception {
791-
File keyStore = AndroidKeyStore.getKeyStore();
792-
if (keyStore == null) return null;
793-
794-
String path;
795-
boolean isAAB = fileExt.equals("aab");
796-
if (isAAB) {
797-
path = getPathToAAB();
798-
} else {
799-
path = getPathToAPK();
800-
}
801-
802-
File unsignedPackage = new File(projectFolder,
803-
path + sketch.getName().toLowerCase() + "_release_unsigned." + fileExt);
804-
if (!unsignedPackage.exists()) return null;
805-
File signedPackageV1 = new File(projectFolder,
806-
path + sketch.getName().toLowerCase() + "_release_signed_v1." + fileExt);
807-
808-
JarSigner.signJarV1(unsignedPackage, signedPackageV1,
809-
AndroidKeyStore.ALIAS_STRING, keyStorePassword,
810-
keyStore.getAbsolutePath(), keyStorePassword);
811-
812-
if (isAAB) {
813-
return signedPackageV1;
814-
} else {
815-
816-
// To Do: The following Currently showing "Error with package export" on V2 signed APK generation
817-
// So for now keeping it as it is and continuing with V1 signing on APKs
818-
819-
// File signedPackageV2 = new File(projectFolder,
820-
// path + sketch.getName().toLowerCase() + "_release_signed_v2." + fileExt);
821-
// ApkSignerV2.signJarV2(signedPackageV1, signedPackageV2,
822-
// AndroidKeyStore.ALIAS_STRING, keyStorePassword,
823-
// keyStore.getAbsolutePath(), keyStorePassword);
824-
// File alignedPackage = zipalignPackage(signedPackageV2, projectFolder, fileExt, "v2");
825-
826-
827-
File alignedPackage = zipalignPackage(signedPackageV1, projectFolder, fileExt, "v1");
828-
829-
return alignedPackage;
830-
}
831-
}
832-
833-
private File zipalignPackage(File signedPackage, File projectFolder, String fileExt, String signingType)
834-
throws IOException, InterruptedException {
835-
File zipAlign = sdk.getZipAlignTool();
836-
if (zipAlign == null || !zipAlign.exists()) {
837-
Messages.showWarning(AndroidMode.getTextString("android_build.warn.cannot_find_zipalign.title"),
838-
AndroidMode.getTextString("android_build.warn.cannot_find_zipalign.body"));
839-
return null;
840-
}
841-
842-
File alignedPackage = new File(projectFolder,
843-
getPathToAPK() + sketch.getName().toLowerCase() + "_release_signed_aligned_" + signingType + "." + fileExt);
844-
845-
String[] args = {
846-
zipAlign.getAbsolutePath(), "-v", "-f", "4",
847-
signedPackage.getAbsolutePath(), alignedPackage.getAbsolutePath()
848-
};
849-
850-
Process alignProcess = Runtime.getRuntime().exec(args);
851-
// Need to consume output for the process to finish, as discussed here
852-
// https://stackoverflow.com/questions/5483830/process-waitfor-never-returns
853-
// Using StreamPump as in other parts of the mode does not seem to work for some reason
854-
BufferedReader reader = new BufferedReader(new InputStreamReader(alignProcess.getInputStream()));
855-
while ((reader.readLine()) != null) {}
856-
alignProcess.waitFor();
857-
858-
if (alignedPackage.exists()) return alignedPackage;
859-
return null;
860-
}
861-
*/
862787

863788

864789
//---------------------------------------------------------------------------

0 commit comments

Comments
 (0)