Skip to content

How to determine package name of an Android application running on the device?

May 01, 2012 | 42Gears Team

SureLock is a comprehensive kiosk lockdown solution which allows administrator to restrict device user’s access to limited applications and settings. It is very easy to select the desired whitelisted applications from “SureLock Settings->Add Applications” screen. Once whitelisted, the application icons show up on SureLock Home Screen.

However, there might be a case where one whitelisted application can launch another application internally which is not allowed. In this scenario, SureLock will block the window of unallowed application. In case administrator wants to grant access to this application as well, he should explicitly allow this application from SureLock settings (In case it is desired not to show the icon for an allowed application on SureLock home screen, use “Hide icon” property in Allowed applications properties.)

Many a times, administrator might not know the application name or package name of this new application which is getting launched. This is why we are introducing our new “Logging” feature in SureLock. Once enabled, SureLock starts logging the Application name, Application package name & Application Window(Activity) name whenever it blocks any application. This info is saved on the device as a log file in .txt format.

Lets take a sample case to explain the use of this feature and steps to perform the same:
1. Suppose the “Camera” application is allowed on SureLock homescreen. End-user can capture the pictures but will not be able to view photos.

Camera application running in SureLock

2. The Gallery button on the Camera screen will not work. An attempt to view the photos will close the Camera application.

3. To determine the application(s) which would have been blocked by SureLock, all we have to do is “Enable Logging”. Go to “SureLock Settings” in Admin screen of SureLock and tick the “Enable Logging” checkbox

Steps to “Enable Logging” in SureLock

4. Once enabled, go to SureLock home screen and click on Gallery button in Camera application. Since logging has been enabled, all the information about blocked applications will be saved in the log file.

5. Now locate “surelock.log” file in the root folder of file system and open in any text editor. It’ll open up like this:

Content of Log file generated by SureLock

Time Stamp: Displays the time at which the application activity was performed
Status: Indicates whether the application activity is allowed in SureLock or blocked.
Package Name: Displays the package name of the application which  was accessed in SureLock
Package Activity Name: Displays the exact name of the package activity which was  accessed

Based on the information in log file, the admin can decide if a blocked application needs to be allowed for the end-user. The Package Name helps in choosing the application name which should be added to the “Allowed Application” list. The Package Activity Name can be used to fine tune the allowed application by allowing only particular child window(s) of the application for the end-user.

In our case, we will have to allow “com.android.sec.gallery3d” package for the Gallery button to work correctly. The “com.android.sec.gallery3d” corresponds to “Gallery” application. So we need to add “Gallery” to “Allowed Applications” list.
The following screen is displays the “Application Settings” screen of “Gallery” after it has been allowed.

Application Details Window – Displays Package Name and Package Activity Name

Note: The administrator can also choose to hide an application from home screen by enabling “Hide Icon in Home Screen” feature in “Allowed Application”->”Application Settings” screen (as shown in the screenshot above). This will allow the application to be accessible by other applications but will not be visible on Home screen.

To learn more on how to secure and manage Android and Windows Mobile/CE devices efficiently, visit us at www.42gears.com

Subscribe for our free newsletter

Thank you! you are successfully subscribed.
newsletter

Exclusive News and Updates on Enterprise Mobility!

* I consent to receive newsletters via email from 42Gears and its Affiliates.
Please agree
* I have reviewed and agreed to 42Gears Privacy Policy and Terms of Use prior to subscribing and understand that I may change my preference or unsubscribe at any time.
Please agree
Please verify captcha
Please enter a valid official email