mirror of
https://github.com/r0adkll/sign-android-release
synced 2026-10-05 19:11:35 +00:00
Merge pull request #24 from jobobby04/pr
Fix zipalign for Android Gradle Plugin 4.1.0
This commit is contained in:
2 files changed
+11
-2
No files matched your search
+5
-1
@@ -24,7 +24,7 @@ function signApkFile(apkFile, signingKeyFile, alias, keyStorePassword, keyPasswo
|
|||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
core.debug("Zipaligning APK file");
|
core.debug("Zipaligning APK file");
|
||||||
// Find zipalign executable
|
// Find zipalign executable
|
||||||
const buildToolsVersion = process.env.BUILD_TOOLS_VERSION || '29.0.2';
|
const buildToolsVersion = process.env.BUILD_TOOLS_VERSION || '29.0.3';
|
||||||
const androidHome = process.env.ANDROID_HOME;
|
const androidHome = process.env.ANDROID_HOME;
|
||||||
const buildTools = path.join(androidHome, `build-tools/${buildToolsVersion}`);
|
const buildTools = path.join(androidHome, `build-tools/${buildToolsVersion}`);
|
||||||
if (!fs.existsSync(buildTools)) {
|
if (!fs.existsSync(buildTools)) {
|
||||||
@@ -35,7 +35,11 @@ function signApkFile(apkFile, signingKeyFile, alias, keyStorePassword, keyPasswo
|
|||||||
// Align the apk file
|
// Align the apk file
|
||||||
const alignedApkFile = apkFile.replace('.apk', '-aligned.apk');
|
const alignedApkFile = apkFile.replace('.apk', '-aligned.apk');
|
||||||
yield exec.exec(`"${zipAlign}"`, [
|
yield exec.exec(`"${zipAlign}"`, [
|
||||||
|
'-c',
|
||||||
'-v', '4',
|
'-v', '4',
|
||||||
|
apkFile
|
||||||
|
]);
|
||||||
|
yield exec.exec(`"cp"`, [
|
||||||
apkFile,
|
apkFile,
|
||||||
alignedApkFile
|
alignedApkFile
|
||||||
]);
|
]);
|
||||||
|
|||||||
+6
-1
@@ -15,7 +15,7 @@ export async function signApkFile(
|
|||||||
core.debug("Zipaligning APK file");
|
core.debug("Zipaligning APK file");
|
||||||
|
|
||||||
// Find zipalign executable
|
// Find zipalign executable
|
||||||
const buildToolsVersion = process.env.BUILD_TOOLS_VERSION || '29.0.2';
|
const buildToolsVersion = process.env.BUILD_TOOLS_VERSION || '29.0.3';
|
||||||
const androidHome = process.env.ANDROID_HOME;
|
const androidHome = process.env.ANDROID_HOME;
|
||||||
const buildTools = path.join(androidHome!, `build-tools/${buildToolsVersion}`);
|
const buildTools = path.join(androidHome!, `build-tools/${buildToolsVersion}`);
|
||||||
if (!fs.existsSync(buildTools)) {
|
if (!fs.existsSync(buildTools)) {
|
||||||
@@ -28,7 +28,12 @@ export async function signApkFile(
|
|||||||
// Align the apk file
|
// Align the apk file
|
||||||
const alignedApkFile = apkFile.replace('.apk', '-aligned.apk');
|
const alignedApkFile = apkFile.replace('.apk', '-aligned.apk');
|
||||||
await exec.exec(`"${zipAlign}"`, [
|
await exec.exec(`"${zipAlign}"`, [
|
||||||
|
'-c',
|
||||||
'-v', '4',
|
'-v', '4',
|
||||||
|
apkFile
|
||||||
|
]);
|
||||||
|
|
||||||
|
await exec.exec(`"cp"`, [
|
||||||
apkFile,
|
apkFile,
|
||||||
alignedApkFile
|
alignedApkFile
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in new issue
Block a user