[TIMOB-26217] iOS: File methods isFile() and isDirectory() are missing for encrypted assets
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-09-19T21:35:07.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.5.0 |
Components | iOS |
Labels | file, ios, parity |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2018-07-18T02:16:15.000+0000 |
Updated | 2018-10-03T18:39:39.000+0000 |
Description
*Summary:*
On iOS, when loading an encrypted asset such as "app.js" via The
Ti.Filesystem.getFile()
, the returned File
object is missing methods isFile()
and isDirectory()
. Attempting to call these methods will cause JavaScript runtime error.
This is an issue for iOS "production" builds and "test" builds for device.
This is not an issue for iOS Simulator builds since JS files are not encrypted.
This is not an issue on Android.
*Steps to reproduce:*
Create a Titanium project with the below code.
Build and run to an iOS device.
Notice that the app crashes on startup.
Build and run to the iOS simulator.
The isFile()
and isDirectory()
methods work and are correctly logged.
var file = Ti.Filesystem.getFile("app.js");
Ti.API.info("@@@ app.js isFile(): " + file.isFile());
Ti.API.info("@@@ app.js isDirectory(): " + file.isDirectory());
*Cause:*
Our TiFileSystemBlobProxy.m
code is missing the isFile()
and isDirectory()
methods.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/10112
The diff can be found here... https://github.com/appcelerator/titanium_mobile/pull/10112/commits/afc75ad2a229f11a5febbaa48edff2697b484a4c
While I would rather want to see this in an own PR, I think it's okay to do it as part of TIMOB-26015.
FR Passed. The returned
File
object is contains methodsisFile()
andisDirectory()
for both production & test builds. Studio Ver: 5.1.1.201809051655 SDK Ver: 7.5.0 local build OS Ver: 10.13.5 Xcode Ver: Xcode 9.4.1 Appc NPM: 4.2.13 Appc CLI: 7.0.6 Daemon Ver: 1.1.3 Ti CLI Ver: 5.1.1 Alloy Ver: 1.13.2 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 10.0.2 Device: Iphone 7 IOS 11.4 Simulator: Iphone 8 IOS 11.4PR Merged.
Verified the fix on sdk 7.5.0.v20181003071100.No crash on start up. isFile() and isDirectory() method works fine and logged correctly. Closing.