Skip to content

Commit

Permalink
fix(android): emulator ini file parsing (#5824)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcassidyav authored Jan 17, 2025
1 parent 91eab28 commit 2f35b34
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/common/mobile/android/android-ini-file-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2f35b34

Please sign in to comment.