Buggy code:
public class CameraLauncher extends CordovaPlugin implements MediaScannerConnectionClient { private static final int DATA_URL = 0 ; private static final int FILE_URI = 1 ; private static final int NATIVE_URI = 2 ; private static final int PHOTOLIBRARY = 0 ; private static final int CAMERA = 1 ; private static final int SAVEDPHOTOALBUM = 2 ; private static final int PICTURE = 0 ; private static final int VIDEO = 1 ; private static final int ALLMEDIA = 2 ; private static final int JPEG = 0 ; private static final int PNG = 1 ; private static final String GET_PICTURE = "Get<seq2seq4repair_space>Picture" ; private static final String GET_VIDEO = "Get<seq2seq4repair_space>Video" ; private static final String GET_All = "Get<seq2seq4repair_space>All" ; private static final String LOG_TAG = "CameraLauncher" ; private static final int CROP_CAMERA = 100 ; private int mQuality ; private int targetWidth ; private int targetHeight ; private Uri imageUri ; private int encodingType ; private int mediaType ; private boolean saveToPhotoAlbum ; private boolean correctOrientation ; private boolean orientationCorrected ; private boolean allowEdit ; public CallbackContext callbackContext ; private int numPics ; private MediaScannerConnection conn ; private Uri scanMe ; private Uri croppedUri ; public boolean execute ( String action , JSONArray args , CallbackContext callbackContext ) throws JSONException { } private String getTempDirectoryPath ( ) { } public void takePicture ( int returnType , int encodingType ) { } private File createCaptureFile ( int encodingType ) { } public void getImage ( int srcType , int returnType , int encodingType ) { } private void performCrop ( Uri picUri ) { } private void processResultFromCamera ( int destType , Intent intent ) throws IOException { } private String ouputModifiedBitmap ( Bitmap bitmap , Uri uri ) throws IOException { } private void copyFile ( File sourceFile , File destFile ) throws IOException { } private void processResultFromGallery ( int destType , Intent intent ) { Uri uri = intent . getData ( ) ; if ( uri == null ) { if ( ( croppedUri ) != null ) { uri = croppedUri ; } else { this . failPicture ( "null<seq2seq4repair_space>data<seq2seq4repair_space>from<seq2seq4repair_space>photo<seq2seq4repair_space>library" ) ; return ; } } int rotate = 0 ; if ( ( this . mediaType ) != ( CameraLauncher . PICTURE ) ) { this . callbackContext . success ( uri . toString ( ) ) ; } else { try { uri = Uri . fromFile ( new File ( FileHelper . getRealPath ( uri , this . cordova ) ) ) ; } catch ( NullPointerException e ) { uri = null ; } File photo = createCaptureFile ( encodingType ) ; <START_BUG> this . copyFile ( new File ( uri ) , photo ) ; <END_BUG> if ( true || ( ( ( ( ( this . targetHeight ) == ( - 1 ) ) && ( ( this . targetWidth ) == ( - 1 ) ) ) && ( ( destType == ( CameraLauncher . FILE_URI ) ) || ( destType == ( CameraLauncher . NATIVE_URI ) ) ) ) && ( ! ( this . correctOrientation ) ) ) ) { this . callbackContext . success ( Uri . fromFile ( photo ) . toString ( ) ) ; } else { String uriString = uri . toString ( ) ; String mimeType = FileHelper . getMimeType ( uriString , this . cordova ) ; if ( ! ( ( "image//jpeg" . equalsIgnoreCase ( mimeType ) ) || ( "image//png" . equalsIgnoreCase ( mimeType ) ) ) ) { Log . d ( CameraLauncher . LOG_TAG , "I<seq2seq4repair_space>either<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>null<seq2seq4repair_space>image<seq2seq4repair_space>path<seq2seq4repair_space>or<seq2seq4repair_space>bitmap" ) ; this . failPicture ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>retrieve<seq2seq4repair_space>path<seq2seq4repair_space>to<seq2seq4repair_space>picture!" ) ; return ; } Bitmap bitmap = null ; try { bitmap = getScaledBitmap ( uriString ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } if ( bitmap == null ) { Log . d ( CameraLauncher . LOG_TAG , "I<seq2seq4repair_space>either<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>null<seq2seq4repair_space>image<seq2seq4repair_space>path<seq2seq4repair_space>or<seq2seq4repair_space>bitmap" ) ; this . failPicture ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>bitmap!" ) ; return ; } if ( this . correctOrientation ) { rotate = getImageOrientation ( uri ) ; if ( rotate != 0 ) { Matrix matrix = new Matrix ( ) ; matrix . setRotate ( rotate ) ; try { bitmap = Bitmap . createBitmap ( bitmap , 0 , 0 , bitmap . getWidth ( ) , bitmap . getHeight ( ) , matrix , true ) ; this . orientationCorrected = true ; } catch ( OutOfMemoryError oom ) { this . orientationCorrected = false ; } } } if ( destType == ( CameraLauncher . DATA_URL ) ) { this . processPicture ( bitmap ) ; } else if ( ( destType == ( CameraLauncher . FILE_URI ) ) || ( destType == ( CameraLauncher . NATIVE_URI ) ) ) { if ( ( ( ( this . targetHeight ) > 0 ) && ( ( this . targetWidth ) > 0 ) ) || ( ( this . correctOrientation ) && ( this . orientationCorrected ) ) ) { try { String modifiedPath = this . ouputModifiedBitmap ( bitmap , uri ) ; this . callbackContext . success ( ( ( ( "file:////" + modifiedPath ) + "?" ) + ( System . currentTimeMillis ( ) ) ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; this . failPicture ( "Error<seq2seq4repair_space>retrieving<seq2seq4repair_space>image." ) ; } } else { this . callbackContext . success ( uri . toString ( ) ) ; } } if ( bitmap != null ) { bitmap . recycle ( ) ; bitmap = null ; } System . gc ( ) ; } } } public void onActivityResult ( int requestCode , int resultCode , Intent intent ) { } private int getImageOrientation ( Uri uri ) { } private Bitmap getRotatedBitmap ( int rotate , Bitmap bitmap , ExifHelper exif ) { } private void writeUncompressedImage ( Uri uri ) throws FileNotFoundException , IOException { }

Fix:
this . copyFile ( new File ( uri . getPath ( ) ) , photo ) ;