Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed Nov 9, 2024
1 parent cedf2dd commit cc33c35
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions assets/semgrep_rules/client/trigger.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageItemInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.ActivityInfo
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.example.com"));
PackageManager pm = getPackageManager();
// ruleid: android-resolve-intent
ResolveInfo resolveInfo = pm.resolveService(intent, 0);
// ruleid: android-resolve-intent
resolveInfo = pm.resolveContentProvider(intent, 0);
// ruleid: android-resolve-intent
resolveInfo = pm.resolveActivity(intent, 0);
// ruleid: android-resolve-intent
ComponentName componentName = intent.resolveActivity(pm);
// ruleid: android-resolve-intent
ActivityInfo activityInfo = intent.resolveActivityInfo(pm);
// ruleid: android-resolve-intent
List<ResolveInfo> resolveInfoList = pm.queryBroadcastReceivers(intent,0);
// ruleid: android-resolve-intent
resolveInfoList = pm.queryIntentActivities(intent,0);
// ruleid: android-resolve-intent
resolveInfoList = pm.queryIntentActivityOptions(null,null,intent,0);
// ruleid: android-resolve-intent
resolveInfoList = pm.queryIntentServices(intent,0);
// ruleid: android-resolve-intent
List<ProviderInfo> providerInfoList = pm.queryIntentContentProviders(intent,0);
}
}

0 comments on commit cc33c35

Please sign in to comment.