@@ -0,0 +1,1706 @@
+package fuzion24.device.vulnerability.vulnerabilities.helper;%0A%0Aimport android.content.Context;%0Aimport android.content.SharedPreferences;%0Aimport android.os.Build;%0Aimport android.util.Base64;%0A%0Aimport java.io.File;%0Aimport java.security.MessageDigest;%0Aimport java.util.HashSet;%0Aimport java.util.Scanner;%0A%0Aimport fuzion24.device.vulnerability.util.SharedPreferencesUtils;%0A%0A/**%0A * Created by fuzion24 on 12/4/15.%0A */%0Apublic class DeviceUpdateChecker %7B%0A    public static boolean wasDeviceUpdated(Context ctx)%7B%0A%0A        /*%0A            Take a hash of the build.prop and /proc/version%0A            If this changes, assume the device has been updated%0A        */%0A        String buildPropFile = readFile(%22/system/build.prop%22);%0A        String procVersion   = readFile(%22/proc/version%22);%0A%0A        String fingerprint = hashString(buildPropFile + procVersion);%0A        String lastFingerprint = SharedPreferencesUtils.getBuildUpdateFingerprint(ctx);%0A        if(fingerprint.equals(lastFingerprint))%7B%0A            return false;%0A        %7D else %7B%0A            SharedPreferencesUtils.setBuildUpdateFingerPrint(ctx, fingerprint);%0A            return true;%0A        %7D%0A    %7D%0A%0A    private static String hashString(String data)%7B%0A        try %7B%0A            MessageDigest md = MessageDigest.getInstance(%22SHA%22);%0A            md.update(data.getBytes());%0A            byte%5B%5D hash = md.digest();%0A            return Base64.encodeToString(hash, Base64.DEFAULT);%0A        %7D catch (Exception e) %7B%0A            return %22%22;%0A        %7D%0A    %7D%0A%0A    private static String readFile(String filename)%7B%0A        try %7B%0A            return new Scanner(new File(filename)).useDelimiter(%22%5C%5CZ%22).next();%0A        %7Dcatch(Exception e)%7B%0A            return %22%22;%0A        %7D%0A    %7D%0A%0A%7D%0A

Add a class with our hueristics to check if a device was updated