Skip to content

Commit

Permalink
Trim \r from Android certificate file names on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
baltpeter committed Apr 13, 2023
1 parent 29eb859 commit 0eeb7bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ An ID of a known permission on Android.

#### Defined in

[android.ts:766](https://github.com/tweaselORG/appstraction/blob/main/src/android.ts#L766)
[android.ts:768](https://github.com/tweaselORG/appstraction/blob/main/src/android.ts#L768)

___

Expand Down Expand Up @@ -274,7 +274,7 @@ The IDs of known permissions on Android.

#### Defined in

[android.ts:635](https://github.com/tweaselORG/appstraction/blob/main/src/android.ts#L635)
[android.ts:637](https://github.com/tweaselORG/appstraction/blob/main/src/android.ts#L637)

___

Expand Down
4 changes: 3 additions & 1 deletion src/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ export const androidApi = <RunTarget extends SupportedRunTarget<'android'>>(

getCertificateSubjectHashOld: (path: string) =>
execa('openssl', ['x509', '-inform', 'PEM', '-subject_hash_old', '-in', path]).then(
({ stdout }) => stdout.split('\n')[0]
// The `trim()` is necessary for Windows:
// https://github.com/tweaselORG/meta/issues/25#issuecomment-1507665763
({ stdout }) => stdout.split('\n')[0]?.trim()
),
hasCertificateAuthority: (filename) =>
execa('adb', ['shell', 'ls', `/system/etc/security/cacerts/${filename}`], { reject: false }).then(
Expand Down

0 comments on commit 0eeb7bb

Please sign in to comment.