Home » Android » selinux – Where are all the shared libraries stored on android?

selinux – Where are all the shared libraries stored on android?

Posted by: admin June 15, 2020 Leave a comment

Questions:

Where are all the shared libraries (.so) stored on Android? I was able to find the /system/lib directory but I’m sure there are more. Not being able to use the find command doesn’t help either.

How to&Answers:

In the many AOSP and vendor images I have analyzed, I’ve observed a regular pattern of locations for shared libraries, as follows (some of these are only in newer versions):

  • system/app/<name>/lib/<arch>
  • system/priv-app/<name>/lib/<arch>
  • system/lib
  • system/lib64
  • system/vendor/lib
  • system/vendor/lib64

I’ve also occasionally seen non-standard locations, for example system/csc/common/system/lib64/ on a Samsung Edge running Android 5.1.1.

Your best bet in finding the location of all shared libraries on a particular device is to recursively search the entire device filesystem as root using find / -name \*.so. If there’s no way for you to get find installed (via Busybox or the like), you might try extracting the system image, mounting it on a Linux system and running find over the mounted filesystem.

Answer:

adb shell 'find / -iname "*.so" 2>/dev/null'

ran surprisingly fast.

Answer:

Here’s all the .so files on my emulator with API level 23. Note that these are implementation details of a device and are not guaranteed to stay the same at any time.

These are all under /system.

