Skip to content

Commit a048d52

Browse files
committed
partially fixes #372
1 parent 69ee6a3 commit a048d52

3 files changed

Lines changed: 22 additions & 7 deletions

File tree

cSploit/src/org/csploit/android/services/UpdateService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ private void finishNotification() {
274274
Intent contentIntent;
275275

276276
errorOccurred = mCurrentTask.errorOccurred;
277-
contentIntent = mCurrentTask.contentIntent;
277+
contentIntent = mCurrentTask.haveIntent() ? mCurrentTask.buildIntent() : null;
278278

279279
if(errorOccurred || contentIntent==null){
280280
Logger.debug("deleting notifications");

cSploit/src/org/csploit/android/update/ApkUpdate.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@ public ApkUpdate(Context context, String url, String version) {
1919
this.version = version;
2020
name = String.format("cSploit-%s.apk", version);
2121
path = String.format("%s/%s", System.getStoragePath(), name);
22-
contentIntent = new Intent(Intent.ACTION_VIEW);
23-
contentIntent.setDataAndType(Uri.fromFile(new File(path)), "application/vnd.android.package-archive");
24-
contentIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
2522
prompt = String.format(context.getString(R.string.new_apk_found), version);
2623
}
24+
25+
@Override
26+
public boolean haveIntent() {
27+
return true;
28+
}
29+
30+
@Override
31+
public Intent buildIntent() {
32+
Intent intent = new Intent(Intent.ACTION_VIEW);
33+
intent.setDataAndType(Uri.fromFile(new File(path)), "application/vnd.android.package-archive");
34+
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
35+
return intent;
36+
}
2737
}

cSploit/src/org/csploit/android/update/Update.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ public abstract class Update implements Serializable {
2121
compression;
2222
public archiveAlgorithm
2323
archiver;
24-
public Intent
25-
contentIntent;
2624
public boolean
2725
skipRoot,
2826
fixShebang,
@@ -42,11 +40,18 @@ public void reset() {
4240
version = null;
4341
compression = null;
4442
archiver = null;
45-
contentIntent = null;
4643
wipeOnFail = fixShebang = errorOccurred = skipRoot = false;
4744
}
4845
}
4946

47+
public boolean haveIntent() {
48+
return false;
49+
}
50+
51+
public Intent buildIntent() {
52+
return null;
53+
}
54+
5055
public enum compressionAlgorithm {
5156
none,
5257
gzip,

0 commit comments

Comments
 (0)