Discussion:
Reading from CERT.RSA from META-INF directory
Nate Totura
2011-06-14 17:57:59 UTC
Permalink
Is it possible to read files in the META-INF directory such as the
CERT.RSA file?

I have tried the following:

AssetFileDescriptor afd = am.openNonAssetFd("META-INF/CERT.RSA");

but I get the exception:

java.io.FileNotFoundException: This file can not be opened as a file
descriptor; it is probably compressed


If that file is really compressed, is there a way to still open it for
read access?

Thanks,
Nate
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Nikolay Elenkov
2011-06-15 02:39:19 UTC
Permalink
Post by Nate Totura
Is it possible to read files in the META-INF directory such as the
CERT.RSA file?
Sure. What exactly are you trying to do? Read from jar file?
Read from exploded jar file? What do you need those file for?
You really need to provide more details to get a useful answer.
Post by Nate Totura
 AssetFileDescriptor afd = am.openNonAssetFd("META-INF/CERT.RSA");
 java.io.FileNotFoundException: This file can not be opened as a file
descriptor; it is probably compressed
Why are you using the AssetManager for this? If this is a jar/apk,
look at JarFile/JarEntry for ideas.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Nate Totura
2011-06-15 18:18:49 UTC
Permalink
To clarify, I would like to do this at runtime. Access to the
certificate information at runtime is really what I want.
-Nate
Post by Nikolay Elenkov
Post by Nate Totura
Is it possible to read files in the META-INF directory such as the
CERT.RSA file?
Sure. What exactly are you trying to do? Read from jar file?
Read from exploded jar file? What do you need those file for?
You really need to provide more details to get a useful answer.
Post by Nate Totura
 AssetFileDescriptor afd = am.openNonAssetFd("META-INF/CERT.RSA");
 java.io.FileNotFoundException: This file can not be opened as a file
descriptor; it is probably compressed
Why are you using the AssetManager for this? If this is a jar/apk,
look at JarFile/JarEntry for ideas.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Nikolay Elenkov
2011-06-16 01:25:57 UTC
Permalink
Post by Nate Totura
To clarify, I would like to do this at runtime. Access to the
certificate information at runtime is really what I want.
That doesn't clarify much... If want to read it from an apk,
use JarFile.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Nate Totura
2011-06-21 20:00:50 UTC
Permalink
Ahh, I see what you are saying now, I have never used those (JarFile/
JarEntry) APIs before.

Thank you!
Post by Nate Totura
To clarify, I would like to do this at runtime. Access to the
certificate information at runtime is really what I want.
That doesn't clarify much... If  want to read it from an apk,
use JarFile.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Loading...