( content: string, appBundleId: string, currentPid: string | null, )
| 136 | } |
| 137 | |
| 138 | function collectAndroidPackagePids( |
| 139 | content: string, |
| 140 | appBundleId: string, |
| 141 | currentPid: string | null, |
| 142 | ): string[] { |
| 143 | const pids = new Set<string>(); |
| 144 | if (currentPid) { |
| 145 | pids.add(currentPid); |
| 146 | } |
| 147 | const lines = content.split('\n'); |
| 148 | for (const line of lines) { |
| 149 | if (!line.includes(appBundleId)) continue; |
| 150 | for (const candidate of extractAndroidPidsFromPackageLine(line, appBundleId)) { |
| 151 | pids.add(candidate); |
| 152 | } |
| 153 | } |
| 154 | return [...pids]; |
| 155 | } |
| 156 | |
| 157 | function extractAndroidPidsFromPackageLine(line: string, appBundleId: string): string[] { |
| 158 | const escapedPackage = escapeRegExp(appBundleId); |
no test coverage detected