./app/LatinIME/lib/x86/libjni_latinime.so
./app/LegacyCamera/lib/x86/libjni_legacymosaic.so
./app/OpenWnn/lib/x86/libWnnEngDic.so
./app/OpenWnn/lib/x86/libWnnJpnDic.so
./app/OpenWnn/lib/x86/libwnndict.so
./app/PacProcessor/lib/x86/libjni_pacprocessor.so
./app/PicoTts/lib/x86/libttscompat.so
./app/PicoTts/lib/x86/libttspico.so
./app/PrintSpooler/lib/x86/libprintspooler_jni.so
./lib/egl/libEGL_emulation.so
./lib/egl/libGLES_android.so
./lib/egl/libGLESv1_CM_emulation.so
./lib/egl/libGLESv2_emulation.so
./lib/hw/audio.primary.goldfish.so
./lib/hw/audio_policy.default.so
./lib/hw/camera.goldfish.jpeg.so
./lib/hw/camera.goldfish.so
./lib/hw/camera.ranchu.jpeg.so
./lib/hw/camera.ranchu.so
./lib/hw/fingerprint.goldfish.so
./lib/hw/fingerprint.ranchu.so
./lib/hw/gps.goldfish.so
./lib/hw/gps.ranchu.so
./lib/hw/gralloc.default.so
./lib/hw/gralloc.goldfish.so
./lib/hw/gralloc.ranchu.so
./lib/hw/keystore.default.so
./lib/hw/lights.goldfish.so
./lib/hw/local_time.default.so
./lib/hw/power.goldfish.so
./lib/hw/sensors.goldfish.so
./lib/hw/sensors.ranchu.so
./lib/hw/vibrator.goldfish.so
./lib/interrupter.so
./lib/invoke_mock_media_player.so
./lib/libEGL.so
./lib/libETC1.so
./lib/libFFTEm.so
./lib/libGLES_trace.so
./lib/libGLESv1_CM.so
./lib/libGLESv1_enc.so
./lib/libGLESv2.so
./lib/libGLESv2_enc.so
./lib/libGLESv3.so
./lib/libLLVM.so
./lib/libOpenMAXAL.so
./lib/libOpenSLES.so
./lib/libOpenglSystemCommon.so
./lib/libRS.so
./lib/libRSCpuRef.so
./lib/libRSDriver.so
./lib/libRScpp.so
./lib/libWnnEngDic.so
./lib/libWnnJpnDic.so
./lib/lib_renderControl_enc.so
./lib/libandroid.so
./lib/libandroid_runtime.so
./lib/libandroid_servers.so
./lib/libandroidfw.so
./lib/libart-compiler.so
./lib/libart-disassembler.so
./lib/libart.so
./lib/libaudioeffect_jni.so
./lib/libaudioflinger.so
./lib/libaudiopolicyenginedefault.so
./lib/libaudiopolicymanager.so
./lib/libaudiopolicymanagerdefault.so
./lib/libaudiopolicyservice.so
./lib/libaudioresampler.so
./lib/libaudiospdif.so
./lib/libaudioutils.so
./lib/libbacktrace.so
./lib/libbacktrace_test.so
./lib/libbase.so
./lib/libbcc.so
./lib/libbcinfo.so
./lib/libbinder.so
./lib/libblas.so
./lib/libc++.so
./lib/libc.so
./lib/libc_malloc_debug_leak.so
./lib/libc_malloc_debug_qemu.so
./lib/libcamera_client.so
./lib/libcamera_metadata.so
./lib/libcameraservice.so
./lib/libcommon_time_client.so
./lib/libcompiler_rt.so
./lib/libcrypto.so
./lib/libcutils.so
./lib/libdefcontainer_jni.so
./lib/libdiskconfig.so
./lib/libdl.so
./lib/libdrmframework.so
./lib/libdrmframework_jni.so
./lib/libeffects.so
./lib/libexif.so
./lib/libexpat.so
./lib/libext2_blkid.so
./lib/libext2_com_err.so
./lib/libext2_e2p.so
./lib/libext2_profile.so
./lib/libext2_quota.so
./lib/libext2_uuid.so
./lib/libext2fs.so
./lib/libext4_utils.so
./lib/libf2fs_sparseblock.so
./lib/libfilterfw.so
./lib/libfilterpack_facedetect.so
./lib/libfilterpack_imageproc.so
./lib/libframesequence.so
./lib/libft2.so
./lib/libgabi++.so
./lib/libgatekeeper.so
./lib/libgiftranscode.so
./lib/libgui.so
./lib/libhardware.so
./lib/libhardware_legacy.so
./lib/libharfbuzz_ng.so
./lib/libhidcommand_jni.so
./lib/libhwui.so
./lib/libicui18n.so
./lib/libicuuc.so
./lib/libimg_utils.so
./lib/libinput.so
./lib/libinputflinger.so
./lib/libinputservice.so
./lib/libiperf.so
./lib/libiprouteutil.so
./lib/libjavacore.so
./lib/libjavacrypto.so
./lib/libjhead.so
./lib/libjhead_jni.so
./lib/libjni_latinime.so
./lib/libjni_legacymosaic.so
./lib/libjni_pacprocessor.so
./lib/libjnigraphics.so
./lib/libjpeg.so
./lib/libkeymaster1.so
./lib/libkeymaster_messages.so
./lib/libkeystore-engine.so
./lib/libkeystore_binder.so
./lib/liblog.so
./lib/liblogwrap.so
./lib/libm.so
./lib/libmdnssd.so
./lib/libmedia.so
./lib/libmedia_jni.so
./lib/libmedialogservice.so
./lib/libmediandk.so
./lib/libmediaplayerservice.so
./lib/libmediautils.so
./lib/libmemtrack.so
./lib/libminikin.so
./lib/libmtp.so
./lib/libnativebridge.so
./lib/libnativehelper.so
./lib/libnbaio.so
./lib/libnetd_client.so
./lib/libnetlink.so
./lib/libnetutils.so
./lib/libnfc_ndef.so
./lib/libnl.so
./lib/libopus.so
./lib/libpac.so
./lib/libpagemap.so
./lib/libpcre.so
./lib/libpdfium.so
./lib/libpixelflinger.so
./lib/libpng.so
./lib/libpower.so
./lib/libpowermanager.so
./lib/libprintspooler_jni.so
./lib/libprocessgroup.so
./lib/libprotobuf-cpp-lite.so
./lib/libradio.so
./lib/libradio_metadata.so
./lib/libradioservice.so
./lib/libreference-ril.so
./lib/libresourcemanagerservice.so
./lib/libril.so
./lib/librilutils.so
./lib/librs_jni.so
./lib/librtp_jni.so
./lib/libselinux.so
./lib/libsensorservice.so
./lib/libserviceutility.so
./lib/libsigchain.so
./lib/libskia.so
./lib/libsoftkeymaster.so
./lib/libsoftkeymasterdevice.so
./lib/libsonic.so
./lib/libsonivox.so
./lib/libsoundpool.so
./lib/libsoundtrigger.so
./lib/libsoundtriggerservice.so
./lib/libsparse.so
./lib/libspeexresampler.so
./lib/libsqlite.so
./lib/libsqlite_jni.so
./lib/libssl.so
./lib/libstagefright.so
./lib/libstagefright_amrnb_common.so
./lib/libstagefright_avc_common.so
./lib/libstagefright_enc_common.so
./lib/libstagefright_foundation.so
./lib/libstagefright_http_support.so
./lib/libstagefright_httplive.so
./lib/libstagefright_omx.so
./lib/libstagefright_soft_aacdec.so
./lib/libstagefright_soft_aacenc.so
./lib/libstagefright_soft_amrdec.so
./lib/libstagefright_soft_amrnbenc.so
./lib/libstagefright_soft_amrwbenc.so
./lib/libstagefright_soft_avcdec.so
./lib/libstagefright_soft_avcenc.so
./lib/libstagefright_soft_flacenc.so
./lib/libstagefright_soft_g711dec.so
./lib/libstagefright_soft_gsmdec.so
./lib/libstagefright_soft_hevcdec.so
./lib/libstagefright_soft_mp3dec.so
./lib/libstagefright_soft_mpeg2dec.so
./lib/libstagefright_soft_mpeg4dec.so
./lib/libstagefright_soft_mpeg4enc.so
./lib/libstagefright_soft_opusdec.so
./lib/libstagefright_soft_rawdec.so
./lib/libstagefright_soft_vorbisdec.so
./lib/libstagefright_soft_vpxdec.so
./lib/libstagefright_soft_vpxenc.so
./lib/libstagefright_wfd.so
./lib/libstagefright_yuv.so
./lib/libstdc++.so
./lib/libsurfaceflinger.so
./lib/libsurfaceflinger_ddmconnection.so
./lib/libsuspend.so
./lib/libsync.so
./lib/libsysutils.so
./lib/libtinyalsa.so
./lib/libttscompat.so
./lib/libttspico.so
./lib/libui.so
./lib/libunwind.so
./lib/libusbhost.so
./lib/libutils.so
./lib/libvixl.so
./lib/libvorbisidec.so
./lib/libwebrtc_audio_preprocessing.so
./lib/libwebviewchromium_loader.so
./lib/libwebviewchromium_plat_support.so
./lib/libwifi-service.so
./lib/libwilhelm.so
./lib/libwnndict.so
./lib/libz.so
./lib/soundfx/libaudiopreprocessing.so
./lib/soundfx/libbundlewrapper.so
./lib/soundfx/libdownmix.so
./lib/soundfx/libeffectproxy.so
./lib/soundfx/libldnhncr.so
./lib/soundfx/libreverbwrapper.so
./lib/soundfx/libvisualizer.so
./priv-app/DefaultContainerService/lib/x86/libdefcontainer_jni.so
./priv-app/Velvet/lib/x86/libcronet.so
./priv-app/Velvet/lib/x86/libgoogle_speech_jni.so
./priv-app/Velvet/lib/x86/libgoogle_speech_micro_jni.so
./priv-app/Velvet/lib/x86/libvcdecoder_jni.so
./vendor/lib/egl/libEGL_swiftshader.so
./vendor/lib/egl/libGLESv1_CM_swiftshader.so
./vendor/lib/egl/libGLESv2_swiftshader.so
./vendor/lib/libfrsdk.so
./vendor/lib/mediadrm/libdrmclearkeyplugin.so
./vendor/lib/mediadrm/libwvdrmengine.so