导航菜单

页面标题

页面副标题

Tasker v6.6.3 - ShizukuProvider.java 源代码

正在查看: Tasker v6.6.3 应用的 ShizukuProvider.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package rikka.shizuku;

import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ProviderInfo;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;
import hm.g;
import im.a;
import moe.shizuku.api.BinderContainer;

public class ShizukuProvider extends ContentProvider {
    private static boolean i = false;
    private static boolean q = false;
    private static boolean r = true;

    private boolean a(Bundle bundle) {
        IBinder s = g.s();
        if (s == null || !s.pingBinder()) {
            return false;
        }
        bundle.putParcelable("moe.shizuku.privileged.api.intent.extra.BINDER", new BinderContainer(s));
        return true;
    }

    private void b(Bundle bundle) {
        if (g.B()) {
            Log.d("ShizukuProvider", "sendBinder is called when already a living binder");
            return;
        }
        BinderContainer binderContainer = (BinderContainer) bundle.getParcelable("moe.shizuku.privileged.api.intent.extra.BINDER");
        if (binderContainer == null || binderContainer.i == null) {
            return;
        }
        Log.d("ShizukuProvider", "binder received");
        g.A(binderContainer.i, getContext().getPackageName());
        if (i) {
            Log.d("ShizukuProvider", "broadcast binder");
            getContext().sendBroadcast(new Intent("moe.shizuku.api.action.BINDER_RECEIVED").putExtra("moe.shizuku.privileged.api.intent.extra.BINDER", binderContainer).setPackage(getContext().getPackageName()));
        }
    }

    @Override
    public void attachInfo(Context context, ProviderInfo providerInfo) {
        super.attachInfo(context, providerInfo);
        if (providerInfo.multiprocess) {
            throw new IllegalStateException("android:multiprocess must be false");
        }
        if (!providerInfo.exported) {
            throw new IllegalStateException("android:exported must be true");
        }
        q = true;
    }

    @Override
    public Bundle call(String str, String str2, Bundle bundle) {
        if (a.b()) {
            Log.w("ShizukuProvider", "Provider called when Sui is available. Are you using Shizuku and Sui at the same time?");
            return new Bundle();
        }
        if (bundle == null) {
            return null;
        }
        bundle.setClassLoader(BinderContainer.class.getClassLoader());
        Bundle bundle2 = new Bundle();
        str.hashCode();
        if (str.equals("sendBinder")) {
            b(bundle);
        } else if (str.equals("getBinder") && !a(bundle2)) {
            return null;
        }
        return bundle2;
    }

    @Override
    public final int delete(Uri uri, String str, String[] strArr) {
        return 0;
    }

    @Override
    public final String getType(Uri uri) {
        return null;
    }

    @Override
    public final Uri insert(Uri uri, ContentValues contentValues) {
        return null;
    }

    @Override
    public boolean onCreate() {
        if (!r || a.b()) {
            return true;
        }
        Log.d("ShizukuProvider", "Initialize Sui: " + a.a(getContext().getPackageName()));
        return true;
    }

    @Override
    public final Cursor query(Uri uri, String[] strArr, String str, String[] strArr2, String str2) {
        return null;
    }

    @Override
    public final int update(Uri uri, ContentValues contentValues, String str, String[] strArr) {
        return 0;
    }
}