Android Question Sim Pin auto enter

walmo

Active Member
Licensed User
Longtime User
Hi
I found this code ...
B4X:
TelephonyManager tm =
(TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
      Class clazz = Class.forName(tm.getClass().getName());
      Method m = clazz.getDeclaredMethod("getITelephony");
      m.setAccessible(true);
      ITelephony it = (ITelephony) m.invoke(tm);
      it.supplyPin("1111");

is there anybody that can help me use this ,
(May be like this that Erel did -
B4X:
Sub SetMobileDataEnabled(enabled As Boolean)
        Dim r As Reflector
        r.Target = r.GetContext
        r.Target = r.RunMethod2("getSystemService", "connectivity", "java.lang.String")
         r.RunMethod2("setMobileDataEnabled", enabled, "java.lang.boolean")  )

The phone is rooted and kitkat 4.4.2
Please .......
Thx
 
Last edited:

walmo

Active Member
Licensed User
Longtime User
Thank you Erel
But now ....
The phone is rooted and im using "SuperUser: Acquiring root permissions, the easy way."
my Code -
B4X:
Dim Process As SuProcess
Process = Su.Acquire("Su")
Dim ctxt As JavaObject
   ctxt.InitializeContext
   Dim r As Reflector
   r.Target = ctxt.RunMethod("getSystemService", Array("phone"))
   r.Target = r.RunMethod("getITelephony")
   Process.Execute(r.RunMethod2("supplyPin", "2812", "java.lang.String"))

also in manifest
B4X:
AddPermission("android.permission.ACCESS_SUPERUSER")
AddPermission("android.permission.MODIFY_PHONE_STATE")
but i get error
java.lang.SecurityException: Neither user 10130 nor current process has android.permission.MODIFY_PHONE_STATE.

Am i using superuser correctly or ...?
using kitkat 4.4.2
 
Upvote 0
Top