Skip to content
Permalink
Browse files
CB-10670, CB-10994 android: Marshmallow permissions
Fixes security exceptions caused by a missing request
for WRITE_EXTERNAL_STORAGE when capturing an image and
not requesting the CAMERA permission in the case where
it has been inserted into the manifest by some other
plugin.

This closes #59
  • Loading branch information
riknoll committed Mar 30, 2016
1 parent 0867898 commit 7646d75bcac0ec745f3c02dec0cea8cfe819463e
Showing 6 changed files with 529 additions and 195 deletions.
@@ -423,6 +423,8 @@ Each `MediaFile` object describes a captured media file.

- `CaptureError.CAPTURE_NO_MEDIA_FILES`: The user exits the camera or audio capture application before capturing anything.

- `CaptureError.CAPTURE_PERMISSION_DENIED`: The user denied a permission required to perform the given capture request.

- `CaptureError.CAPTURE_NOT_SUPPORTED`: The requested capture operation is not supported.

## CaptureErrorCB
@@ -30,33 +30,33 @@ xmlns:rim="http://www.blackberry.com/ns/widgets"
<keywords>cordova,media,capture</keywords>
<repo>https://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture.git</repo>
<issue>https://issues.apache.org/jira/browse/CB/component/12320646</issue>

<dependency id="cordova-plugin-file" version="^4.0.0" />

<js-module src="www/CaptureAudioOptions.js" name="CaptureAudioOptions">
<clobbers target="CaptureAudioOptions" />
</js-module>

<js-module src="www/CaptureImageOptions.js" name="CaptureImageOptions">
<clobbers target="CaptureImageOptions" />
</js-module>

<js-module src="www/CaptureVideoOptions.js" name="CaptureVideoOptions">
<clobbers target="CaptureVideoOptions" />
</js-module>

<js-module src="www/CaptureError.js" name="CaptureError">
<clobbers target="CaptureError" />
</js-module>

<js-module src="www/MediaFileData.js" name="MediaFileData">
<clobbers target="MediaFileData" />
</js-module>

<js-module src="www/MediaFile.js" name="MediaFile">
<clobbers target="MediaFile" />
</js-module>

<js-module src="www/capture.js" name="capture">
<clobbers target="navigator.device.capture" />
</js-module>
@@ -68,7 +68,7 @@ xmlns:rim="http://www.blackberry.com/ns/widgets"
<param name="android-package" value="org.apache.cordova.mediacapture.Capture"/>
</feature>
</config-file>

<config-file target="AndroidManifest.xml" parent="/*">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.RECORD_VIDEO"/>
@@ -77,16 +77,18 @@ xmlns:rim="http://www.blackberry.com/ns/widgets"

<source-file src="src/android/Capture.java" target-dir="src/org/apache/cordova/mediacapture" />
<source-file src="src/android/FileHelper.java" target-dir="src/org/apache/cordova/mediacapture" />
<source-file src="src/android/PermissionHelper.java" target-dir="src/org/apache/cordova/mediacapture" />
<source-file src="src/android/PendingRequests.java" target-dir="src/org/apache/cordova/mediacapture" />
</platform>

<!-- amazon-fireos -->
<platform name="amazon-fireos">
<config-file target="res/xml/config.xml" parent="/*">
<feature name="Capture" >
<param name="android-package" value="org.apache.cordova.mediacapture.Capture"/>
</feature>
</config-file>

<config-file target="AndroidManifest.xml" parent="/*">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.RECORD_VIDEO"/>
@@ -96,7 +98,7 @@ xmlns:rim="http://www.blackberry.com/ns/widgets"
<source-file src="src/android/Capture.java" target-dir="src/org/apache/cordova/mediacapture" />
<source-file src="src/android/FileHelper.java" target-dir="src/org/apache/cordova/mediacapture" />
</platform>


<!-- ubuntu -->
<platform name="ubuntu">
@@ -122,16 +124,16 @@ xmlns:rim="http://www.blackberry.com/ns/widgets"
</platform>

<!-- ios -->
<platform name="ios">
<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="Capture">
<param name="ios-package" value="CDVCapture" />
<param name="ios-package" value="CDVCapture" />
</feature>
</config-file>
<header-file src="src/ios/CDVCapture.h" />
<source-file src="src/ios/CDVCapture.m" />
<resource-file src="src/ios/CDVCapture.bundle" />

<framework src="CoreGraphics.framework" />
<framework src="MobileCoreServices.framework" />
</platform>

0 comments on commit 7646d75

Please sign in to comment.