0

I am making an android app that will check for any vulnerability and malicious detection in android app being installed. now what i want is when user is installing any app then before the app get installed on device i get notified but broadcast receiver so that i can check the app for detection? i have tried PACKAGE_ADDED but it is notifying me after the app has installed .plz tell me how can i do.i have used this code

<receiver
    android:name="MyReceiver"
    android:enabled="true"
    android:priority="0" >
  <intent-filter>
      <action android:name="android.intent.action.PACKAGE_ADDED" >
      </action>
      <action android:name="android.intent.action.PACKAGE_REMOVED" >
      </action>
      <data android:scheme="package" />
   </intent-filter>
</receiver>
  • try this http://stackoverflow.com/questions/7470314/receiving-package-install-and-uninstall-events – VIjay J Sep 17 '15 at 11:15
  • i tried that but my problem is i want to be notified before the app installed ...justlike u click on apk to install then before it is being actually installed it should notify to and an dialog of my application will open...i hope you got it...is this possible? – Arun singh Sep 17 '15 at 13:24

1 Answers1

0

The logic in your description is to detect a package that not being installed. Why not to trigger some methods inside the uninstalled package and detect the related reaction, Or reverse the apk to the source code then analysis what you want. To write an activity which may or may not be a launcher activity:

 PackageManager pm = getPackageManager();

Intent appStartIntent = pm.getLaunchIntentForPackage("com.your.broadcast.receiver.package");
if (null!= appStartIntent)
{
    startActivity(appStartIntent);
}

Also, you can try intent flag withFLAG_INCLUDE_STOPPED_PACKAGES to access the application that is stopped. Hope this could help you.

Field.D
  • 158
  • 1
  • 1
  • 9
  • sorry but i didnt get it will u please elaborate. – Arun singh Sep 18 '15 at 10:47
  • i have no idea about your mechanism of the detection system. However, As you mentioned, this is one way to call the installed package that is not running. – Field.D Sep 18 '15 at 17:36