首页
社区
课程
招聘
某app jni 接口解压包之后 没有找到对应的so
发表于: 2020-5-16 16:50 2895

某app jni 接口解压包之后 没有找到对应的so

2020-5-16 16:50
2895
package com.apple.android.storeservices.javanative.account;

import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.support.v4.b.o;
import android.support.v4.b.w;
import com.apple.android.mediaservices.javanative.common.CFTypes.CFDictionary;
import com.apple.android.mediaservices.javanative.http.HTTPMessage.HTTPMessagePtr;
import com.apple.android.storeservices.b.a;
import com.apple.android.storeservices.b.b;
import com.apple.android.storeservices.javanative.account.CredentialsRequest.CredentialsRequestPtr;
import com.apple.android.storeservices.javanative.account.CredentialsResponse.CredentialsResponsePtr;
import com.apple.android.storeservices.javanative.account.ProtocolAction.ProtocolActionNative;
import com.apple.android.storeservices.javanative.account.ProtocolAction.ProtocolActionPtr;
import com.apple.android.storeservices.javanative.account.ProtocolButton.ProtocolButtonPtr;
import com.apple.android.storeservices.javanative.account.ProtocolButtonVector.ProtocolButtonVectorNative;
import com.apple.android.storeservices.javanative.account.ProtocolDialog.ProtocolDialogPtr;
import com.apple.android.storeservices.javanative.account.ProtocolDialogResponse.ProtocolDialogResponsePtr;
import com.apple.android.storeservices.javanative.account.RequestContext.RequestContextPtr;
import java.lang.ref.WeakReference;
import java.util.Deque;
import java.util.LinkedList;
import org.bytedeco.javacpp.BytePointer;
import org.bytedeco.javacpp.FunctionPointer;
import org.bytedeco.javacpp.Pointer;
import org.bytedeco.javacpp.annotation.ByPtr;
import org.bytedeco.javacpp.annotation.ByRef;
import org.bytedeco.javacpp.annotation.ByVal;
import org.bytedeco.javacpp.annotation.Cast;
import org.bytedeco.javacpp.annotation.Const;
import org.bytedeco.javacpp.annotation.Name;
import org.bytedeco.javacpp.annotation.Namespace;
import org.bytedeco.javacpp.annotation.Platform;
import org.bytedeco.javacpp.annotation.StdString;

@Namespace("androidstoreservices")
@Platform(include = {"AndroidStoreServices.h", "URLRequest.h"}, link = {"androidstoreservices"})
/* compiled from: MusicApp */
public class AndroidStoreServices {

    /* compiled from: MusicApp */
    public class AndroidCredentialsHandler extends FunctionPointer implements b {
        static final String TAG = AndroidCredentialsHandler.class.getSimpleName();
        private CredentialsResponseCallback callback;
        private a fragment;
        private final Class<? extends a> fragmentClass;
        private Bundle fragmentInitBundle;
        private final WeakReference<w> fragmentManager;

        private native void allocate();

        public AndroidCredentialsHandler(w wVar, Class<? extends a> cls, Bundle bundle) {
            this.fragmentManager = new WeakReference<>(wVar);
            this.fragmentClass = cls;
            this.fragmentInitBundle = bundle;
            allocate();
        }

        /* access modifiers changed from: 0000 */
        public void call(@ByVal CredentialsRequestPtr credentialsRequestPtr, @ByVal CredentialsResponseCallback credentialsResponseCallback) {
            if (this.fragmentManager.get() != null) {
                this.callback = credentialsResponseCallback;
                this.fragment = (a) this.fragmentClass.newInstance();
                if (this.fragmentInitBundle != null) {
                    this.fragment.g(this.fragmentInitBundle);
                }
                this.fragment.a(credentialsRequestPtr);
                this.fragment.a((b) this);
                this.fragment.a((w) this.fragmentManager.get(), this.fragmentClass.getCanonicalName());
            }
        }

        public void dialogDismissed(int i) {
            credentialsDialogDismissed(-2, null, null);
        }

        public void credentialsDialogDismissed(int i, String str, String str2) {
            CredentialsResponsePtr create = CredentialsResponsePtr.create();
            if (i != -1 || str == null) {
                create.get().setResponseType(0);
            } else {
                create.get().setUserName(str);
                create.get().setPassword(str2);
                create.get().setResponseType(2);
            }
            this.callback.call(create);
        }

        public void dismissDialog() {
            if (this.fragment != null && this.fragment.s()) {
                dialogDismissed(-2);
            }
        }
    }

    /* compiled from: MusicApp */
    public class AndroidDialogHandler extends FunctionPointer implements b {
        static final String TAG = AndroidDialogHandler.class.getSimpleName();
        private a contentDialog;
        private Class<? extends a> dialogClass;
        private Deque<ProtocolDialogPtr> dialogPtrs = new LinkedList();
        private c dialogUICallback;
        private final WeakReference<w> fragmentManager;
        private Handler handler;
        private Deque<Integer> lastTypes = new LinkedList();
        private RequestContextPtr requestContextPtr;
        private DialogResponseCallback responseCallback;

