brosmike/AirPush-Detector — Issue #1: Add support for LeadBolt ad detection.
Author: banasiak
Created: 2011-11-06 00:37:28+00:00
State: open

LeadBolt is another ad network that uses the same annoying notification tactics as AirPush. From what I can tell it registers a receiver with the name "com.Leadbolt." Here is a quick patch that adds detection support for LeadBolt-enabled apps to AirPush-Detector.

```
diff --git a/src/com/brosmike/airpushdetector/AirPushDetectorActivity.java b/src/com/brosmike/airpushdetector/AirPushDetectorActivity.java
index bb7f6b7..3181bd9 100644
--- a/src/com/brosmike/airpushdetector/AirPushDetectorActivity.java
+++ b/src/com/brosmike/airpushdetector/AirPushDetectorActivity.java
@@ -103,24 +100,6 @@ public class AirPushDetectorActivity extends ListActivity {
}
}

- for(ApplicationInfo appInfo : appInfos) {
- try {
- PackageInfo pkgInfo2 = pm.getPackageInfo(appInfo.packageName, PackageManager.GET_RECEIVERS);
- if(pkgInfo2.receivers == null)
- {
- continue;
- }
- for(ActivityInfo receiver: pkgInfo2.receivers ){
- if(receiver.name.startsWith("com.Leadbolt.")) {
- airPushPackages.add(pkgInfo2);
- break;
- }
- }
- } catch (NameNotFoundException e) {
- Log.e(TAG, "Managed to not find a package we know about");
- }
- }
-
return airPushPackages;
}
}
\ No newline at end of file
```