Info Obfuscated methods

Description

Obfuscation refers to methods to obscure code and make it hard to understand. Compiled Java classes can be decompiled if there is no obfuscation during compilation step.

Adversaries can steal code and repurpose it and sell it in a new application or create a malicious fake application based on the initial one.

Code obfuscation only slows the attacker from reverse engineering but does not make it impossible.

Recommendation

Design the application to add the following protections and slow reverse engineering of the application:

  • Obfuscate Java source code with tools like Proguard or Dexguard
  • buildTypes {
            release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'),
                'proguard-rules.pro'
            }
        }
  • Verification application signing certificate during runtime by checking context.getPackageManager().signature
  • Check application installer to ensure it matches the Android Market by calling context.getPackageManager().getInstallerPackageName
  • Check running environment at runtime
  • private static String getSystemProperty(String name) throws Exception {
        Class systemPropertyClazz = Class.forName("android.os.SystemProperties");
        return (String) systemPropertyClazz.getMethod("get", new Class[] { String.class }).invoke(systemPropertyClazz, new Object[] { name });
    }
    
    public static boolean checkEmulator() {
    
        try {
            boolean goldfish = getSystemProperty("ro.hardware").contains("goldfish");
            boolean qemu = getSystemProperty("ro.kernel.qemu").length() > 0;
            boolean sdk = getSystemProperty("ro.product.model").equals("sdk");
    
            if (qemu || goldfish || sdk) {
                return true;
            }
    
        } catch (Exception e) {
        }
    
        return false;
      }
  • Check debug flag at runtime
  • context.getApplicationInfo().applicationInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE;

Technical details
PackageObfuscated
kotlin False
android.support.annotation False
android.support.v13 False
android.support.design False
bolts False
com.facebook.fbcore False
com.ogaclejapan.arclayout False
com.google.ads True
com.whiteelephant.monthpicker False
com.google.gson False
com.dlazaro66.qrcodereaderview False
com.squareup.picasso False
android.support.v4 False
com.flaviofaria.kenburnsview False
com.iarcuschin.simpleratingbar False
android.support.multidex False
com.facebook.imagepipeline False
com.yalantis.filter False
com.facebook.datasource False
com.andexert.library False
org.jetbrains.annotations False
com.google.firebase True
com.nineoldandroids.animation False
com.scottyab.showhidepasswordedittext False
android.support.coreui False
org.androidannotations.api False
android.support.coreutils False
com.nineoldandroids.util False
com.facebook.binaryresource False
me.leolin.shortcutbadger False
android.support.constraint False
android.support.fragment False
okhttp3 False
com.facebook.drawee False
com.QRCodeReaderView False
okio False
android.support.compat False
com.google.zxing False
org.androidannotations.annotations False
com.google.protobuf True
com.nineoldandroids.view False
retrofit2 False
android.support.transition False
lecho.lib.hellocharts False
com.facebook.imageutils False
de.greenrobot.event False
android.support.mediacompat False
com.facebook.imageformat False