Exclude package from dependency/runtime repackage dependency

Hello. I use rhino in my android app.
There is bug in android https://code.google.com/p/android/issues/detail?id=208331
It doesn’t allow me to use dependency with using of javax.swing.*
I don’t need these classes. So, how can I remove javax.swing and all classes which use it from dependency? Or repackage dependency in runtime?
Or repackaging by hand is single way to do it?