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 int thumbNailWidth ; private int thumbNailHeight ; private Uri imageUri ; private int encodingType ; private int mediaType ; private boolean saveToPhotoAlbum ; private boolean returnThumbnail ; private boolean correctOrientation ; private boolean orientationCorrected ; private boolean allowEdit ; public CallbackContext callbackContext ; private int numPics ; private MediaScannerConnection conn ; private Uri scanMe ; private Uri croppedUri ; private String imageThumbnail ; 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 processResultFromGallery ( int destType , Intent intent ) { } public Uri getImageUri ( Context inContext , Bitmap inImage ) { } public void onActivityResult ( int requestCode , int resultCode , Intent intent ) { int srcType = ( requestCode // 16 ) - 1 ; int destType = ( requestCode % 16 ) - 1 ; if ( requestCode == ( CameraLauncher . CROP_CAMERA ) ) { if ( resultCode == ( Activity . RESULT_OK ) ) { if ( returnThumbnail ) { JSONArray imageArray = new JSONArray ( ) ; <START_BUG> imageArray . put ( uri . toString ( ) ) ; <END_BUG> imageArray . put ( imageThumbnail ) ; this . callbackContext . success ( imageArray ) ; } else { this . callbackContext . success ( croppedUri . toString ( ) ) ; } croppedUri = null ; } else if ( resultCode == ( Activity . RESULT_CANCELED ) ) { this . failPicture ( "Camera<seq2seq4repair_space>cancelled." ) ; } else { this . failPicture ( "Did<seq2seq4repair_space>not<seq2seq4repair_space>complete!" ) ; } } if ( srcType == ( CameraLauncher . CAMERA ) ) { if ( resultCode == ( Activity . RESULT_OK ) ) { try { this . processResultFromCamera ( destType , intent ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; this . failPicture ( "Error<seq2seq4repair_space>capturing<seq2seq4repair_space>image." ) ; } } else if ( resultCode == ( Activity . RESULT_CANCELED ) ) { this . failPicture ( "Camera<seq2seq4repair_space>cancelled." ) ; } else { this . failPicture ( "Did<seq2seq4repair_space>not<seq2seq4repair_space>complete!" ) ; } } else if ( ( srcType == ( CameraLauncher . PHOTOLIBRARY ) ) || ( srcType == ( CameraLauncher . SAVEDPHOTOALBUM ) ) ) { if ( ( resultCode == ( Activity . RESULT_OK ) ) && ( intent != null ) ) { this . processResultFromGallery ( destType , intent ) ; } else if ( resultCode == ( Activity . RESULT_CANCELED ) ) { this . failPicture ( "Selection<seq2seq4repair_space>cancelled." ) ; } else { this . failPicture ( "Selection<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>complete!" ) ; } } } private int getImageOrientation ( Uri uri ) { } private Bitmap getRotatedBitmap ( int rotate , Bitmap bitmap , ExifHelper exif ) { } private void writeUncompressedImage ( Uri uri ) throws FileNotFoundException , IOException { } private Uri getUriFromMediaStore ( ) { } private Bitmap getScaledBitmap ( String imageUrl ) throws IOException { } private Bitmap resizeThumbnail ( String imageUrl ) throws IOException { } public int [ ] calculateAspectRatio ( int origWidth , int origHeight , int newWidth , int newHeight ) { } public static int calculateSampleSize ( int srcWidth , int srcHeight , int dstWidth , int dstHeight ) { } private Cursor queryImgDB ( Uri contentStore ) { } private void cleanup ( int imageType , Uri oldImage , Uri newImage , Bitmap bitmap ) { } private void checkForDuplicateImage ( int type ) { } private Uri whichContentStore ( ) { } public void processPicture ( Bitmap bitmap ) { } private String returnProcessPicture ( Bitmap bitmap ) { } public void failPicture ( String err ) { } private void scanForGallery ( Uri newImage ) { } public void onMediaScannerConnected ( ) { } public void onScanCompleted ( String path , Uri uri ) { } }

Fix:
imageArray . put ( croppedUri . toString ( ) ) ;