Git Product home page Git Product logo

android-hacks's People

Contributors

amsurana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

android-hacks's Issues

Disabling home button through an app using android hacks

I am trying to create an app that disables the home button using android hacks https://github.com/smargav/android-hacks/wiki/Android-Hacks
I found a link, I followed it but I got errors.I added WRITE SETTINGS and WRITE SECURE SETTINGS permissions in the Manifest file and I have a rooted device but its not working.

This is the mainActivity:

public class MainActivity extends AppCompatActivity {
public static final String DEVICE_PROVISIONED = Settings.Global.DEVICE_PROVISIONED;
public static final String USER_SETUP_COMPLETE = "user_setup_complete";

@Override
protected void onCreate(Bundle icicle) {
   // super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);


    super.onCreate(icicle);

    DevicePolicyManager policyManager = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
   //policyManager.setDeviceOwner("com.suad.myapplication", "MyApplication");



    // Add a persistent setting to allow other apps to know the device has been provisioned.
    Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
    Settings.Secure.putInt(getContentResolver(),USER_SETUP_COMPLETE, 1);
   /* try {
        Process process = Runtime.getRuntime().exec(new String[] { "su", "-c", USER_SETUP_COMPLETE});
    } catch (IOException e) {
        e.printStackTrace();
    }*/

    // remove this activity from the package manager.
    PackageManager pm = getPackageManager();
    ComponentName name = new ComponentName(this, MainActivity.class);
    pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
            PackageManager.DONT_KILL_APP);

    // terminate the activity.
    finish();
}

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.