Skip to content

Commit

Permalink
Merge branch '8_3_X' into TIMOB-27604_83X
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Nov 15, 2019
2 parents 1fbea40 + f03e3c3 commit cbcf107
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 1 addition & 3 deletions android/templates/build/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ public final class <%= classname %>Application extends TiApplication
@Override
public void onCreate()
{
appInfo = new <%= classname %>AppInfo(this);
<% if (encryptJS) { %>
KrollAssetHelper.setAssetCrypt(new AssetCryptImpl());
<% } %>

// Load cache as soon as possible.
KrollAssetCache.init(this);

super.onCreate();

appInfo = new <%= classname %>AppInfo(this);
postAppInfo();

V8Runtime runtime = new V8Runtime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,15 @@ public void softRestart()
runtime.initRuntime();

// manually re-launch app
runtime.doRunModuleBytes(KrollAssetHelper.readAssetBytes(appPath), appPath, rootActivity.getActivityProxy());
if (KrollAssetHelper.assetExists(appPath)) {
runtime.doRunModuleBytes(KrollAssetHelper.readAssetBytes(appPath), appPath,
rootActivity.getActivityProxy());

// launch script does not exist, must be using snapshot
// execute startup method baked in snapshot
} else {
runtime.doRunModule("global._startSnapshot(global)", appPath, rootActivity.getActivityProxy());
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected void loadScript()
// launch script does not exist, must be using snapshot
// execute startup method baked in snapshot
} else {
KrollRuntime.getInstance().runModule("global.startSnapshot(global)", fullUrl, activityProxy);
KrollRuntime.getInstance().runModule("global._startSnapshot(global)", fullUrl, activityProxy);
}
} finally {
Log.d(TAG, "Signal JS loaded", Log.DEBUG_MODE);
Expand Down
3 changes: 1 addition & 2 deletions build/lib/android/startup.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
this.startSnapshot = function (global) {
delete global.startSnapshot;
this._startSnapshot = function (global) {
<%- script %>
}

0 comments on commit cbcf107

Please sign in to comment.