-
Notifications
You must be signed in to change notification settings - Fork 66
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
XadesProfileResolutionException in Android #154
Comments
/CC @treekt, @jzeferino |
@treekt can you hard-code some XML and certificate files in the sample itself? Makes it easier to test... You can use test certs from the xades4j repo, if needed. |
I have tried but in Android If i want to get file from resources I get InputStream and thats problem because in Xades4j I have to provide cert path for create KeyingDataProvide etc.. |
You'd need to create a new class derived from the abstract |
@treekt witch android version are you running the app? Can you please try to test again with the files below and give the output please? Download the LG.pfx and use the password: |
Its Android 7.0, Huawei P9 Lite, so its real device. In addition I pushed changes to remote. |
I commented out these lines: And then above stack trace is absent but again app throw XadesProfileResolutionException |
@treekt any chance for you to share your certificate or a copy of it? |
Unfortunately no because Its certificate from my company. |
@jzeferino When I used cert which you told me I got SigningKeyException but after remove this problem I got again XadesProfileResolutionException. You didnt get it ? |
@treekt how did you:
? |
I said a few posts above.. |
@treekt after commented the line you told I've got the Now I will see what I can do with @luisgoncalves. |
I've been looking through the stack trace and googling a bit... It seems that Guice uses a lot of reflection (and maybe code generation?) in runtime, which may be the issue. In the stack trace we have:
Some links:
Could it be that Android (or some security setting?) prevents such operations? I'll try to find more infos... |
OK, it it really seems related to byte-code generation: https://github.com/google/guice/wiki/OptionalAOP. They mention "cglib" in the AOP version, which is part of the code path in the stack trace.., I think xades4j is not using interception, so maybe it could run with "Guice no-AOP". Not sure if it would be enough to drop the no-AOP jar in the app binaries and try it. If not, we'd have to change the dependency in xades4j build, see if everything plays out, and try this with a new jar. |
I was looking a bit more into this:
Conclusion so far is: unless there's something that could make AOP/byte code generation work in Android, there isn't a quick fix for the issue at hands. Other ideas:
|
I have tried replace default Guice in your library to no-aop version by changing dependendcy |
Did you have any issues with upgrading Guice? |
@treekt - did you resolve this issue ? |
bump |
@lexboss93 this is a tricky one, mostly due to JAXB issues reported by @treekt. The Guice AOP/multibindings problem could probably be worked around by changing the internal DI configuration, but replacing JAXB is a much bigger endeavor, as it is a big rewrite on the lib and, from what I found, there aren't good alternatives for Android. |
Following this question in S.O., we need to investigate the reason for the exception. Is it actually possible to run xades4j as is on Android?
Full strack trace: https://pastebin.com/DXPG91DV.
Sample Android app: https://github.com/treekt/xadesSigning
The text was updated successfully, but these errors were encountered: