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: Update ProGuard keep rules for Breadcrumb class #114

Merged
merged 2 commits into from
Jun 21, 2018

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Jun 21, 2018

Goal

The NDK requires access to the Breadcrumb class as of 1.2.0, which changed location in the bugsnag-android notifier from an inner to root class. This fix
ensures that our added ProGuard rules keep the class, making it accessible via the JNI.

Changeset

Added proguard entry to keep new class location

Tests

Tested against NDK example project with bugsnag-android-ndk 1.2.0, a local maven installation of the plugin, and ProGuard enabled. With the old plugin version, the notifier crashes on startup, with this fix it launches and is capable of notifying. Adding the keep rule to the ProGuard file manually also works.

Review

For the submitter, initial self-review:

  • Commented on code changes inline explain the reasoning behind the approach
  • Reviewed the test cases added for completeness and possible points for discussion
  • A changelog entry was added for the goal of this pull request
  • Check the scope of the changeset - is everything in the diff required for the pull request?
  • This pull request is ready for:
    • Initial review of the intended approach, not yet feature complete
    • Structural review of the classes, functions, and properties modified
    • Final review

For the pull request reviewer(s), this changeset has been reviewed for:

  • Consistency across platforms for structures or concepts added or modified
  • Consistency between the changeset and the goal stated above
  • Internal consistency with the rest of the library - is there any overlap between existing interfaces and any which have been added?
  • Usage friction - is the proposed change in usage cumbersome or complicated?
  • Performance and complexity - are there any cases of unexpected O(n^3) when iterating, recursing, flat mapping, etc?
  • Concurrency concerns - if components are accessed asynchronously, what issues will arise
  • Thoroughness of added tests and any missing edge cases
  • Idiomatic use of the language

the NDK requires access to the Breadcrumb class as of 1.2.0, which changed location. this fix
ensures the class is kept so that it can be accessed via the JNI
@fractalwrench fractalwrench changed the title fix: automatic config of proguard for ndk library fix: Update ProGuard keep rules for Breadcrumb class Jun 21, 2018
@fractalwrench fractalwrench requested a review from a team June 21, 2018 09:00
@fractalwrench fractalwrench merged commit 2bc6e6f into next Jun 21, 2018
@fractalwrench fractalwrench deleted the fix-proguard-autoconfig branch June 21, 2018 09:45
@@ -17,6 +17,7 @@ class BugsnagProguardConfigTask extends DefaultTask {
static final String PROGUARD_CONFIG_SETTINGS = """\
-keepattributes LineNumberTable,SourceFile
-keep class com.bugsnag.android.NativeInterface { *; }
-keep class com.bugsnag.android.Breadcrumb { *; }
-keep class com.bugsnag.android.Breadcrumbs { *; }
-keep class com.bugsnag.android.Breadcrumbs\$Breadcrumb { *; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldnt see com.bugsnag.android.Breadcrumbs\$Breadcrumb but maybe i'm missing something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. We need to keep it in the ProGuard rules for backwards compatibility with older notifiers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants