Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Tutorial [Java] Anti Remod with Alert Dialog

iWeigel
Jan
112
134
Credits
1,578
Staff member
Administrator
Disclaimer : This Thread Section is for Educational Only .
]

Java:
//Encrypt your app name and package name
private static final String app_name = new String(new byte[]{68,78,83,32,67,111,110,118,101,114,116,101,114,});
    private static final String pckg = new String(new byte[]{109,97,116,115,115,46,107,101,114,118,122,99,111,100,101,115,46,100,110,115,46,99,111,110,118,101,114,116,101,114,});

Java:
// Add inside onCreate

if(getTitle().equals (app_name)){
            setContentView(R.layout.activity_main);
        }else{
            alert();
        }
        if(getPackageName().equals (pckg)){
            setContentView(R.layout.activity_main);
        }else{
            alert();
        }


Java:
//dialog code
private void alert(){

        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setView(getLayoutInflater().inflate(R.layout.alert_dialog,null));
        builder.setCancelable(false);
        builder.setPositiveButton("Exit", new DialogInterface.OnClickListener(){

                @Override
                public void onClick(DialogInterface p1, int p2)
                {
                    finish();
                    // TODO: Implement this method
                }


            });
        builder.show();

    }



XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:gravity="center">

            <ImageView
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:src="@mipmap/ic_launcher"
                android:tint="#f44235"
                android:layout_marginBottom="10dp"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Moddified Alert"
                android:textStyle="bold"
                android:textColor="#FF0F00"
                android:typeface="monospace"/>

        </LinearLayout>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#FFFFFF"
            android:text="-You are not required to use this application because you are trying to remodefied this app, the app will be currupted."
            android:layout_margin="5dp"
            android:typeface="monospace"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#FFFFFF"
            android:text="-Please Reinstall the Original App."
            android:layout_margin="5dp"
            android:typeface="monospace"/>

    </LinearLayout>

</LinearLayout>
 

POPULAR THIS MONTH

Online Statistics

Members online
0
Guests online
44
Total visitors
44
Top