Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23298] Module Error during App startup with Ti SDK 5.2.1.GA and 5.2.2.GA but works on 5.1.2.

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-05-09T17:19:41.000+0000
Affected Version/sRelease 5.2.0, Release 5.2.1, Release 5.2.2
Fix Version/sBacklog
ComponentsiOS
LabelsModule
ReporterMotiur Rahman
AssigneeHans Knöchel
Created2016-04-29T20:21:02.000+0000
Updated2017-07-26T03:25:31.000+0000

Description

description

We have a custom module that uses IBM's Trusteer SDK to perform some device checks during app startup. We were notified by Google that our app built with SDK version 5.1.2.GA has a security vulnerability. Appcelerator support recommended upgrading to 5.2.1.GA. During upgrade, we found that the Trusteer custom module failed to load during startup causing app crash. See below for the error log. We found that the issue exists in version 5.2.2.GA as well. Since it's working with 5.1.2.GA, we assume that something changed in the newer SDK versions broke the module.

Steps to Reproduce

1. Create a sample Alloy or Classic App. 2. Paste the below code into the app.js file. 3. Add the attached module. 4. Run on iOS device or simulator.

Expected behaviour

Since it works on Ti SDK - 5.1.2. It should works on later version.

Test code

var win = Ti.UI.createWindow({
	backgroundColor : "Red"
});

// Create a Button.
var ShowData = Ti.UI.createButton({
	title : 'ShowData',
	height : 100,
	width : 100,

});

// Listen for click events.
ShowData.addEventListener('click', function() {

	Ti.API.info("Loading Trusteer module...");
	var TrusteerModule = require('com.comerica.trusteer');

	var trusteerResponse = TrusteerModule.getRiskAssessment();
	alert(JSON.stringify(trusteerResponse));

});

// Add to the parent view.
win.add(ShowData);

win.open();

log

[INFO] :   Loading Trusteer module...
[INFO] :   2016-04-30 02:02:28.013 CustomerIssue1[98143:524842] [ERROR] contentsAtPath failed for key tas//manifest.rpkg
[INFO] :   2016-04-30 02:02:28.013 CustomerIssue1[98143:524842] [ERROR] Failed to load manifest (section:taz.app-res) (file:manifest.rpkg)
[INFO] :   2016-04-30 02:02:28.019 CustomerIssue1[98143:524842] [ERROR] contentsAtPath failed for key tas//default_conf.rpkg
[INFO] :   2016-04-30 02:02:28.019 CustomerIssue1[98143:524842] [ERROR] Failed to load default configuration (section:taz.app-res) (file:default_conf.rpkg)
[INFO] :   2016-04-30 02:02:28.019 CustomerIssue1[98143:524842] [WARN ] <2>
[INFO] :   2016-04-30 02:02:28.019 CustomerIssue1[98143:524842] [ERROR] contentsAtPath failed for key tas//default_conf.rpkg
[INFO] :   2016-04-30 02:02:28.020 CustomerIssue1[98143:524842] [ERROR] Failed to load default configuration (section:taz.app-res) (file:default_conf.rpkg)
[INFO] :   2016-04-30 02:02:28.020 CustomerIssue1[98143:524842] [ERROR] Failed to load default rpkg
[INFO] :   2016-04-30 02:02:28.020 CustomerIssue1[98143:524842] [INFO ] taz server configuration initialized with revisions <0,0>
Thanks

Comments

  1. Chee Kiat Ng 2016-05-02

    [~morahman] Does this app have enabled in tiapp.xml? Also, the description is extremely misleading. It says Google says the app has security vulnerability but reproducing steps indicate the error is seen in iOS. Did you mean to say APPLE? And can you give the exact words that APPLE said about the security vulnerability?
  2. Motiur Rahman 2016-05-02

    [~cng] [~apetkov], Regarding your question, the Google security vulnerability and the module issue are completely different. They wanted to upgrade the SDK version due to Google's recommendation to fix the security issue. While upgrading they found the module issue on iOS. Just to be clear, the security issue is with Google only(Android). Now the main problem module is not working on latest build(5.2.1, 5.2.2). But works on 5.1.2 (iOS). Let me know if you have any questions.
  3. Chee Kiat Ng 2016-05-02

    Thanks for the clarification! [~apetkov] can you download to module and reproduce see if any regression between 5.2.1 and 5.1.2 caused this? I'm guessing since it's a minor version bump, it may be something to do with deprecated properties or methods.
  4. Angel Petkov 2016-05-03

    [~morahman] Hello, i tried to re-produce the crash using SDK 5.2.3 as its the only 5_2_X available on appcelerator build [servers](http://builds.appcelerator.com.s3.amazonaws.com/index.html#5_2_X). The application created using the provided code and module did not crash.Is this crash happening both when launching to android and iOS, could you try running it on 5_2_3 please ? Edit: Could you also please add the tiapp.xml to the description if something was added thats not there by default.
  5. Motiur Rahman 2016-05-03

    [~apetkov], I can reproduce that issue on master version 5.2.3.v20160404160237 also with the following env - Appcelerator Command-Line Interface, version 5.2.2 Operating System Name = Mac OS X Version = 10.11.4 Node.js Node.js Version = 4.2.2 npm Version = 2.14.7 Titanium CLI CLI Version = 5.0.6 Titanium SDK SDK Version = 5.2.3.v20160404160237 iPhone 5s = v 9.3.1 Just add module folder inside the App and app.js code then launch on iOS no need to add anything on tiapp.xml or anywhere. Thanks.
  6. Hans Knöchel 2016-05-09

    Hey guys, the issue is the following: The way modules handle Resources changed in 5.2.0.GA, discussed in TIMOB-20489 and fixed in Ti.SDK >= 5.2.1.GA. Long story short: The files placed in /platform/iphone/ need to be placed in /Resources/ (the directory might not exist, yet, create it). If you want to have the module also work with 5.1.X e.g. for backwards-compatibility, you can courage both directories for now. I will ping [~apetkov] to do further handling this ticket. Thanks!
  7. Hans Knöchel 2016-05-09

    Here is a screenshot of the proposed directory structure with fallback for older SDK's (optional): http://abload.de/img/bildschirmfoto2016-05urjd1.png Result (success): http://abload.de/img/bildschirmfoto2016-05v5kjx.png
  8. Hans Knöchel 2016-05-09

    Resolved as fixed, using the below solution. No SDK-update required, so fix-version "backlog". Please verify the fix so we can close the issue, thanks!
  9. Kanmani Raja 2016-05-09

    Do we need to recompile all modules with the new directory structure in order to upgrade from SDK version pre 5.2.0 to 5.2.0 and above?
  10. Hans Knöchel 2016-05-09

    Recompining not even necessary, only change the directory in the existing one. Of course it is recommended to recompile it, but it is not necessary, as long as the structure is correct.
  11. Kanmani Raja 2016-05-09

    If we change the directory structure in the app, then the module code base will be out of sync. It's going to affect the way our code is organized, and versioned. Is there any other way to fix this issue?
  12. Hans Knöchel 2016-05-09

    It is a one-time change. Recommended is to move the directory so you only have the Resources directory holding the files. So you can commit the changes once, recompile the module and distribute it. It's a very simple solution and does not require any further code-changes. EDIT: The code-base is not affected at all, it's only the content of the above discussed platform directory.
  13. Lee Morris 2017-07-26

    Closing as fixed.

JSON Source