From 2c767e19209662ae28de970d3231f884e7ea652c Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Fri, 4 Nov 2022 08:23:44 -0700 Subject: [PATCH] Make the universal export work on the older Android devices Summary: On older Android devices (API 24) `-printf ` is not available Reviewed By: lblasa Differential Revision: D40980640 fbshipit-source-id: d1a1bcadc496deaf3d514c1e45b2e0104a937b18 --- .../src/devices/android/AndroidDevice.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/desktop/flipper-server-core/src/devices/android/AndroidDevice.tsx b/desktop/flipper-server-core/src/devices/android/AndroidDevice.tsx index ba5154a20..508367913 100644 --- a/desktop/flipper-server-core/src/devices/android/AndroidDevice.tsx +++ b/desktop/flipper-server-core/src/devices/android/AndroidDevice.tsx @@ -310,11 +310,11 @@ export default class AndroidDevice const appsCommandsResults = await Promise.all( appIds.map(async (appId): Promise => { - const sonarDirFileNames = await executeCommandAsApp( + const sonarDirFilePaths = await executeCommandAsApp( this.adb, this.info.serial, appId, - `find /data/data/${appId}/files/sonar -type f -printf "%f\n"`, + `find /data/data/${appId}/files/sonar -type f`, ) .then((output) => { if (output.includes('No such file or directory')) { @@ -343,14 +343,13 @@ export default class AndroidDevice ); }); - if (!sonarDirFileNames) { + if (!sonarDirFilePaths) { return; } - const sonarDirContentPromises = sonarDirFileNames.map( - async (fileName) => { - const filePath = `/data/data/${appId}/files/sonar/${fileName}`; - if (fileName.endsWith('pem')) { + const sonarDirContentPromises = sonarDirFilePaths.map( + async (filePath) => { + if (filePath.endsWith('pem')) { return { path: filePath, data: '===SECURE_CONTENT===',