Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

Does libavdevice use AVCaptureDeviceInput? #120

Closed
poshpawstudio opened this issue Apr 5, 2020 · 12 comments
Closed

Does libavdevice use AVCaptureDeviceInput? #120

poshpawstudio opened this issue Apr 5, 2020 · 12 comments
Assignees
Labels
enhancement New feature or request fixed

Comments

@poshpawstudio
Copy link

poshpawstudio commented Apr 5, 2020

Description
My iOS app is rejected with the permission issue however my app does not use any camera related packages.

ITMS-90683: Missing Purpose String in Info.plist - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSCameraUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data.

Digging around I found libavdevice contains some code accessing AVCaptureDeviceInput which ends up with being detected by Apple's static analysis.
https://developer.apple.com/library/archive/qa/qa1937/_index.html#//apple_ref/doc/uid/DTS40017549

I cannot add NSCameraUsageDescription to my app as it clearly does not use the camera.

Expected behavior
AVCaptureDeviceInput should not be used or there needs to be an option to omit the library if possible.

Current behavior
libavdevice contains some code accessing AVCaptureDeviceInput which ends up with being detected by the static Apple's static analysis.
https://developer.apple.com/library/archive/qa/qa1937/_index.html#//apple_ref/doc/uid/DTS40017549

Screenshots
If applicable, add screenshots to help explain your problem.

Logs
Post logs here or paste them to Ghostbin and insert the link here.

Environment

$ flutter doctor -v
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.14.6 18G3020, locale en-GB)
    • Flutter version 1.12.13+hotfix.8 at /Users/parkia/Dev/sub/flutter
    • Framework revision 0b8abb4724 (8 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/parkia/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 43.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (1 available)
    • Dayoung • 5f5c0d4d10f8e5f796f003b99d63ee4557a56856 • ios • iOS 12.4.5

• No issues found!

Other
Add any other context about the problem here.

@tanersener tanersener self-assigned this Apr 6, 2020
@tanersener tanersener added the question Further information is requested label Apr 6, 2020
@tanersener
Copy link
Owner

tanersener commented Apr 6, 2020

libavdevice uses AVFoundation to access camera device. That option is defined on compile time and can not be changed later. If you don't want to add NSCameraUsageDescription to your Info.plist , then you can use one of the LTS packages. They do not support accessing camera.

@poshpawstudio
Copy link
Author

@tanersener many thanks. I think I am using the LTS package. Do you see anything is incorrect in this?

  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.each do |name, path|
    symlink = File.join('.symlinks', 'plugins', name)
    File.symlink(path, symlink)
    if name == 'flutter_ffmpeg'
      pod name+'/min-gpl-lts', :path => File.join(symlink, 'ios')
    else
      pod name, :path => File.join(symlink, 'ios')
    end
  end

@tanersener
Copy link
Owner

tanersener commented Apr 6, 2020

Sorry, mad bad. Updated my previous comment. Unfortunately, both iOS releases depend on AVFoundation. We don't have a flutter_ffmpeg release without it. My first comment was about Android.

Anyway, since this dependency is defined on compile time, the only solution is to build parent mobile-ffmpeg project without avfoundation.

@ianpark
Copy link

ianpark commented Apr 15, 2020

@tanersener I appreciate your answer. Is there any workaround to remove it from my local package to bypass the Apple's static analysis? Apple won't let me publish the app with camera permission without the real camera functionality implemented.

@tanersener
Copy link
Owner

I don't know any easy workarounds unfortunately. A new mobile-ffmpeg build is required for that.

I would create a local build for you to test if I had time but I'm working on a new release these days. I can't switch my test environment until my release is published.

@ianpark
Copy link

ianpark commented May 24, 2020

Hi @tanersener, any chance you would be able to take a look at the possible alternative solutions?

@tanersener
Copy link
Owner

@ianpark I don't know how to skip Apple's static analysis. So, the only solution I see in this case is building the parent mobile-ffmpeg library.

Did you try to build it or do you want to have an easier solution?

@ianpark
Copy link

ianpark commented May 25, 2020

@tanersener Thanks for your response. I didn't try building the mobile-ffmpeg library on my own, as it seemed to need excessive extra knowledge.

I think a more generic way to get rid of the camera permission would be desirable, so that everyone can get benefit from this great software.

@tanersener
Copy link
Owner

@ianpark Unfortunately, I don't know a more generic way.

@tanersener tanersener added enhancement New feature or request and removed question Further information is requested labels Jun 13, 2020
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@tanersener
Copy link
Owner

LTS release in development branch is updated not to enable avfoundation, which will resolve this issue.

@tanersener
Copy link
Owner

Released in v0.3.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request fixed
Projects
None yet
Development

No branches or pull requests

3 participants