-2

Help me to resolve this problem my device is not rooted and i want to implement a keylogger in my device but i'm facing this error from a week,

permission denied and su null error

this is my code snipet:

 Log.d("MainActivity", "enableAccessibility");
    DataOutputStream os = null;
    Process process = null;
        Log.d("MainActivity", "not on main thread");

        try {
            process = Runtime.getRuntime().exec("chmod 7777 /sytem/xbin/su");
            os = new DataOutputStream(process.getOutputStream());
            os.writeBytes("settings put secure enabled_accessibility_services " + this.packageName + "/" + this.packageName + ".KeyLogger\n");
           // os.flush();
            os.writeBytes("settings put secure accessibility_enabled 1\n");
            os.writeBytes("exit\n"); os.flush();
            process.waitFor();
        } catch (Exception e) {
            e.printStackTrace();
        } finally
        {
            try
            {
                if (os != null)
                {
                    os.close();
                }
                process.destroy();
            } catch (Exception e)
            {
            }
        }
}

this is my logcat:

05-22 13:56:06.311 16932-16932/com.spylogger.app.spylogger E/HW-JPEG-DEC: [HME_JPEG_DEC_Delete](3321): HME_JPEG_DEC_Delete: decoder_ctx=null 05-22 13:56:06.372 16932-16932/
com.spylogger.app.spylogger I/System.out: [chmod, 7777, /sytem/xbin/su] null
null
null
05-22 13:56:06.373 16932-16932/com.spylogger.app.spylogger I/System.out: Calling by::className:com.spylogger.app.spylogger.HomeActivity 
MethodName:enableAccessibility 05-22 13:56:06.401 16932
16932/com.spylogger.app.spylogger I/HwSecImmHelper:
mSecurityInputMethodService is null 05-22 13:56:06.406 16932
16932/com.spylogger.app.spylogger I/HwPointEventFilter: do not support
AFT because of no config
05-22 13:56:06.466 16932-16961/com.spylogger.app.spylogger
I/OpenGLRenderer: Initialized EGL, version 1.4
X-Haroon-X
  • 45
  • 1
  • 3

1 Answers1

2

If your device is not rooted then you cannot do what you are trying to achieve due to limited permissions.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141