package com.device.vulnerability.vulnerabilities.framework.jar;

import android.content.Context;

import com.device.vulnerability.vulnerabilities.VulnerabilityTest;

// https://android.googlesource.com/platform/libcore/+/cb11b9fff2a1af8bb4fcad18986003a7f59189c6 //Tests
// https://android.googlesource.com/platform/libcore/+/2bc5e811a817a8c667bca4318ae98582b0ee6dc6 //Fix
// http://bluebox.com/technical/android-fake-id-vulnerability/

public class JarBug13678484 implements VulnerabilityTest {

    @Override
    public String getName() {
        return "JarBug13678484";
    }

    @Override
    public boolean isVulnerable(Context context) throws Exception {


        return false;
    }

}

@@ -94,74 +94,239 @@
 xt;%0A
-%0Aimport com.device.vulnerability.vulnerabilities.VulnerabilityTest
+import android.framework.util.jar.JarFile;%0Aimport android.util.Log;%0A%0Aimport com.device.vulnerability.vulnerabilities.VulnerabilityTest;%0A%0Aimport java.io.ByteArrayInputStream;%0Aimport java.io.File;%0Aimport java.lang.reflect.Constructor
 ;%0A%0A/
@@ -820,18 +820,282 @@
 ption %7B%0A
-%0A%0A
+        // Check for the existence of this constructor:%0A        // public JarFile(File file, boolean verify, int mode, boolean chainCheck)%0A        try %7B%0A            java.util.jar.JarFile.class.getConstructor(File.class, boolean.class, int.class, boolean.class);%0A    
         
@@ -1112,13 +1112,90 @@
 se;%0A    
+   
+ %7D catch(NoSuchMethodException e) %7B%0A            return true;%0A        %7D%0A    
 %7D
-%0A
 %0A%7D%0A

Fix the device vulnerability detector for the Jar bug