Open itlancer opened 4 years ago
FYI this one is "CRASHING_DUE_TO_PRIVACY_VIOLATION " which means the application is aborted because it's not properly set up for camera access. The two things that are needed are:
NSCameraUsageDescription
element added to the Info.plist filecom.apple.security.device.camera
entitlement is neededWe're working to make this all a little bit more automatic when packaging up an application..
@itlancer this one is now working for us, tested on Big Sur with AIR SDK 33.1.1.406.. are you able to check please?
@ajwfrost
I change source code according new PermissionManager
and test it - it still crashes with macOS Catalina 10.15.6.
Didn't test it yet with macOS 10.16 Big Sur or macOS 10.14 Mojave.
Updated source code of example that reproduce crash (just launch it and click anywhere on stage to reproduce crash):
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.media.Camera;
import flash.permissions.PermissionManager;
import flash.events.PermissionEvent;
public class ADLCameraVideoAttachCameraCrash extends Sprite {
public function ADLCameraVideoAttachCameraCrash() {
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event):void {
removeEventListener(Event.ADDED_TO_STAGE, init);
stage.addEventListener(MouseEvent.CLICK, click);
}
private function click(e:MouseEvent):void {
var p:PermissionManager = Camera.permissionManager;
trace("status", p.permissionStatus);//return "unknown"
p.addEventListener(PermissionEvent.PERMISSION_STATUS, permissionStatus);
p.requestPermission();//This line cause crash
}
private function permissionStatus(e:PermissionEvent):void {
trace("permissionStatus", e.status);
}
}
}
PermissionManager::requestPermission()
cause crash when I try to debug (launch) it via ADL.
There is no such crash when I launch it as captive runtime bundle but PermissionEvent.PERMISSION_STATUS
event listener anyway always returns PermissionStatus.DENIED
. So with latest AIR SDK 33.1.1.406 application cannot work with Camera
anyway.
Still crashes by ADL and PermissionStatus.DENIED
by bundle with latest AIR 33.1.1.444.
Nothing changes with latest AIR SDK 33.1.1.476.
The same problems with macOS Big Sur 11.3.1 (20E241).
Crashes on Catalina to me as well with 33.1.1.476
Struggling to reproduce this one... we've downloaded the AIR SDK from the website, built an application using the above source code, and run it using ADL from a terminal window (having removed the quarantine attribute from everything). Works fine.. not sure what we're doing differently here! Using Big Sur 11.2.3. We get it initially showing the 'unknown' permission, then the permission dialog pops onto the screen, and then we see the appropriate permission denied/granted which is then remembered, until we use tccutil reset Camera
to reset things.
Have just noticed the crash log embedded in the above post... but this has got a line under the binary images:
0x104193000 - 0x1053316f7 +com.adobe.AIR (33.1.1.406)
And I noticed this is being launched by Animate. So, possibly Animate is still pointing to an old installation of the SDK?
I had missed the new PermissionManager. Adobe docs are stuck to AIR 32, is there some updated AS3 reference? I cannot find any PermissionManager reference. Cheers for the updates, very welcome as usual. HARMAN is doing a great work.
Hi @PippoApps - the AS3 updates are in the release notes but we're working to get them updated online somewhere. There are some instructions/example under https://github.com/airsdk/Adobe-Runtime-Support/issues/532#issuecomment-779792767 thanks
@ajwfrost, I figure out.
Crash occurs only when using Animate. Tested with latest Animate 21.0.6 and AIR SDK 33.1.1.476 with macOS 11.3.1 (20E241) for Intel-based macbook. Quarantine attribute removed from SDK. Animate uses correct (latest) AIR SDK.
Testing from terminal via ADL works fine.
With bundled AIR application and latest AIR 33.1.1.476 permissions requests (Camera and Microphone) also works fine after going through all these steps https://github.com/airsdk/Adobe-Runtime-Support/issues/532#issuecomment-779792767
But you need to add to the entitlements only com.apple.security.device.camera
(for Camera) or com.apple.security.device.audio-input
(for Microphone). For captive runtime you do not need to add com.apple.security.cs.allow-jit
, com.apple.security.cs.allow-unsigned-executable-memory
and com.apple.security.cs.disable-library-validation
!
Also for code-signing you need to add com.apple.security.device.camera
/com.apple.security.device.audio-input
to Root.entitlements and Child.entitlements if you use https://github.com/tuarua/WebViewANE/tree/master/mac_installer or similar signing script.
I confirm testing within Animate crashes as soon as camera permission is requested. I did try notarizing both adl and animate eheh it didn't work...
Still crashes with Animate and latest AIR 33.1.1.533 BETA.
FYI, adding the workaround we've found for this:
First, open the permissions database:
$ sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db
And then, add this manually:
insert into access (service, client, client_type, auth_value, auth_reason, auth_version, flags) values ('kTCCServiceMicrophone', 'com.adobe.Adobe-Animate-2021.application', 0, 2, 2, 1, 0);
insert into access (service, client, client_type, auth_value, auth_reason, auth_version, flags) values ('kTCCServiceCamera', 'com.adobe.Adobe-Animate-2021.application', 0, 2, 2, 1, 0);
.quit
and check that it then appears in the permissions...
You may need to use a differerent bundle ID depending on what's in the /Applications/Adobe\ Animate.../Contents/Info.plist file.
thanks
Thank you @ajwfrost. Super helpful as usual.
When trying to modify TCC.db on Catalina I get this error from sqlite3: Error: table access has no column named auth_value
@PippoApps can you run select * from access;
and we can check what's in there currently and what the table headers are called there...
This is a little hacky .. we're looking at a process where we can get ADL to just trigger a separate debug process that has the required permissions already...
Thanks mate. Here it is.
kTCCServicePostEvent|com.getdropbox.dropbox|0|1|1||||UNUSED||0|1553428088 kTCCServiceAccessibility|com.getdropbox.dropbox|0|1|1||||UNUSED||0|1553428345 kTCCServicePostEvent|com.parallels.desktop.console|0|1|1||||UNUSED||0|1553526208 kTCCServiceSystemPolicyAllFiles|com.blacey.SuperDuper!|0|1|1||||UNUSED||0|1553540459 kTCCServicePostEvent|none.installer|0|0|1||||UNUSED||0|1553671668 kTCCServiceAccessibility|com.adobe.Adobe-Animate-CC-2019.application|0|1|1||||UNUSED||0|1554747619 kTCCServicePostEvent|com.adobe.Adobe-Animate-CC-2019.application|0|1|1||||UNUSED||0|1554747624 kTCCServiceAccessibility|com.kairos.duet|0|1|1||||UNUSED||0|1554811285 kTCCServicePostEvent|com.kairos.duet|0|1|1||||UNUSED||0|1554816013 kTCCServiceAccessibility|com.bitcavehq.Airflow|0|1|1||||UNUSED||0|1563143990 kTCCServicePostEvent|com.bitcavehq.Airflow|0|1|1||||UNUSED||0|1563145445 kTCCServiceAccessibility|com.parallels.desktop.console|0|1|1||||UNUSED||0|1563371810 kTCCServiceAccessibility|org.videolan.vlc|0|1|1||||UNUSED||0|1570810522 kTCCServicePostEvent|org.videolan.vlc|0|1|1||||UNUSED||0|1570810559 kTCCServiceAccessibility|com.teamviewer.TeamViewer|0|1|1||||UNUSED||0|1577045356 kTCCServicePostEvent|com.teamviewer.TeamViewer|0|1|1||||UNUSED||0|1577045597 kTCCServiceAccessibility|com.dropbox.activityprovider|0|0|1||||UNUSED||0|1578393893 kTCCServicePostEvent|com.Eltima.ElmediaPlayer|0|0|1||||UNUSED||0|1586161457 kTCCServiceAccessibility|com.Eltima.ElmediaPlayer|0|0|1||||UNUSED||0|1586161457 kTCCServiceSystemPolicyAllFiles|com.blacey.SuperDuper|0|1|1||||UNUSED||0|1589188627 kTCCServiceAccessibility|com.logmein.GoToMeeting|0|1|1||||UNUSED||0|1592834684 kTCCServicePostEvent|com.logmein.GoToMeeting|0|1|1||||UNUSED||0|1592834698 kTCCServiceAccessibility|us.zoom.xos|0|0|1||||UNUSED||0|1593078369 kTCCServiceAccessibility|com.google.Keystone.Agent|0|0|1||||UNUSED||0|1593848756 kTCCServiceSystemPolicyAllFiles|com.bitdefender.BitdefenderVirusScanner|0|1|1||||UNUSED||0|1607229088 kTCCServiceAccessibility|com.googlecode.iterm2|0|1|1||||UNUSED||0|1607234617 kTCCServicePostEvent|com.googlecode.iterm2|0|1|1||||UNUSED||0|1607234625 kTCCServiceSystemPolicyAllFiles|com.googlecode.iterm2|0|1|1||||UNUSED||0|1607235095 kTCCServicePostEvent|com.kairos.duetMac|0|1|1||||UNUSED||0|1607241605 kTCCServiceAccessibility|com.kairos.duetMac|0|1|1||||UNUSED||0|1607255509 kTCCServiceSystemPolicyAllFiles|com.cocoatech.PathFinder|0|1|1||||UNUSED||0|1618867258 kTCCServiceSystemPolicyAllFiles|com.apple.URLMount.AFPPlugin|0|1|1||||UNUSED||0|1620232742 kTCCServiceSystemPolicyAllFiles|com.objective-see.lulu.bundle|0|0|1||||UNUSED||0|1620551109 kTCCServicePostEvent|com.apple.screensharing.agent|0|0|1||||UNUSED||0|1620573186 kTCCServiceScreenCapture|com.apple.screensharing.agent|0|0|1||||UNUSED||0|1620573186 kTCCServiceAccessibility|/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/Support/AEServer|1|0|1||||UNUSED||0|1620573186 kTCCServiceSystemPolicyAllFiles|/usr/sbin/smbd|1|1|1||||UNUSED||0|1620656157 kTCCServiceSystemPolicyAllFiles|com.malwarebytes.mbam.rtprotection.daemon|0|1|1||||UNUSED||0|1620656664 kTCCServiceSystemPolicyAllFiles|com.teamviewer.TeamViewer|0|1|1||||UNUSED||0|1620656674 kTCCServiceDeveloperTool|com.apple.Terminal|0|0|1||||UNUSED||0|1620765282 kTCCServiceSystemPolicyAllFiles|com.apple.security|0|0|1||||UNUSED||0|1620765337 kTCCServiceSystemPolicyAllFiles|com.google.Keystone.Agent|0|0|1||||UNUSED||0|1620849890 kTCCServiceSystemPolicyAllFiles|com.kairos.duetMac|0|1|1||||UNUSED||0|1626098518 kTCCServiceScreenCapture|us.zoom.xos|0|1|1||||UNUSED||0|1626166102 kTCCServiceScreenCapture|com.teamviewer.TeamViewer|0|1|1||||UNUSED||0|1626270746 kTCCServiceSystemPolicyAllFiles|org.libreoffice.script|0|0|1||||UNUSED||0|1626444341 kTCCServiceScreenCapture|com.microsoft.teams|0|1|1||||UNUSED||0|1626448549 kTCCServiceAccessibility|com.hnc.Discord|0|0|1||||UNUSED||0|1626710802 kTCCServiceListenEvent|com.hnc.Discord|0|0|1||||UNUSED||0|1626711028 kTCCServiceSystemPolicyAllFiles|com.adobe.Adobe-Animate-2021.application|0|1|1||||UNUSED||0|1626773715 kTCCServiceSystemPolicyAllFiles|/Users/filippogregoretti/Documents/VMData/AIR_SDK_MAC/AIR_MAC_33.1.1.554/bin/adl|1|1|1||||UNUSED||0|1626773740 kTCCServiceSystemPolicyAllFiles|goldschmied-chiari-gregoretti.untitled.00|0|1|1||||UNUSED||0|1626781436 kTCCServiceSystemPolicyAllFiles|org.filezilla-project.filezilla|0|1|1||||UNUSED||0|1626781441 kTCCServicePostEvent|com.microsoft.teams|0|1|1||||UNUSED||0|1626856707 kTCCServiceScreenCapture|com.google.Chrome|0|1|1||||UNUSED||0|1626897688 kTCCServiceSystemPolicyAllFiles|com.apple.dt.Xcode|0|1|1||||UNUSED||0|1626901199 kTCCServiceSystemPolicyAllFiles|com.microsoft.teams|0|0|1||||UNUSED||0|1627482176 kTCCServiceScreenCapture|com.webex.meetingmanager|0|0|1||||UNUSED||0|1627539545 kTCCServiceScreenCapture|com.kairos.duetMac|0|1|1||||UNUSED||0|1627539563 kTCCServiceSystemPolicyAllFiles|com.microsoft.VSCode|0|0|1||||UNUSED||0|1627578719 kTCCServiceSystemPolicyAllFiles|com.apple.Terminal|0|0|1||||UNUSED||0|1627641005
Okay thanks ... seems like actually ".schema access
" is the command that would have given us the details, I'm used the 'select' command providing the column headers but sqlite here seems to be different...
Anyway: in case the below doesn't work, please try that .schema access
command:
insert into access (service, client, client_type, allowed, prompt_count) values ('kTCCServiceMicrophone', 'com.adobe.Adobe-Animate-2021.application', 0, 1, 1);
thanks
That did work @ajwfrost thank you very much. It wouldn't be an issue if I wasn't working on a starling project with intensive webcam that I cannot run on the windows VM. Exporting and resigning at each launch is really cumbersome.
On Catalina it worked for me to give full disk access to terminal in order not to incur in "Error: attempt to write a readonly database".
These worked perfectly: sqlite> insert into access (service, client, client_type, allowed, prompt_count) values ('kTCCServiceMicrophone', 'com.adobe.Adobe-Animate-2021.application', 0, 1, 1); sqlite> insert into access (service, client, client_type, allowed, prompt_count) values ('kTCCServiceCamera', 'coomm..aaddoobe-Animate-2021.application', 0, 1, 1);
I can see animate in the list of Camera and Mic permissions.
Thank you very much.
@PippoApps great! hope it goes well...
Problem Description
Video::attachCamera()
method call cause application crash when it launched via ADL with macOS. Tested with different AIR SDKs versions even with latests AIR 32.0.0.89, AIR 33.0.2.338 and AIR 33.1.0.16 on macOS Catalina 10.15.2 with MacBook Pro A1398 with Adobe Animate CC 2020. Tried with embedded and external USB camera. Same problem in all cases.It works fine with Windows. Also it works fine with bundled application (without ADL) for all platforms.
This issue prevent to fast development and debug applications using camera.
Steps to Reproduce
1) Launch code below with macOS device with camera. 2) Click anywhere on stage. Application try to get
Camera
and display it viaVideo
object.Application example with sources attached. adl_camera_video_attachcamera_crash.zip
Actual Result: Application crash:
Expected Result: Application correctly show "image" from camera without crashes.
Known Workarounds
none test application packaged as bundle may be other IDE usage make some difference - not checked it yet