Android Question Sim Pin auto enter

Discussion in 'Android Questions' started by walmo, Jul 24, 2018.

  1. walmo

    walmo Member Licensed User

    Hi
    I found this code ...
    Code:
    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 -
    Code:
    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: Jul 25, 2018
  2. Erel

    Erel Administrator Staff Member Licensed User

    Please use [code]code here...[/code] tags when posting code.
     
  3. walmo

    walmo Member Licensed User

    sorry , fixed it.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Untested code:
    Code:
    Dim ctxt As JavaObject
    ctxt.InitializeContext
    Dim r As Reflector
    r.Target = ctxt.RunMethod(
    "getSystemService"Array("phone"))
    r.Target = r.RunMethod(
    "getITelephony")
    r.RunMethod2(
    "supplyPin""1111""java.lang.String")
    It is unlikely to work in new versions of Android.
     
  5. walmo

    walmo Member Licensed User

    Thank you Erel
    But now ....
    The phone is rooted and im using "SuperUser: Acquiring root permissions, the easy way."
    my Code -
    Code:
    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
    Code:
    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
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Seems like you are not running as root. I'm not familiar with this library.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice