Source:
public boolean install(Resource r, ResourceLocation location, Reference ref, ResourceTable table, AndroidCommCarePlatform platform, boolean upgrade, boolean recovery) throws UnresolvedResourceException, UnfullfilledRequirementsException { try { InputStream inputFileStream; try { inputFileStream = ref.getStream(); } catch (FileNotFoundException e) { throw new UnresolvedResourceException(r, Localization.get("install.error.file.not.found", r.getDescriptor()), true); } File tempFile = new File(CommCareApplication.instance().getTempFilePath()); Reference localReference; OutputStream outputFileStream; try { Pair<String, String> fileNameAndExt = getResourceName(r, location); String referenceRoot = upgrade ? upgradeDestination : localDestination; localReference = getEmptyLocalReference(referenceRoot, fileNameAndExt.first, fileNameAndExt.second); outputFileStream = new FileOutputStream(tempFile); localLocation = localReference.getURI(); } catch (InvalidReferenceException ire) { throw new LocalStorageUnavailableException("Couldn't create reference to declared location " + localLocation + " for file system installation", localLocation); } catch (IOException ioe) { throw new LocalStorageUnavailableException("Couldn't write to local reference " + localLocation + " for file system installation", localLocation); } StreamsUtil.writeFromInputToOutputNew(inputFileStream, outputFileStream); renameFile(localReference.getLocalURI(), tempFile); int status = customInstall(r, localReference, upgrade, platform); table.commit(r, status); if (localLocation == null) { throw new UnresolvedResourceException(r, "After install there is no local resource location"); } return true; } catch (SSLHandshakeException | SSLPeerUnverifiedException e) { e.printStackTrace(); UnresolvedResourceException mURE = new UnresolvedResourceException(r, "Your certificate was bad. This is often due to a mis-set phone clock.", true); mURE.initCause(e); throw mURE; } catch (IOException e) { e.printStackTrace(); throw new UnreliableSourceException(r, e.getMessage()); } }

Target:
public boolean install(Resource r, ResourceLocation location, Reference ref, ResourceTable table, AndroidCommCarePlatform platform, boolean upgrade, boolean recovery) throws UnresolvedResourceException, UnfullfilledRequirementsException { try { InputStream inputFileStream; try { inputFileStream = ref.getStream(); } catch (FileNotFoundException e) { throw new UnresolvedResourceException(r, StringUtils.getStringRobust(CommCareApplication.instance(), R.string.install_error_file_not_found, r.getDescriptor()), true); } File tempFile = new File(CommCareApplication.instance().getTempFilePath()); Reference localReference; OutputStream outputFileStream; try { Pair<String, String> fileNameAndExt = getResourceName(r, location); String referenceRoot = upgrade ? upgradeDestination : localDestination; localReference = getEmptyLocalReference(referenceRoot, fileNameAndExt.first, fileNameAndExt.second); outputFileStream = new FileOutputStream(tempFile); localLocation = localReference.getURI(); } catch (InvalidReferenceException ire) { throw new LocalStorageUnavailableException("Couldn't create reference to declared location " + localLocation + " for file system installation", localLocation); } catch (IOException ioe) { throw new LocalStorageUnavailableException("Couldn't write to local reference " + localLocation + " for file system installation", localLocation); } StreamsUtil.writeFromInputToOutputNew(inputFileStream, outputFileStream); renameFile(localReference.getLocalURI(), tempFile); int status = customInstall(r, localReference, upgrade, platform); table.commit(r, status); if (localLocation == null) { throw new UnresolvedResourceException(r, "After install there is no local resource location"); } return true; } catch (SSLHandshakeException | SSLPeerUnverifiedException e) { e.printStackTrace(); UnresolvedResourceException mURE = new UnresolvedResourceException(r, "Your certificate was bad. This is often due to a mis-set phone clock.", true); mURE.initCause(e); throw mURE; } catch (IOException e) { e.printStackTrace(); throw new UnreliableSourceException(r, e.getMessage()); } }