@@ -11,46 +11,46 @@ public class ApkInstallation extends Activity {
11
11
public void installAPK (String path ) {
12
12
// BAD: the path is not checked
13
13
Intent intent = new Intent (Intent .ACTION_VIEW );
14
- intent .setDataAndType (Uri .fromFile (new File (path )), "application/vnd.android.package-archive" ); // $ hasApkInstallation
14
+ intent .setDataAndType (Uri .fromFile (new File (path )), "application/vnd.android.package-archive" ); // $ Alert
15
15
startActivity (intent );
16
16
}
17
17
18
18
public void installAPK3 (String path ) {
19
19
Intent intent = new Intent (Intent .ACTION_VIEW );
20
20
intent .setType (APK_MIMETYPE );
21
21
// BAD: the path is not checked
22
- intent .setData (Uri .fromFile (new File (path ))); // $ hasApkInstallation
22
+ intent .setData (Uri .fromFile (new File (path ))); // $ Alert
23
23
startActivity (intent );
24
24
}
25
25
26
26
public void installAPKFromExternalStorage (String path ) {
27
27
// BAD: file is from external storage
28
28
File file = new File (Environment .getExternalStorageDirectory (), path );
29
29
Intent intent = new Intent (Intent .ACTION_VIEW );
30
- intent .setDataAndType (Uri .fromFile (file ), APK_MIMETYPE ); // $ hasApkInstallation
30
+ intent .setDataAndType (Uri .fromFile (file ), APK_MIMETYPE ); // $ Alert
31
31
startActivity (intent );
32
32
}
33
33
34
34
public void installAPKFromExternalStorageWithActionInstallPackage (String path ) {
35
35
// BAD: file is from external storage
36
36
File file = new File (Environment .getExternalStorageDirectory (), path );
37
37
Intent intent = new Intent (Intent .ACTION_INSTALL_PACKAGE );
38
- intent .setData (Uri .fromFile (file )); // $ hasApkInstallation
38
+ intent .setData (Uri .fromFile (file )); // $ Alert
39
39
startActivity (intent );
40
40
}
41
41
42
42
public void installAPKInstallPackageLiteral (String path ) {
43
43
File file = new File (Environment .getExternalStorageDirectory (), path );
44
44
Intent intent = new Intent ("android.intent.action.INSTALL_PACKAGE" );
45
- intent .setData (Uri .fromFile (file )); // $ hasApkInstallation
45
+ intent .setData (Uri .fromFile (file )); // $ Alert
46
46
startActivity (intent );
47
47
}
48
48
49
49
public void otherIntent (File file ) {
50
50
Intent intent = new Intent (this , OtherActivity .class );
51
51
intent .setAction (Intent .ACTION_VIEW );
52
52
// BAD: the file is from unknown source
53
- intent .setData (Uri .fromFile (file )); // $ hasApkInstallation
53
+ intent .setData (Uri .fromFile (file )); // $ Alert
54
54
}
55
55
}
56
56
0 commit comments