From 2f35b347e1d9710f17862009784826cfb0c589aa Mon Sep 17 00:00:00 2001 From: Jason Cassidy <47318351+jcassidyav@users.noreply.github.com> Date: Fri, 17 Jan 2025 17:42:09 +0000 Subject: [PATCH] fix(android): emulator ini file parsing (#5824) --- .../mobile/android/android-ini-file-parser.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/common/mobile/android/android-ini-file-parser.ts b/lib/common/mobile/android/android-ini-file-parser.ts index 1cdd28b436..bcb478a4a8 100644 --- a/lib/common/mobile/android/android-ini-file-parser.ts +++ b/lib/common/mobile/android/android-ini-file-parser.ts @@ -20,26 +20,28 @@ export class AndroidIniFileParser implements Mobile.IAndroidIniFileParser { contents, (result: Mobile.IAvdInfo, line: string) => { const parsedLine = line.split("="); - const key = parsedLine[0]; + + const key = parsedLine[0]?.trim(); + const value = parsedLine[1]?.trim(); switch (key) { case "target": - result.target = parsedLine[1]; + result.target = value; result.targetNum = this.readTargetNum(result.target); break; case "path": case "AvdId": - result[_.lowerFirst(key)] = parsedLine[1]; + result[_.lowerFirst(key)] = value; break; case "hw.device.name": - result.device = parsedLine[1]; + result.device = value; break; case "avd.ini.displayname": - result.displayName = parsedLine[1]; + result.displayName = value; break; case "abi.type": case "skin.name": case "sdcard.size": - result[key.split(".")[0]] = parsedLine[1]; + result[key.split(".")[0]] = value; break; } return result;