Fix NoSuchMethod exception for HelperSHA256 on API Level prior to P #1117

Merged
kekkyojin merged 1 commit from fix-nosuchmethod-commons into master 2021-01-12 08:32:09 +01:00
kekkyojin commented 2021-01-11 20:57:13 +01:00 (Migrated from github.com)

PR Checklist

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe: Instrumented test

What is the current behavior?

On devices running older than Android Pie, an exception will be raised when using Helper.SHA256 method.

What is the new behavior?

Now code has been splitted so newer versions will run curent code, while older ones will run the patched one.

Other information

An instrumented test has been added. I was unable to test it on an emulator. Running the test on my physical Android 8.1 (Oreo MR1) device, it is now working as expected.

To run the instrumented test, open the "tests" view on the Project sidebar tab, an click the "Run" icon on the HelperTest.java on the androidTest folder.

## PR Checklist <!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" --> Please check all that apply to this PR using "x": - [x] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged) - [x] I have checked that this PR does not introduce a breaking change - [ ] This PR introduces breaking changes and I have provided a detailed explanation below ## PR Type What kind of change does this PR introduce? - [x] Bugfix - [ ] Feature - [ ] Code style update (formatting) - [ ] Refactoring (no functional changes) - [ ] Documentation changes - [x] Other - Please describe: Instrumented test ## What is the current behavior? On devices running older than Android Pie, an exception will be raised when using Helper.SHA256 method. ## What is the new behavior? Now code has been splitted so newer versions will run curent code, while older ones will run the patched one. ## Other information An instrumented test has been added. I was unable to test it on an emulator. Running the test on my physical Android 8.1 (Oreo MR1) device, it is now working as expected. To run the instrumented test, open the "tests" view on the Project sidebar tab, an click the "Run" icon on the HelperTest.java on the androidTest folder. <!-- If this PR contains a breaking change, please describe the impact and solution strategy for existing applications below. -->
akinwale (Migrated from github.com) approved these changes 2021-01-12 08:32:02 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-android#1117
No description provided.