        private native void allocate();

        public AndroidDialogHandler(w wVar, Class<? extends a> cls) {
            this.fragmentManager = new WeakReference<>(wVar);
            this.dialogClass = cls;
            allocate();
            this.handler = new Handler(Looper.getMainLooper());
        }

        public void setDialogUICallback(c cVar) {
            this.dialogUICallback = cVar;
        }

        public void setDialogClass(Class<? extends a> cls) {
            this.dialogClass = cls;
        }

        public void setRequestContext(RequestContextPtr requestContextPtr2) {
            this.requestContextPtr = requestContextPtr2;
        }

        /* access modifiers changed from: 0000 */
        public void call(@ByVal ProtocolDialogPtr protocolDialogPtr, @ByVal DialogResponseCallback dialogResponseCallback) {
            synchronized (this.dialogPtrs) {
                this.dialogPtrs.addLast(protocolDialogPtr);
            }
            this.responseCallback = dialogResponseCallback;
            "Dialog message: " + protocolDialogPtr.get().getMessage();
            "Dialog title: " + protocolDialogPtr.get().getTitle();
            "Dialog kind [0=default, 1=authentication, 2=fullscreen]: " + protocolDialogPtr.get().getDialogKind();
            "Dialog buttons size: " + protocolDialogPtr.get().getButtons().size();
            if (this.dialogUICallback != null) {
                protocolDialogPtr.get().getDialogKind();
            }
            ProtocolButtonVectorNative buttons = protocolDialogPtr.get().getButtons();
            for (int i = 0; ((long) i) < buttons.size(); i++) {
                ProtocolButtonPtr protocolButtonPtr = buttons.get((long) i);
                "Button " + i + " title: " + protocolButtonPtr.get().getTitle();
                ProtocolActionPtr action = protocolButtonPtr.get().getAction();
                if (action == null || action.address() == 0) {
                    "Button " + i + " has no action";
                } else {
                    ProtocolActionNative protocolActionNative = action.get();
                    if (protocolActionNative == null || protocolActionNative.address() == 0) {
                        "Button " + i + " has no action type";
                    } else {
                        "Button " + i + " action: " + protocolActionNative.getActionType();
                    }
                }
            }
            if (3059 == protocolDialogPtr.get().getFailureType()) {
                ProtocolDialogResponsePtr create = ProtocolDialogResponsePtr.create();
                create.get().setPerformsDefaultButtonActions(true);
                dialogResponseCallback.call(create);
            }
            "Text fields size: " + protocolDialogPtr.get().getTextFields().size();
            this.handler.post(new b(this, protocolDialogPtr, protocolDialogPtr.get().getDialogKind()));
        }

        /* access modifiers changed from: private */
        public void showDialog(ProtocolDialogPtr protocolDialogPtr, int i) {
            if (this.fragmentManager.get() != null) {
                synchronized (this.lastTypes) {
                    this.lastTypes.addLast(Integer.valueOf(i));
                }
                this.contentDialog = (a) ((w) this.fragmentManager.get()).a(TAG + i);
                "Showing Dialog - contentDialog: " + this.contentDialog + " / dialogClass: " + this.dialogClass + " / " + this.fragmentManager;
                if (this.contentDialog == null && this.dialogClass != null) {
                    try {
                        this.contentDialog = (a) this.dialogClass.newInstance();
                        this.contentDialog.a(protocolDialogPtr, this.requestContextPtr);
                        Bundle bundle = new Bundle();
                        bundle.putBoolean("has_callback", true);
                        this.contentDialog.g(bundle);
                        this.contentDialog.a((b) this);
                        "Showing dialog fragment of type " + i;
                        try {
                            this.contentDialog.a((w) this.fragmentManager.get(), TAG + i);
                        } catch (Exception e) {
                            dialogDismissed(-1);
                        }
                    } catch (IllegalAccessException | InstantiationException e2) {
                    }
                }
            }
        }

        public Object getDialog() {
            o oVar;
            synchronized (this.lastTypes) {
                if (this.lastTypes.isEmpty() || this.fragmentManager.get() == null) {
                    oVar = null;
                } else {
                    oVar = ((w) this.fragmentManager.get()).a(TAG + this.lastTypes.pollLast());
                }
            }
            return oVar;
        }

        public void dismissDialog() {
            if (this.contentDialog != null && this.contentDialog.s()) {
                dialogDismissed(-1);
            }
        }

