Source:
<code>public boolean install(Resource r, ResourceLocation location, Reference ref, ResourceTable table, AndroidCommCarePlatform platform, boolean upgrade, boolean recovery) throws UnresolvedResourceException, UnfullfilledRequirementsException { super.install(r, location, ref, table, platform, upgrade, recovery); <START> storeReleasedTime(platform, ref); <END> InputStream inputStream = null; try { Reference local = ReferenceManager.instance().DeriveReference(localLocation); inputStream = local.getStream(); ProfileParser parser = new ProfileParser(inputStream, platform, table, r.getRecordGuid(), Resource.RESOURCE_STATUS_UNINITIALIZED, false); Profile p = parser.parse(); if (recovery) { validateRecovery(platform, p); } if (!upgrade) { initProperties(p); if (!recovery) { checkDuplicate(p); checkAppTarget(); } } table.commitCompoundResource(r, upgrade ? Resource.RESOURCE_STATUS_UPGRADE : Resource.RESOURCE_STATUS_INSTALLED, p.getVersion()); return true; } catch (XmlPullParserException | InvalidReferenceException | IOException e) { e.printStackTrace(); } catch (InvalidStructureException e) { throw new UnresolvedResourceException(r, "Invalid content in the Profile Definition: " + e.getMessage(), true); } finally { try { if (inputStream != null) { inputStream.close(); } } catch (IOException e) { e.printStackTrace(); } } return false; }</code><technical_language>Hey, right this is harder I thought. I forgot tracking resource location in AndroidResourceManager a string, derived a reference IoC layer in ResourceTable. In order for stated approach sense change a bunch of code ResourceLocation based references (which I is great). review, I great state sticking of reference object, I of a cleaner implement this here, approach using</technical_language>

Target:
public boolean install(Resource r, ResourceLocation location, Reference ref, ResourceTable table, AndroidCommCarePlatform platform, boolean upgrade, boolean recovery) throws UnresolvedResourceException, UnfullfilledRequirementsException { super.install(r, location, ref, table, platform, upgrade, recovery); try { storeReleasedTime(platform, ref); } catch (ParseException e) { Logger.exception("Error on parsing x-commcarehq-appreleasedon header", e); throw new InvalidResourceException(r.getDescriptor(), e.getMessage()); } InputStream inputStream = null; try { Reference local = ReferenceManager.instance().DeriveReference(localLocation); inputStream = local.getStream(); ProfileParser parser = new ProfileParser(inputStream, platform, table, r.getRecordGuid(), Resource.RESOURCE_STATUS_UNINITIALIZED, false); Profile p = parser.parse(); if (recovery) { validateRecovery(platform, p); } if (!upgrade) { initProperties(p); if (!recovery) { checkDuplicate(p); checkAppTarget(); } } table.commitCompoundResource(r, upgrade ? Resource.RESOURCE_STATUS_UPGRADE : Resource.RESOURCE_STATUS_INSTALLED, p.getVersion()); return true; } catch (XmlPullParserException | InvalidReferenceException | IOException e) { e.printStackTrace(); } catch (InvalidStructureException e) { throw new UnresolvedResourceException(r, "Invalid content in the Profile Definition: " + e.getMessage(), true); } finally { try { if (inputStream != null) { inputStream.close(); } } catch (IOException e) { e.printStackTrace(); } } return false; }