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

Forbidden package access rule #40

Closed
GoogleCodeExporter opened this issue Mar 14, 2015 · 3 comments
Closed

Forbidden package access rule #40

GoogleCodeExporter opened this issue Mar 14, 2015 · 3 comments
Assignees
Milestone

Comments

@GoogleCodeExporter
Copy link

I was also looking for an option to detect any access to a "forbidden" package 
or package structure, as in:

@defaultMessage Hands off from these packages.
com.foo.**
com.boo.**

The use case scenario is actually quite specific -- we have a project structure 
which is shaded/ obfuscated during the build, but during development all 
packages are visible. It'd be nice to capture those forbidden package calls 
even before obfuscation/ ITs take place.

Should be trivial to implement -- you don't need to even know what is in those 
packages, just scan all class literals. 

Parsing and distinguishing these rules from other rules may require changes in 
ruleset syntax though.

Original issue reported on code.google.com by dawid.weiss@gmail.com on 4 Nov 2014 at 11:32

@GoogleCodeExporter
Copy link
Author

In fact this would something like an extension to the current detection of 
sun.misc.Unsafe.

I can make that more generic to have a more generic filter on more packages 
(actually it currently just checks the prefix of full class name against a 
"blacklist").

The syntax looks fine, btw. :-)

Original comment by uwe.h.schindler on 4 Nov 2014 at 11:47

@GoogleCodeExporter
Copy link
Author

Original comment by uwe.h.schindler on 4 Nov 2014 at 11:48

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Awesome! Thanks Uwe. I may look at it myself, time permitting. It's not a high 
priority issue, just something I needed and couldn't find. My itch.

As for syntax, it was borrowed from proguard, Erik Lafortune did a good job 
there I think.

http://proguard.sourceforge.net/manual/usage.html#classspecification

Original comment by dawid.weiss@gmail.com on 4 Nov 2014 at 11:55

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

No branches or pull requests

2 participants