Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to access resources in another APK without using content providers?

I thought that it is impossible to access resources contained in other APK unless content providers are used. However, I stumbled upon an app called Better Keyboard. It uses skins, so I decided to download an example of a skin.

An example skin really surprised me. It contains almost no code, declares only an activity and no content providers. Nontheless it contains resources and they are apparently somehow accessed from Better Keyboard app if the APK with the skin gets installed. So how is it done?

like image 766
Malcolm Avatar asked Jan 04 '11 11:01

Malcolm


People also ask

How do I view the contents of an APK file?

Since APK files come in compressed ZIP format, any ZIP decompression tool can open it. So, for viewing the contents of an APK file, all you have to do is rename its extension to . zip and open it. Or, you can open it directly through an open dialogue box of a zip application.

Are APK files shared?

So the answer to your question is yes, it is more dangerous to provide the . apk file directly. However, if you do not have copy-protection on your app, then the . apk is already available to anyone (country dependent).

How do you access APK files on Android?

Just open your browser, find the APK file you want to download, and tap it – you should then be able to see it downloading on the top bar of your device. Once it's downloaded, open Downloads, tap on the APK file and tap Yes when prompted. The app will begin installing on your device.


1 Answers

I believe you're looking for

Resources res = mPackageManager.getResourcesForApplication("org.example.foo");

http://developer.android.com/reference/android/content/pm/PackageManager.html#getResourcesForApplication%28java.lang.String%29

like image 80
Kevin TeslaCoil Avatar answered Sep 17 '22 07:09

Kevin TeslaCoil