        public void dialogDismissed(int i) {
            ProtocolDialogPtr protocolDialogPtr;
            "Dialog was dismissed; button " + i + " clicked";
            synchronized (this.dialogPtrs) {
                if (this.dialogPtrs.size() == 1) {
                    protocolDialogPtr = (ProtocolDialogPtr) this.dialogPtrs.getLast();
                } else {
                    protocolDialogPtr = (ProtocolDialogPtr) this.dialogPtrs.pollLast();
                }
            }
            if (protocolDialogPtr == null) {
                return;
            }
            if (i == -1 || protocolDialogPtr.get().getButtons().get((long) i).address() != 0) {
                ProtocolDialogResponsePtr create = ProtocolDialogResponsePtr.create();
                if (i != -1) {
                    ProtocolButtonPtr protocolButtonPtr = protocolDialogPtr.get().getButtons().get((long) i);
                    "Setting selected button: " + protocolButtonPtr.address();
                    create.get().setSelectedButton(protocolButtonPtr);
                    ProtocolActionPtr action = protocolButtonPtr.get().getAction();
                    if (action == null || action.get() == null || !action.get().getActionType().equals("purchase")) {
                        create.get().setPerformsDefaultButtonActions(true);
                    } else {
                        create.get().setPerformsDefaultButtonActions(false);
                    }
                }
                "Response callback address: " + this.responseCallback.address();
                this.responseCallback.call(create);
            }
        }

        public void credentialsDialogDismissed(int i, String str, String str2) {
        }
    }

    @Name({"AndroidPresentationInterface"})
    /* compiled from: MusicApp */
    public class AndroidPresentationInterfaceNative extends Pointer {
        private AndroidCredentialsHandler credentialsHandler;
        private AndroidDialogHandler dialogHandler;

        private native void allocate();

        @Name({"setCredentialsHandler"})
        private native void setCredentialsHandlerNative(AndroidCredentialsHandler androidCredentialsHandler);

        @Name({"setDialogHandler"})
        private native void setDialogHandlerNative(AndroidDialogHandler androidDialogHandler);

        public AndroidPresentationInterfaceNative() {
            allocate();
        }

        public void setCredentialsHandler(AndroidCredentialsHandler androidCredentialsHandler) {
            if (this.credentialsHandler != null) {
                this.credentialsHandler.deallocate();
            }
            this.credentialsHandler = androidCredentialsHandler;
            setCredentialsHandlerNative(androidCredentialsHandler);
        }

        public void setDialogHandler(AndroidDialogHandler androidDialogHandler) {
            if (this.dialogHandler != null) {
                this.dialogHandler.deallocate();
            }
            this.dialogHandler = androidDialogHandler;
            setDialogHandlerNative(androidDialogHandler);
        }
    }

    @Namespace("")
    @Name({"std::shared_ptr<storeservicescore::PresentationInterface>"})
    /* compiled from: MusicApp */
    public class AndroidPresentationInterfacePtr extends Pointer {
        public native void allocate(@ByPtr AndroidPresentationInterfaceNative androidPresentationInterfaceNative);

        @Cast({"androidstoreservices::AndroidPresentationInterface*"})
        public native AndroidPresentationInterfaceNative get();

        public AndroidPresentationInterfacePtr(AndroidPresentationInterfaceNative androidPresentationInterfaceNative) {
            allocate(androidPresentationInterfaceNative);
        }
    }

    /* compiled from: MusicApp */
    public class CredentialsResponseCallback extends FunctionPointer {
        public native void call(@ByRef @Const CredentialsResponsePtr credentialsResponsePtr);
    }

    /* compiled from: MusicApp */
    public class DialogResponseCallback extends FunctionPointer {
        public native void call(@ByRef @Const ProtocolDialogResponsePtr protocolDialogResponsePtr);
    }

    @Namespace("StoreClient")
    @ByVal
    public static native HTTPMessagePtr createBinaryPlistRequest(@ByVal CFDictionary cFDictionary, @Const @ByVal RequestContextPtr requestContextPtr, @ByRef @StdString @Const String str);

    @Namespace("TiltClient")
    @ByVal
    public static native HTTPMessagePtr createFetchMetaDataRequest(BytePointer bytePointer, int i, @Const @ByVal RequestContextPtr requestContextPtr, @ByRef @StdString @Const String str);

    @Namespace("TiltClient")
    @ByVal
    public static native HTTPMessagePtr createGetTracksRequest(@ByRef @StdString @Const String str, boolean z, boolean z2, @Cast({"int32_t"}) int i, @Const @ByVal RequestContextPtr requestContextPtr, @ByRef @StdString @Const String str2, @ByPtr @Const CFDictionary cFDictionary, boolean z3);
}

这里面也没用找到loadlibrary()其他so对应代码都有,同时我看了maps 里面的加载记录 也没有androidstoreservices.so加载过程,压缩过后的文件也没用对应的so,想明白这是什么技术实现的


[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

最后于 2020-5-16 16:51 被Erlösung编辑 ,原因:
收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 29
活跃值: (5682)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
注入这个进程,反射获取这几个native的Method,然后传入native层,根据Method拿到jmethodid变量,解析native函数的入口地址,然后dladdr获取模块信息即可
2020-5-17 11:36
0
雪    币: 29
活跃值: (295)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
3
不吃早饭 注入这个进程,反射获取这几个native的Method,然后传入native层,根据Method拿到jmethodid变量,解析native函数的入口地址,然后dladdr获取模块信息即可
2020-5-17 14:29
0
游客
登录 | 注册 方可回帖
返回
//