Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27300] Android: AssetCryptImpl buffer overflow for large JS assets

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-08-07T00:29:57.000+0000
Affected Version/sRelease 8.1.0
Fix Version/sRelease 8.1.0
ComponentsAndroid
Labelsandroid, engSchedule
ReporterGary Mathews
AssigneeGary Mathews
Created2019-07-30T22:28:47.000+0000
Updated2019-12-05T03:48:44.000+0000

Description

*Summary:* A buffer overflow or out-of-memory exception can occur for device builds (ie: encrypted assets) if the total byte size of all JavaScript source code exceeds the max heap size. This is more likely to happen when transpiled and source-maps are enabled. *Steps to reproduce:*

Create a Classic Titanium app project using current *8_1_X*

Unzip the attached [^TIMOB-27300.zip] to the project's "Resources" directory.

Build and run on a physical Android device. (Alternatively, build with deployment type -D test.)

When the app launches, note that an exception occurs in the log.

*Result:* - An "BufferOverflowException" gets logged. *Expected Result:* - App should have successfully started and display a green window. *Notes* - If you receive an "OutOfMemory" exception, test on a different device that has enough RAM to load the test case. *Recommended Solution:* Refactor titanium_prep to prevent BufferOverflowException for large Javascript files.

Attachments

FileDateSize
AppResources.zip2019-07-31T19:39:55.000+000098218
TIMOB-27300.zip2019-08-06T17:55:50.000+000079708

Comments

  1. Gary Mathews 2019-07-31

    titanium_prep: https://github.com/appcelerator/titanium_prep/pull/33 8_1_X: https://github.com/appcelerator/titanium_mobile/pull/11100 master: https://github.com/appcelerator/titanium_mobile/pull/11103
  2. Lokesh Choudhary 2019-08-06

    FR's Passed. PR's Merged.
  3. Lokesh Choudhary 2019-08-07

    Verified the fix in SDK 8.1.0.v20190806151528 & 8.2.0.v20190806115125. Closing.

JSON Source