Hello, you need the help of a professional, as this task is extremely difficult.
I'm trying to create an instance of the com.android.internal.telephony.RIL class. I added the closed API and did everything correctly - I skipped the modem framework through dex2jar and added it to the used classes. Also opened the jar in jd-gui . By the way, most likely the framework has been modified by the manufacturer - Micromax . I called the static method TelephonyDevController.getModemCount() and got the return value - everything works . In general, the task is as follows:
There is a com.android.internal.telephony.IccCard interface with the boolean getIccLockEnabled() method. There is a class that implements it - com.android.internal.telephony.uicc.IccCardProxy . I want to call its getIccLockEnabled method. To create an instance of this class, you need to pass the android.content.Context , com.android.internal.telephony.CommandsInterface and int parameters to its constructor. The second parameter is the interface, which means you can transfer its subclass, namely, com.android.internal.telephony.RIL . To create an instance of RIL , you must pass a context and two int to its constructor. But when creating RIL application crashes with the TelephonyDevController not yet created!?! log TelephonyDevController not yet created!?! .
Here is the class constructor RIL
public RIL(Context paramContext, int paramInt1, int paramInt2, Integer paramInteger) { super(paramContext); riljLog("RIL(context, preferredNetworkType=" + paramInt1 + " cdmaSubscription=" + paramInt2 + ")"); this.mContext = paramContext; this.mCdmaSubscription = paramInt2; this.mPreferredNetworkType = paramInt1; this.mPhoneType = 0; this.mInstanceId = paramInteger; this.mWakeLock = ((PowerManager)paramContext.getSystemService("power")).newWakeLock(1, "RILJ"); this.mWakeLock.setReferenceCounted(false); this.mWakeLockTimeout = SystemProperties.getInt("ro.ril.wake_lock_timeout", 60000); this.mWakeLockCount = 0; this.mSenderThread = new HandlerThread("RILSender" + this.mInstanceId); this.mSenderThread.start(); this.mSender = new RILSender(this.mSenderThread.getLooper()); if (!((ConnectivityManager)paramContext.getSystemService("connectivity")).isNetworkSupported(0)) { riljLog("Not starting RILReceiver: wifi-only"); } for (;;) { TelephonyDevController.getInstance(); TelephonyDevController.registerRIL(this); return; riljLog("Starting RILReceiver" + this.mInstanceId); this.mReceiver = createRILReceiver(); this.mReceiverThread = new Thread(this.mReceiver, "RILReceiver" + this.mInstanceId); this.mReceiverThread.start(); paramContext = (DisplayManager)paramContext.getSystemService("display"); this.mDefaultDisplay = paramContext.getDisplay(0); paramContext.registerDisplayListener(this.mDisplayListener, null); } } And the methods of the class TelephonyDevController are create() and getInstance()
public static TelephonyDevController create() { synchronized (mLock) { if (sTelephonyDevController != null) { throw new RuntimeException("TelephonyDevController already created!?!"); } } sTelephonyDevController = new TelephonyDevController(); TelephonyDevController localTelephonyDevController = sTelephonyDevController; return localTelephonyDevController; } public static TelephonyDevController getInstance() { synchronized (mLock) { if (sTelephonyDevController == null) { throw new RuntimeException("TelephonyDevController not yet created!?!"); } } TelephonyDevController localTelephonyDevController = sTelephonyDevController; return localTelephonyDevController; }
TelephonyDevControllerandRILand just stupidly duplicate them in oneself (in a different package) with all dependent imports? - Barmaley