1

I have a problem with checking OpenSSL version in Android device. I've tried to grep OpenSSL from system/lib/libssl.so with java runtime.exec, but it doesn't work?

Anyone can help me, how to make a command to check OpenSSL version in Android?

1 Answer 1

2

grep doesn't really like binary files, but you can extract the strings from the binary and grep those using strings. This binary is not available on most stock ROMs, but you can use Busybox or a similar tool to use it on most devices.

On my device the following command lists the correct OpenSSL version used by libssl.so:

strings /system/lib/libssl.so | grep -i openssl

This gives me the following output:

OpenSSLDie
OPENSSL_cleanse
OPENSSL_DIR_read
OPENSSL_DIR_end
external/openssl/ssl/bio_ssl.c
external/openssl/ssl/d1_both.c
external/openssl/ssl/d1_enc.c
external/openssl/ssl/d1_lib.c
external/openssl/ssl/d1_pkt.c
external/openssl/ssl/d1_srtp.c
external/openssl/ssl/s23_clnt.c
external/openssl/ssl/s23_lib.c
external/openssl/ssl/s23_srvr.c
external/openssl/ssl/s2_clnt.c
external/openssl/ssl/s2_enc.c
external/openssl/ssl/s2_lib.c
external/openssl/ssl/s2_pkt.c
external/openssl/ssl/s2_srvr.c
external/openssl/ssl/s3_both.c
external/openssl/ssl/s3_cbc.c
external/openssl/ssl/s3_clnt.c
external/openssl/ssl/s3_enc.c
external/openssl/ssl/s3_lib.c
external/openssl/ssl/s3_pkt.c
external/openssl/ssl/s3_srvr.c
external/openssl/ssl/ssl_asn1.c
external/openssl/ssl/ssl_cert.c
OPENSSL_DIR_read(&ctx, '
external/openssl/ssl/ssl_ciph.c
OPENSSL_malloc Error
OpenSSL 1.0.1j 15 Oct 2014
external/openssl/ssl/ssl_lib.c
external/openssl/ssl/ssl_rsa.c
external/openssl/ssl/ssl_sess.c
external/openssl/ssl/ssl_txt.c
external/openssl/ssl/t1_enc.c
external/openssl/ssl/t1_lib.c
external/openssl/ssl/t1_reneg.c
external/openssl/ssl/tls_srp.c
DTLSv1 part of OpenSSL 1.0.1j 15 Oct 2014
SSLv2 part of OpenSSL 1.0.1j 15 Oct 2014
SSLv3 part of OpenSSL 1.0.1j 15 Oct 2014
TLSv1 part of OpenSSL 1.0.1j 15 Oct 2014

I can't confirm that this works for every device, but I see no reason why this would fail.

8
  • +1, although the command wouldn't work on an ordinary ROM. strings binary is not included in a typical stock ROM. You would need Busybox for that.
    – Firelord
    Oct 4, 2015 at 19:33
  • @Firelord sorry, I did not know that. Thank you for correcting me.
    – gertmenkel
    Oct 4, 2015 at 19:34
  • @gertmenkel , how to check it if i unroot user? with shell command java runtime? Oct 5, 2015 at 3:46
  • @Erwin Sitorus questions about writing apps (on Android or in general) should be asked over at stackoverflow.com. This site is intended for Android users, not Android programmers.
    – gertmenkel
    Oct 5, 2015 at 7:37
  • @gertmenkel, i just wanna checking it if i unroot user with shell comand, because busy box only running if i root user. Oct 11, 2015 at 23:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .