Java – Protects applications from decompilation by hiding manifests and converting code to Unicode characters

Protects applications from decompilation by hiding manifests and converting code to Unicode characters… here is a solution to the problem.

Protects applications from decompilation by hiding manifests and converting code to Unicode characters

I want to make my app protective by using obfuscation or any good technique like i am showing. I have gone through a number of questions on SO.

In the process of decompiling, I saw two good tricks.

  1. An app hides Androidmanifest .xml because I decompiled a code whose Manifest.xml is missing or non-existent.
  2. Another code I see after decompiling is as follows.

    private static void \u02ca(final Context context, String s, final String s2) 
    {
    if (s == null || s.equals("")) 
    {
        return;
    }
    final long currentTimeMillis = System.currentTimeMillis();
    final boolean \u02cf = \u0632.\u02cf(context);
    
    if (!\u02cf || (\u02cf && !\u0632.\u02ce(context))) 
    {
        if (s == null) 
        {
            s = null;
        }
        \u02ca(context, s);
    }
    while (true) 
    {
        if (s2 == null || s2.equals("")) 
        {
            break Label_0076;
        }
        try 
        {
            Toast.makeText(context, (CharSequence)s2, 1).show();
            \u0632.\u02ca(context, "letang_last_time", currentTimeMillis);
        }
        catch (Exception ex) {
            continue;
        }
        break;
    }
    }
    

Someone might understand what this example uses to protect the APK from being decompiled.

How do I make my UniCode code like a character after decompiling? And how to hide list in decompilation.

Edit

I’ve tested on three different decompilers. But the code remains the same. Procyon, CFR, and FernFlower didn’t help looking at the code.

Solution

How to make my code in UniCode like character after decompiling? And
how to hide Manifest from Decompiling.

Keep in mind that there is no 100% protection. You can add simple methods to make potential attackers harder to deal with, but there is no safe harbor in this environment. Google has an open-source tool called Proguard. It can also help you obfuscate the source code.

  • Creating more compact code, for smaller code archives, faster transfer across networks, faster loading, and smaller memory footprints.
  • Making programs and libraries harder to reverse-engineer.

  • Listing dead code, so it can be removed from the source code.

  • Retargeting and preverifying existing class files for Java 6 or higher, to take full advantage of their faster class loading.

Related Problems and Solutions