Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): string reference equality in service code #12166

Merged
merged 3 commits into from Oct 8, 2020

Conversation

jquick-axway
Copy link
Contributor

@jquick-axway jquick-axway commented Oct 8, 2020

JIRA:
https://jira.appcelerator.org/browse/TIMOB-27948

Summary:

  • Android service code was wrongly doing string reference equality instead of value equality.
  • Minor issue since it only affects debug logging.
  • Changed to satisfy security scanning apps such as Veracode.

Test:

  1. Add the below "tiapp.xml" setting to your project. (You need to set debug to true.)
  2. Add the below "app.js" and "MyService.js" to your project.
  3. Build with debug logging enabled. Ex: appc run -p android -l debug
  4. In the log, verify you see a message similar to the below.
    [DEBUG] TiJSService: (main) [##,##] Eval JS Service: MyService.js (app://MyService.js)

tiapp.xml

<ti:app>
	<property name="ti.android.debug" type="bool">true</property>
	<android xmlns:android="http://schemas.android.com/apk/res/android">
		<services>
			<service url="MyService.js"/>
		</services>
	</android>
</ti:app>

./Resources/app.js

Ti.Android.startService(Ti.Android.createServiceIntent({
	url: "MyService.js",
}));

./Resources/MyService.js

Ti.API.info("@@@ Service started.");

@build
Copy link
Contributor

build commented Oct 8, 2020

Messages
📖

💾 Here's the generated SDK zipfile.

📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖

✅ All tests are passing
Nice one! All 9753 tests are passing.
(There are 983 skipped tests not included in that total)

Generated by 🚫 dangerJS against 4ccf234

@ssekhri
Copy link

ssekhri commented Oct 8, 2020

FR Passed
Verified on:
Mac OS: 10.15.4
SDK: 9.3.0.v20201008074113
Appc CLI: 8.1.1
JDK: 11.0.4
Node: 10.17.0
Studio: 6.0.0.202005141803
Device: Pixel 3 XL(v11.0) emulator

@sgtcoolguy sgtcoolguy merged commit 5ba35d3 into tidev:master Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants