Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions apps/expo-app/scripts/utils/AndroidBuilder.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { execSync, spawn } from 'node:child_process';
import { execFileSync, spawn } from 'node:child_process';
import fs from 'node:fs/promises';
import path from 'node:path';

Expand Down Expand Up @@ -183,15 +183,16 @@ android.buildTypes.release.shrinkResources = true

// Replace assets/index.android.bundle in the APK (cd into patchDir so zip path is correct)
console.log(`\nPatching bundle into APK: ${apk}...`);
execSync(`zip -u ${apk} assets/index.android.bundle`, { cwd: patchDir, stdio: 'inherit' });
execFileSync('zip', ['-u', apk, 'assets/index.android.bundle'], { cwd: patchDir, stdio: 'inherit' });

// Re-align (zip modification breaks alignment) then re-sign with debug keystore
execSync(`zipalign -f 4 ${apk} ${alignedApk}`, { stdio: 'inherit' });
execFileSync('zipalign', ['-f', '4', apk, alignedApk], { stdio: 'inherit' });
await fs.rename(alignedApk, apk);

const debugKeystore = path.resolve(process.env.HOME, '.android/debug.keystore');
execSync(
`apksigner sign --ks ${debugKeystore} --ks-pass pass:android --key-pass pass:android ${apk}`,
execFileSync(
'apksigner',
['sign', '--ks', debugKeystore, '--ks-pass', 'pass:android', '--key-pass', 'pass:android', apk],
{ stdio: 'inherit' },
);

Expand Down
4 changes: 2 additions & 2 deletions packages/mobile-visreg/src/upload.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { execSync } from 'child_process';
import { execFileSync } from 'child_process';
import { resolve } from 'path';

function parseArgs() {
Expand All @@ -24,6 +24,6 @@ if (!process.env.PERCY_TOKEN) {
const screenshotDir = resolve(dir);
console.log(`Uploading screenshots from ${screenshotDir} to Percy...`);

execSync(`npx percy upload ${screenshotDir}`, { stdio: 'inherit' });
execFileSync('npx', ['percy', 'upload', screenshotDir], { stdio: 'inherit' });

console.log('\nUpload complete. Visit percy.io to review the build.');
4 changes: 2 additions & 2 deletions tools/generateTarballs.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { execSync } from 'child_process';
import { execFileSync, execSync } from 'child_process';
import { existsSync, mkdirSync, readdirSync, readFileSync, unlinkSync } from 'fs';
import inquirer from 'inquirer';
import { join, resolve } from 'path';
Expand Down Expand Up @@ -106,7 +106,7 @@ async function main() {
const tarballPath = resolve(tarballsDir, tarballName);

process.chdir(projectDir);
execSync(`yarn pack --filename ${tarballPath}`, {
execFileSync('yarn', ['pack', '--filename', tarballPath], {
maxBuffer: 1024 * 1024 * 10, // 10MB buffer
stdio: 'pipe',
});
Expand Down
Loading