Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for LeadBolt ad detection. #1

Closed
banasiak opened this issue Nov 6, 2011 · 1 comment
Closed

Add support for LeadBolt ad detection. #1

banasiak opened this issue Nov 6, 2011 · 1 comment

Comments

@banasiak
Copy link

banasiak commented Nov 6, 2011

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
@banasiak
Copy link
Author

banasiak commented Nov 6, 2011

Excellent. LeadBolt detection added by commit d2cbeb6. Thanks!

@banasiak banasiak closed this as completed Nov 6, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant