[TIMOB-27948] Android: Use of wrong string operator in string comparison in TiJSService
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-11-23T22:01:23.000+0000 |
Affected Version/s | Release 8.3.1, Release 9.0.2, Release 9.1.0 |
Fix Version/s | Release 9.3.0 |
Components | Android |
Labels | n/a |
Reporter | Ewan Harris |
Assignee | Joshua Quick |
Created | 2020-06-08T17:19:43.000+0000 |
Updated | 2020-11-23T22:01:23.000+0000 |
Description
Description
In [TiJSService](https://github.com/appcelerator/titanium_mobile/blob/4336b21ef89ac8745a4de318e66f3d9c5f8d7fb1/android/modules/android/src/java/ti/modules/titanium/android/TiJSService.java#L59) we use the!=
operator to compare a string, this should be updated to use .equals()
as this can be flagged by some security scans.
Note that this is a minor issue as the code path is only active when debug logging is enabled
Unfortunately our Java checkstyle tool won't trigger a build failure when doing string variable reference equals/not-equals like this. It only checks string "literal" reference equality. https://checkstyle.sourceforge.io/config_coding.html#StringLiteralEquality
PR (master): https://github.com/appcelerator/titanium_mobile/pull/12166
Verified on: Mac OS: 10.15.4 SDK: 9.3.0.v20201123121926 Appc CLI: 8.1.1 JDK: 11.0.6 Node: 12.16.1 Studio: 6.0.0.202005141803 Device: Pixel 3 XL(v11.0) emulator