0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00

docs: improve docs for Apple Silicon dylib load

Instructions for dismissing dialog with message:
```
“librsdroid-0-1-11.dylib” can’t be opened because Apple cannot check
it for malicious software.

This software needs to be updated.
Contact the developer for more information.

[Show in Finder] [OK]
```
This commit is contained in:
David Allison 2022-06-29 02:57:01 +01:00
parent 562c0c6d88
commit 37eb960d1b

View File

@ -573,7 +573,35 @@ open class RobolectricTest : CollectionGetter {
)
}
// we're the right version, load the library from $ANKIDROID_BACKEND_PATH
RustBackendLoader.ensureSetup(backendPath)
try {
RustBackendLoader.ensureSetup(backendPath)
} catch (e: UnsatisfiedLinkError) {
// java.lang.UnsatisfiedLinkError: /Users/davidallison/StudioProjects/librsdroid-0-1-11.dylib:
// dlopen(/Users/davidallison/StudioProjects/librsdroid-0-1-11.dylib, 0x0001):
// tried: '/Users/davidallison/StudioProjects/librsdroid-0-1-11.dylib'
// (code signature in <3C55B9B3-1E8A-33F4-A43E-173BDB074DC5>
// '/Users/davidallison/StudioProjects/librsdroid-0-1-11.dylib'
// not valid for use in process: library load disallowed by system policy)
// Dialog with message:
// “librsdroid-0-1-11.dylib” cant be opened because Apple cannot check it for malicious software.
// This software needs to be updated. Contact the developer for more information.
// [Show in Finder] [OK]
if (e.message.toString().contains("library load disallowed by system policy")) {
throw IllegalStateException(
"""library load disallowed by system policy.
"To fix:
* Run the test such that the "developer cannot be verified" message appears
* Press "OK" on the "Apple cannot check it for malicious software" prompt
* Run the Test Again
* Apple Menu - System Preferences - Security & Privacy - General (tab) - Unlock Settings - Select Allow Anyway".
Button is underneath the text: "librsdroid.dylib was blocked from use because it is not from an identified developer"
* Press "OK" on the "Apple cannot check it for malicious software" prompt
* Test should execute correctly"""
)
}
throw e
}
} else {
// default (no env variable): Extract the backend testing lib from the jar
try {