Android jni framework internal class init and use help need

i am using c++ for target to build android internal framework api.
api is accessible i tested with frida hooking methods.
for reference link

java code here.

public x3Client(Context arg2) {
        this.mLock = new Object();
        this.mConnection = new$1(this);
        this.mContext = arg2;
        this.mBound = false;
        this.mSuccess = false;

public void bindService() {
        Object v0 = this.mLock;
        try {
            if(!this.mBound) {
                Intent v1_1 = new Intent();
                v1_1.setComponent(new ComponentName("", ""));
                if(this.mContext.bindService(v1_1, this.mConnection, 1)) {
                    this.mSuccess = true;
                    Log.d("x3Client", "Bind service successfully");
                else {
                    this.mSuccess = false;
                    Log.e("x3Client", "Bind service fail!!");

        catch(Throwable v1) {
            goto label_29;

        throw v1;

public String getFactoryVersion() {
        Response v1 = this.request(4011, new byte[30]);
        if(v1 == null) {
            return "";
        return new String(, 0, v1.length);

My issue is how to get context for this init ?

with jni

myclass =env->FindClass("com/x1/android/x2/client/x3Client") 
method_buildx1 = env->GetStaticMethodID(myclass,"<init>","(Landroid/content/Context;)V")

How do i get Context for jni ? i have to build apk and pass this to my lib or i have any other way ?

Without calling init or building constructor & context i can’t use bindService function its return error or crash on this.mLock not accessible or valid.

Is there any way around for get this server in JNI C++ only ?
Please note that this service is not accessible on normal shell "sm-getService(String16("")) not working" only created on demand by bindService.

Source: Windows Questions C++