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

Resolving use of reflection in valueForString() function #769

Open
askirk opened this issue May 22, 2018 · 0 comments
Open

Resolving use of reflection in valueForString() function #769

askirk opened this issue May 22, 2018 · 0 comments
Labels
best practice Not a defect but something that should be improved anyway rpc Relating to the RPC layer

Comments

@askirk
Copy link
Contributor

askirk commented May 22, 2018

Bug Report

Currently the generic RpcStruct class uses a method in a bunch of classes called valueForString that each return a specific type according to the object. (https://github.com/smartdevicelink/sdl_android/blob/master/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStruct.java#L204) If an app developer obfuscates the library within their app, this causes the reflective call not to work. Additionally, Android P guidelines prohibit the use of reflection on non-SDK interfaces. (https://developer.android.com/preview/restrictions-non-sdk-interfaces) Therefore, a solution should be saught that doesn't use reflection.

Reproduction Steps
  1. Build and run a release version of an app that integrates SDL and connects over any transport. The app's build.gradle should specify minifyEnabled = true.
  2. Connect app to a TDK / core instance
  3. View logcat errors, several NoSuchMethodException errors seen
OS & Version Information
  • Android Version: 8.1.0
  • SDL Android Version: 4.5.0
  • Testing Against: Pixel
@joeljfischer joeljfischer added best practice Not a defect but something that should be improved anyway rpc Relating to the RPC layer and removed low priority labels May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
best practice Not a defect but something that should be improved anyway rpc Relating to the RPC layer
Projects
None yet
Development

No branches or pull requests

3 participants