Skip to content

Commit 55e153b

Browse files
committed
Fix race condition with the crash check binary. Where it was chmodded, but ran before it had the proper permissions
1 parent 50bb259 commit 55e153b

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

app/app.iml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
9191
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
9292
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
93+
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
9394
</content>
9495
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
9596
<orderEntry type="sourceFolder" forTests="false" />

app/src/main/java/fuzion24/device/vulnerability/vulnerabilities/framework/media/StageFright.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ public class StageFright {
3030
System.loadLibrary("stagefright");
3131
}
3232

33-
private static void exec(String blah) throws Exception {
34-
Process p = Runtime.getRuntime().exec(blah);
33+
private static void exec(String executionCommand) throws Exception {
34+
Log.d(TAG, "Running shell command: " + executionCommand);
35+
Process p = Runtime.getRuntime().exec(executionCommand);
3536
p.waitFor();
3637
}
3738

@@ -50,7 +51,6 @@ public static List<VulnerabilityTest> getTests(Context context) {
5051
extractedBinaryTester);
5152
exec("chmod 744 " + extractedBinaryTester);
5253

53-
5454
for (final String mediaFile : stagefrightMediaFiles) {
5555

5656
final String extractedAssetPath = dataDir.getAbsolutePath() + File.separator + mediaFile;

app/src/main/java/fuzion24/device/vulnerability/vulnerabilities/helper/CrashCheck.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ private static String extractCrashCheckBinary(Context context) throws IOExceptio
3535
File dataDir = context.getFilesDir();
3636
String extractedCrashCheck = dataDir.getAbsolutePath() + File.separator + getCrashCheckAppName();
3737
extractAsset(context, "crashCheck" + File.separator + getCrashCheckAppName(), extractedCrashCheck, false);
38-
Runtime.getRuntime().exec("chmod 744 " + extractedCrashCheck);
38+
Process p = Runtime.getRuntime().exec("chmod 744 " + extractedCrashCheck);
39+
40+
try {
41+
p.waitFor();
42+
}catch(Exception e){
43+
//
44+
}
45+
3946
return extractedCrashCheck;
4047
}
4148

0 commit comments

Comments
 (0)