@@ -48,14 +48,25 @@ public boolean isVulnerable(Context context) throws Exception {
48
48
File stagefrightlib = new File ("/system/lib/libstagefright.so" );
49
49
File stagefrightlib64 = new File ("/system/lib64/libstagefright.so" );
50
50
51
+ File softAAClib = new File ("/system/lib/libstagefright_soft_aacdec.so" );
52
+
51
53
if (!stagefrightlib .exists () || !stagefrightlib .isFile ()){
52
- throw new Exception ("Stagefright doesn't exist or is not a file" );
54
+ throw new Exception ("libstagefright.so doesn't exist or is not a file" );
55
+ }
56
+
57
+ if (!softAAClib .exists ()){
58
+ throw new Exception ("libstagefright_soft_aacdec.so does not exist" );
53
59
}
54
60
55
- ByteArrayOutputStream baos = new ByteArrayOutputStream ((int )stagefrightlib .length ());
56
- BinaryAssets .copy (new FileInputStream (stagefrightlib ), baos );
61
+ ByteArrayOutputStream libStageFrightBAOS = new ByteArrayOutputStream ((int )stagefrightlib .length ());
62
+ BinaryAssets .copy (new FileInputStream (stagefrightlib ), libStageFrightBAOS );
63
+ byte [] libstagefrightSO = libStageFrightBAOS .toByteArray ();
64
+
65
+
66
+ ByteArrayOutputStream libaacdecBAOS = new ByteArrayOutputStream ((int )softAAClib .length ());
67
+ BinaryAssets .copy (new FileInputStream (softAAClib ), libaacdecBAOS );
68
+ byte [] libaacdecSO = libStageFrightBAOS .toByteArray ();
57
69
58
- byte [] libstagefrightSO = baos .toByteArray ();
59
70
60
71
KMPMatch binMatcher = new KMPMatch ();
61
72
@@ -64,7 +75,7 @@ public boolean isVulnerable(Context context) throws Exception {
64
75
boolean libstagefrightVulnerableToBug23680780 = indexOf == -1 ;
65
76
indexOf = binMatcher .indexOf (libstagefrightSO , "b/23881715" .getBytes ());
66
77
boolean libstagefrightvulnerableToBug23881715 = indexOf == -1 ;
67
- indexOf = binMatcher .indexOf (libstagefrightSO , "b/23876444" .getBytes ());
78
+ indexOf = binMatcher .indexOf (libaacdecSO , "b/23876444" .getBytes ());
68
79
boolean libstagerightVulnerableToBug23876444 = indexOf == -1 ;
69
80
70
81
//Only affects L and M
0 commit comments