Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12407] JS Files unreachable on iOS device builds via Ti.Filesystem

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-14T21:00:33.000+0000
Affected Version/sRelease 3.0.0, Release 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterChristian Sullivan
AssigneeEric Merriman
Created2013-01-24T02:37:22.000+0000
Updated2017-06-14T21:00:33.000+0000

Description

Unable to retrieve js files in application resources directory. Also getDirectoryListing( ) returns files and directories, but is missing js files and directories. TEST CASE

// execute with a file named tequire.js in your app resource directory

// Works on Simulator
// Fails on device

try {
  var t1 = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory + '/tequire.js').read().text;
} catch (e) { }


// Works on Simulator
// Fails on device

try {
  var t2 = Ti.Filesystem.getFile('tequire.js').read().text;
} catch (e) { }

// Fails on Simulator
// Fails on device

try {
  var t3 = Ti.Filesystem.getFile('/tequire.js').read().text;
} catch (e) { }


alert('TEST1: '+(t1||'').length+' \nTEST2: '+(t2||'').length+' \nTEST3:' + (t3||'').length);

Comments

  1. Blain Hamon 2013-01-25

    We might want to do this as a feature request. Access to the js files on device is limited (IE, the files are not actually there, but stored in the binary) for security reasons (limit reverse engineering).
  2. Lee Morris 2017-06-14

    Closing ticket due to the time passed and lack of progress in the past few years. Any further problems, please file a new ticket.

JSON Source