OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046

以下内容为反编译后的 SharePreferredActivity.java 源代码,内容仅作参考


package com.excelliance.kxqp;

import android.app.Activity;
import android.app.Application;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.core.content.FileProvider;
import com.excelliance.kxqp.bitmap.bean.RankingItem;
import com.excelliance.kxqp.platforms.ExcellianceAppInfo;
import com.excelliance.kxqp.ui.InitialData;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.apache.http.protocol.HTTP;

public class SharePreferredActivity extends Activity implements DialogInterface.OnCancelListener, DialogInterface.OnClickListener, View.OnClickListener {
    private static String d = "SharePreferredActivity";
    private static boolean e;

    public int f2229a;
    private Context f;
    private c g;
    private GridView h;
    private Intent i;
    private Intent j;
    private PopupWindow k;
    private View l;

    List<Integer> f2230b = new ArrayList();
    HashMap<String, CharSequence> c = new HashMap<>();
    private Handler m = new Handler() {
        @Override
        public void handleMessage(Message message) {
            if (message.what != 1) {
                return;
            }
            SharePreferredActivity.this.c();
        }
    };
    private boolean n = false;

    @Override
    public void onCreate(Bundle bundle) {
        File file;
        Intent intent;
        List<ResolveInfo> queryIntentActivities;
        boolean e2;
        Iterator<Integer> it;
        Intent intent2;
        boolean z;
        boolean z2;
        Intent intent3;
        int identifier;
        Uri fromFile;
        FileOutputStream fileOutputStream;
        super.onCreate(bundle);
        this.f = this;
        setContentView(getResources().getIdentifier("share_center_main", "layout", getPackageName()));
        this.j = new Intent("android.intent.action.SEND");
        this.j.setType("image/*");
        this.j.removeExtra("android.intent.extra.TEXT");
        String string = getSharedPreferences("appsConfig", Build.VERSION.SDK_INT < 11 ? 0 : 4).getString(RankingItem.KEY_ADDR, null);
        String str = "我最近正在使用【双开助手】,可以免费在一部手机上同时登录多个帐号(比如微信,QQ等),无需频繁切换,非常方便,你也来试试吧。http://www.multiopen.cn";
        if (string == null || string.length() == 0) {
            int identifier2 = getResources().getIdentifier("wx_url", "string", getPackageName());
            if (identifier2 > 0) {
                string = getResources().getString(identifier2, com.excelliance.kxqp.swipe.a.a.getString(this, "app_name"));
            }
            VersionManager versionManager = VersionManager.getInstance();
            versionManager.a(this.f);
            file = new File(versionManager.k() + "game_res/3rd/icon/share.jpg");
            if (!file.exists()) {
                file.getParentFile().mkdirs();
                Bitmap decodeResource = BitmapFactory.decodeResource(getResources(), getResources().getIdentifier("adv_bg", "drawable", this.f.getPackageName()));
                try {
                    file.createNewFile();
                    fileOutputStream = new FileOutputStream(file);
                } catch (Exception e3) {
                    e3.printStackTrace();
                    fileOutputStream = null;
                }
                try {
                    decodeResource.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream);
                    fileOutputStream.flush();
                } catch (Exception e4) {
                    e4.printStackTrace();
                }
                try {
                    fileOutputStream.close();
                } catch (Exception e5) {
                    e5.printStackTrace();
                }
            }
            this.j.removeExtra("android.intent.extra.TEXT");
            this.j.putExtra("Kdescription", str);
            this.j.putExtra("self_pkg", this.f.getPackageName());
            getResources().getString(getResources().getIdentifier("ic_share", "string", getPackageName()));
            if (file.exists()) {
                if (Build.VERSION.SDK_INT >= 24) {
                    fromFile = FileProvider.getUriForFile(this.f, this.f.getPackageName() + ".fileProvider", file);
                } else {
                    fromFile = Uri.fromFile(file);
                }
                this.j.putExtra("android.intent.extra.STREAM", fromFile);
            }
            this.j.putExtra("Kdescription", str);
            this.j.setFlags(268435457);
            intent = this.j;
            int intExtra = intent.getIntExtra("type", -1);
            String a2 = GameUtil.a(intExtra);
            if (e) {
                Log.d(d, "origIntent: " + intent + ", getType = " + intent.getType() + ", type = " + intExtra + ", sPkg = " + a2);
            }
            intent.getStringExtra("Kdescription");
            if (intent.getComponent() != null) {
                intent.setComponent(null);
            }
            this.i = new Intent(intent);
            this.i.setType(HTTP.PLAIN_TEXT_TYPE);
            this.i.putExtra("android.intent.extra.TEXT", str);
            this.i.removeExtra("android.intent.extra.STREAM");
            this.i.setComponent(null);
            int i = Build.VERSION.SDK_INT;
            this.i.setFlags(453509121);
            Intent intent4 = new Intent(intent.getAction());
            intent4.setType(intent.getType());
            Intent intent5 = new Intent(intent.getAction());
            intent5.setType("*/*");
            intent5.setPackage("com.tencent.mm");
            if (!GameUtil.b()) {
                com.excelliance.kxqp.wr.a a3 = com.excelliance.kxqp.wr.a.a();
                a3.a((Application) getApplicationContext(), (Application) getApplicationContext());
                a3.a((Application) getApplicationContext());
                GameUtil.b(true);
            }
            this.f2229a = b("share_app_item");
            this.f2230b = com.excelliance.kxqp.wr.a.a().f();
            ArrayList arrayList = new ArrayList();
            queryIntentActivities = getPackageManager().queryIntentActivities(intent4, 131072);
            if (queryIntentActivities != null) {
                Iterator<ResolveInfo> it2 = queryIntentActivities.iterator();
                new HashMap();
                new HashMap();
                ArrayList arrayList2 = new ArrayList();
                int i2 = 0;
                while (it2.hasNext()) {
                    ResolveInfo next = it2.next();
                    if (next != null && "com.tencent.mm".equals(next.activityInfo.packageName) && next.activityInfo.name != null && (next.activityInfo.name.endsWith(".ShareImgUI") || next.activityInfo.name.endsWith(".ShareToTimeLineUI"))) {
                        new ComponentName(next.activityInfo.packageName, next.activityInfo.name);
                        a aVar = new a(next, -1, next.activityInfo.loadLabel(getPackageManager()));
                        if (next.activityInfo.name.endsWith(".ShareImgUI")) {
                            arrayList2.add(0, aVar);
                            i2++;
                        } else if (i2 > 0) {
                            arrayList2.add(1, aVar);
                        } else {
                            arrayList2.add(0, aVar);
                        }
                        if (next.activityInfo.name.endsWith(".ShareImgUI")) {
                            identifier = this.f.getResources().getIdentifier("wx_friend", "string", this.f.getPackageName());
                        } else {
                            identifier = this.f.getResources().getIdentifier("wx_circle", "string", this.f.getPackageName());
                        }
                        if (identifier != 0) {
                            this.c.put(next.activityInfo.name, this.f.getResources().getString(identifier));
                        }
                    }
                }
                if (arrayList2.size() > 0) {
                    arrayList.add(arrayList2);
                }
            }
            ArrayList<ExcellianceAppInfo> a4 = InitialData.a(this).a();
            int a5 = PlatSdk.a(this);
            e2 = com.excelliance.kxqp.pay.ali.b.e(this.f);
            if (e2) {
                for (int i3 = 1; i3 < a5 + 1; i3++) {
                    a4.addAll(InitialData.a(this).a(-1, i3));
                }
            }
            it = this.f2230b.iterator();
            while (it.hasNext()) {
                int intValue = it.next().intValue();
                if (e2 || intValue <= 0) {
                    List<ResolveInfo> a6 = com.excelliance.kxqp.wr.a.a().a(this, intValue, intent4);
                    ArrayList<a> arrayList3 = new ArrayList();
                    List<ResolveInfo> a7 = com.excelliance.kxqp.wr.a.a().a(this, intValue, intent5);
                    ArrayList<a> arrayList4 = new ArrayList();
                    if (a6 != null) {
                        Iterator<ResolveInfo> it3 = a6.iterator();
                        while (it3.hasNext()) {
                            ResolveInfo next2 = it3.next();
                            Iterator<ExcellianceAppInfo> it4 = a4.iterator();
                            while (true) {
                                if (!it4.hasNext()) {
                                    z2 = false;
                                    break;
                                }
                                ExcellianceAppInfo next3 = it4.next();
                                if (next3 != null && next2.resolvePackageName.equals(next3.getAppPackageName()) && intValue == next3.getUid() && "com.tencent.mobileqq".equals(next2.resolvePackageName) && next2.activityInfo.name != null && next2.activityInfo.name.endsWith(".JumpActivity")) {
                                    z2 = true;
                                    break;
                                }
                            }
                            if (!z2) {
                                it3.remove();
                                intent3 = intent4;
                            } else {
                                CharSequence a8 = com.excelliance.kxqp.wr.a.a().a(intValue, next2);
                                intent3 = intent4;
                                this.c.put(next2.activityInfo.name, a8);
                                arrayList3.add(new a(next2, intValue, a8));
                            }
                            intent4 = intent3;
                        }
                        intent2 = intent4;
                        if (a7 != null) {
                            Iterator<ResolveInfo> it5 = a7.iterator();
                            while (it5.hasNext()) {
                                ResolveInfo next4 = it5.next();
                                Iterator<ExcellianceAppInfo> it6 = a4.iterator();
                                while (it6.hasNext()) {
                                    ExcellianceAppInfo next5 = it6.next();
                                    if (next5 != null && next4.resolvePackageName.equals(next5.getAppPackageName()) && intValue == next5.getUid() && (next4.activityInfo.name.endsWith(".ShareImgUI") || next4.activityInfo.name.endsWith(".ShareToTimeLineUI"))) {
                                        z = true;
                                        break;
                                    }
                                }
                                z = false;
                                if (!z) {
                                    it5.remove();
                                } else {
                                    this.c.put(next4.activityInfo.name, com.excelliance.kxqp.wr.a.a().a(intValue, next4));
                                    arrayList4.add(new a(next4, intValue, com.excelliance.kxqp.wr.a.a().a(intValue, next4)));
                                }
                            }
                            new HashMap();
                            ArrayList arrayList5 = new ArrayList();
                            int i4 = 0;
                            for (a aVar2 : arrayList4) {
                                if (aVar2.f2234a.activityInfo != null) {
                                    if (aVar2.f2234a.activityInfo.name.endsWith(".ShareImgUI")) {
                                        arrayList5.add(0, aVar2);
                                        i4++;
                                    } else if (i4 > 0) {
                                        arrayList5.add(1, aVar2);
                                    } else {
                                        arrayList5.add(0, aVar2);
                                    }
                                }
                            }
                            for (a aVar3 : arrayList3) {
                                if (aVar3.f2234a.activityInfo != null) {
                                    arrayList5.add(aVar3);
                                }
                            }
                            arrayList.add(arrayList5);
                        } else {
                            arrayList.add(arrayList3);
                        }
                    } else {
                        intent2 = intent4;
                    }
                    intent4 = intent2;
                }
            }
            this.g = new c(this, intent, arrayList);
            if (this.g.getCount() != 0) {
                int identifier3 = getResources().getIdentifier("not_support_share_type", "string", getPackageName());
                if (identifier3 == 0) {
                    identifier3 = getResources().getIdentifier("no_share_apps", "string", getPackageName());
                }
                if (identifier3 != 0) {
                    Toast.makeText(this, getResources().getString(identifier3), 0).show();
                }
                finish();
                return;
            }
            if (this.g.getCount() == 1) {
                this.g.a(0);
                finish();
                return;
            } else {
                this.m.sendEmptyMessageDelayed(1, 100L);
                return;
            }
        }
        str = string;
        VersionManager versionManager2 = VersionManager.getInstance();
        versionManager2.a(this.f);
        file = new File(versionManager2.k() + "game_res/3rd/icon/share.jpg");
        if (!file.exists()) {
        }
        this.j.removeExtra("android.intent.extra.TEXT");
        this.j.putExtra("Kdescription", str);
        this.j.putExtra("self_pkg", this.f.getPackageName());
        getResources().getString(getResources().getIdentifier("ic_share", "string", getPackageName()));
        if (file.exists()) {
        }
        this.j.putExtra("Kdescription", str);
        this.j.setFlags(268435457);
        intent = this.j;
        int intExtra2 = intent.getIntExtra("type", -1);
        String a22 = GameUtil.a(intExtra2);
        if (e) {
        }
        intent.getStringExtra("Kdescription");
        if (intent.getComponent() != null) {
        }
        this.i = new Intent(intent);
        this.i.setType(HTTP.PLAIN_TEXT_TYPE);
        this.i.putExtra("android.intent.extra.TEXT", str);
        this.i.removeExtra("android.intent.extra.STREAM");
        this.i.setComponent(null);
        int i5 = Build.VERSION.SDK_INT;
        this.i.setFlags(453509121);
        Intent intent42 = new Intent(intent.getAction());
        intent42.setType(intent.getType());
        Intent intent52 = new Intent(intent.getAction());
        intent52.setType("*/*");
        intent52.setPackage("com.tencent.mm");
        if (!GameUtil.b()) {
        }
        this.f2229a = b("share_app_item");
        this.f2230b = com.excelliance.kxqp.wr.a.a().f();
        ArrayList arrayList6 = new ArrayList();
        queryIntentActivities = getPackageManager().queryIntentActivities(intent42, 131072);
        if (queryIntentActivities != null) {
        }
        ArrayList<ExcellianceAppInfo> a42 = InitialData.a(this).a();
        int a52 = PlatSdk.a(this);
        e2 = com.excelliance.kxqp.pay.ali.b.e(this.f);
        if (e2) {
        }
        it = this.f2230b.iterator();
        while (it.hasNext()) {
        }
        this.g = new c(this, intent, arrayList6);
        if (this.g.getCount() != 0) {
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        try {
            if (this.k == null || !this.k.isShowing()) {
                return;
            }
            this.k.dismiss();
            this.k = null;
        } catch (Exception unused) {
        }
    }

    @Override
    public boolean onTouchEvent(MotionEvent motionEvent) {
        if ((motionEvent.getAction() & 255) == 0 && !this.n && this.k != null && this.k.isShowing() && !isFinishing()) {
            this.n = true;
            Animation loadAnimation = AnimationUtils.loadAnimation(this.f, getResources().getIdentifier("bottom_ok_out", "anim", this.f.getPackageName()));
            loadAnimation.setAnimationListener(new Animation.AnimationListener() {
                @Override
                public void onAnimationRepeat(Animation animation) {
                }

                @Override
                public void onAnimationStart(Animation animation) {
                }

                @Override
                public void onAnimationEnd(Animation animation) {
                    if (SharePreferredActivity.this.k != null && SharePreferredActivity.this.k.isShowing() && !SharePreferredActivity.this.isFinishing()) {
                        SharePreferredActivity.this.k.dismiss();
                    }
                    SharePreferredActivity.this.k = null;
                    SharePreferredActivity.this.n = false;
                }
            });
            this.l.startAnimation(loadAnimation);
        }
        return super.onTouchEvent(motionEvent);
    }

    public void c() {
        this.l = LayoutInflater.from(this).inflate(getResources().getIdentifier("ly_share_center", "layout", getPackageName()), (ViewGroup) null, false);
        this.l.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
        this.l.measure(0, 0);
        this.k = new PopupWindow(this.l, -1, -2, true);
        TextView textView = (TextView) this.l.findViewById(getResources().getIdentifier("share_center_title", "id", getPackageName()));
        int identifier = getResources().getIdentifier("ic_share", "string", getPackageName());
        if (identifier != 0) {
            textView.setText(getResources().getString(identifier));
        }
        this.h = (GridView) this.l.findViewById(getResources().getIdentifier("gv_share_center", "id", getPackageName()));
        this.h.setAdapter((ListAdapter) this.g);
        this.k.setBackgroundDrawable(new ColorDrawable(0));
        this.k.setFocusable(false);
        this.k.setOutsideTouchable(false);
        getResources().getIdentifier("top", "id", getPackageName());
        this.k.setOnDismissListener(new PopupWindow.OnDismissListener() {
            @Override
            public void onDismiss() {
                Log.d(SharePreferredActivity.d, "onDismiss");
                if (SharePreferredActivity.this.isFinishing()) {
                    return;
                }
                SharePreferredActivity.this.finish();
            }
        });
        if (this.k == null || this.k.isShowing()) {
            return;
        }
        findViewById(getResources().getIdentifier("share_center_root", "id", getPackageName()));
        try {
            this.k.showAtLocation(findViewById(getResources().getIdentifier("share_center_main_top", "id", getPackageName())), 80, 0, 0);
            this.l.startAnimation(AnimationUtils.loadAnimation(this.f, getResources().getIdentifier("bottom_ok_in", "anim", this.f.getPackageName())));
        } catch (Exception unused) {
            this.m.sendEmptyMessageDelayed(1, 200L);
        }
    }

    @Override
    public void onClick(View view) {
        b bVar = (b) view.getTag();
        if (bVar != null) {
            this.g.a(bVar.k);
        }
        finish();
    }

    @Override
    public void onClick(DialogInterface dialogInterface, int i) {
        this.g.a(i);
        finish();
    }

    @Override
    public void onCancel(DialogInterface dialogInterface) {
        finish();
    }

    public int a(String str) {
        return getResources().getIdentifier(str, "id", getPackageName());
    }

    public int b(String str) {
        return getResources().getIdentifier(str, "layout", getPackageName());
    }

    private class b {

        LinearLayout f2236a;

        ImageView f2237b;
        ImageView c;
        ImageView d;
        ImageView e;
        ImageView f;
        ImageView g;
        TextView h;
        ImageView i;
        ImageView j;
        int k;

        private b() {
        }
    }

    public final class c extends BaseAdapter {

        private final Intent f2239b;
        private final LayoutInflater c;
        private List<a> d;

        @Override
        public long getItemId(int i) {
            return i;
        }

        public c(Context context, Intent intent, List<List<a>> list) {
            this.f2239b = intent;
            this.c = (LayoutInflater) context.getSystemService("layout_inflater");
            if (list != null) {
                this.d = new ArrayList();
                int size = list.size();
                for (int i = 0; i < size; i++) {
                    List<a> list2 = list.get(i);
                    if (list2 != null) {
                        Iterator<a> it = list2.iterator();
                        while (it.hasNext()) {
                            this.d.add(it.next());
                        }
                    }
                }
            }
            ResolveInfo resolveInfo = new ResolveInfo();
            resolveInfo.activityInfo = new ActivityInfo();
            a aVar = new a(resolveInfo, -1, "更多");
            int identifier = SharePreferredActivity.this.f.getResources().getIdentifier("more", "string", SharePreferredActivity.this.f.getPackageName());
            if (identifier != 0) {
                aVar.c = SharePreferredActivity.this.f.getResources().getString(identifier);
            }
            int identifier2 = SharePreferredActivity.this.f.getResources().getIdentifier("more", "drawable", SharePreferredActivity.this.f.getPackageName());
            if (identifier2 != 0) {
                aVar.d = SharePreferredActivity.this.f.getResources().getDrawable(identifier2);
            }
            this.d.add(aVar);
        }

        @Override
        public int getCount() {
            if (this.d != null) {
                return this.d.size();
            }
            return 0;
        }

        @Override
        public Object getItem(int i) {
            return Integer.valueOf(i);
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            b bVar;
            b bVar2;
            String packageName = SharePreferredActivity.this.f.getPackageName();
            boolean z = (view == null || (bVar2 = (b) view.getTag()) == null || bVar2.k == i) ? false : true;
            if (view == null || z) {
                view = this.c.inflate(SharePreferredActivity.this.f2229a, viewGroup, false);
                Versioning.setBackgroundDrawable(view.getContext().getResources().getIdentifier("dr_light_bg", "drawable", view.getContext().getPackageName()), view, view.getContext());
                bVar = new b();
                bVar.f2236a = (LinearLayout) view.findViewById(SharePreferredActivity.this.f.getResources().getIdentifier("share_root", "id", packageName));
                bVar.i = (ImageView) view.findViewById(SharePreferredActivity.this.f.getResources().getIdentifier("share_item_front", "id", packageName));
                int identifier = SharePreferredActivity.this.f.getResources().getIdentifier("icon_front", "drawable", SharePreferredActivity.this.f.getPackageName());
                if (identifier != 0) {
                    bVar.i.setImageDrawable(SharePreferredActivity.this.f.getResources().getDrawable(identifier));
                }
                int identifier2 = SharePreferredActivity.this.f.getResources().getIdentifier("item_uid", "id", packageName);
                if (identifier2 != 0) {
                    bVar.j = (ImageView) view.findViewById(identifier2);
                }
                bVar.h = (TextView) view.findViewById(SharePreferredActivity.this.f.getResources().getIdentifier("share_item_app_name", "id", packageName));
                bVar.f2237b = (ImageView) view.findViewById(SharePreferredActivity.this.f.getResources().getIdentifier("share_item_app_icon", "id", packageName));
                bVar.e = (ImageView) view.findViewById(SharePreferredActivity.this.f.getResources().getIdentifier("share_delete_markView", "id", packageName));
                bVar.f = (ImageView) view.findViewById(SharePreferredActivity.this.f.getResources().getIdentifier("share_shortcut_markView", "id", packageName));
                bVar.c = (ImageView) view.findViewById(SharePreferredActivity.this.f.getResources().getIdentifier("share_app_not_install", "id", packageName));
                bVar.d = (ImageView) view.findViewById(SharePreferredActivity.this.f.getResources().getIdentifier("share_app_new_icon", "id", packageName));
                bVar.g = (ImageView) view.findViewById(SharePreferredActivity.this.f.getResources().getIdentifier("share_app_download_icon", "id", packageName));
                bVar.k = i;
                view.setTag(bVar);
            } else {
                bVar = (b) view.getTag();
            }
            LinearLayout linearLayout = bVar.f2236a;
            TextView textView = bVar.h;
            ImageView imageView = bVar.f2237b;
            ImageView imageView2 = bVar.e;
            ImageView imageView3 = bVar.f;
            linearLayout.setClickable(true);
            linearLayout.setLongClickable(true);
            a aVar = this.d.get(i);
            if (aVar.f2235b < 0) {
                bVar.i.setVisibility(8);
            } else {
                bVar.i.setVisibility(0);
            }
            imageView.setImageDrawable(SharePreferredActivity.this.f.getResources().getDrawable(SharePreferredActivity.this.f.getResources().getIdentifier("app_category_item_selector", "drawable", packageName)));
            int identifier3 = SharePreferredActivity.this.f.getResources().getIdentifier("app_operate_selector", "drawable", packageName);
            imageView2.setImageDrawable(SharePreferredActivity.this.f.getResources().getDrawable(identifier3));
            imageView3.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view2) {
                }
            });
            imageView3.setImageDrawable(SharePreferredActivity.this.f.getResources().getDrawable(identifier3));
            TextView textView2 = (TextView) view.findViewById(SharePreferredActivity.this.a("share_item_app_name"));
            ImageView imageView4 = (ImageView) view.findViewById(SharePreferredActivity.this.a("share_item_app_icon"));
            View findViewById = view.findViewById(SharePreferredActivity.this.a("share_root"));
            findViewById.setClickable(true);
            findViewById.setLongClickable(false);
            findViewById.setOnClickListener(SharePreferredActivity.this);
            textView2.setVisibility(0);
            imageView4.setVisibility(0);
            textView2.setTextColor(SharePreferredActivity.this.f.getResources().getColor(SharePreferredActivity.this.f.getResources().getIdentifier("app_text_color", "color", packageName)));
            if (aVar.f2235b >= 0) {
                textView2.setText(aVar.c);
            } else {
                CharSequence charSequence = SharePreferredActivity.this.c.get(aVar.f2234a.activityInfo.name);
                if (charSequence != null) {
                    textView2.setText(charSequence);
                } else {
                    textView2.setText(aVar.c);
                }
            }
            if (aVar.d == null) {
                if (aVar.f2235b < 0) {
                    aVar.d = aVar.f2234a.loadIcon(SharePreferredActivity.this.f.getPackageManager());
                } else {
                    aVar.d = com.excelliance.kxqp.wr.a.a().b(aVar.f2235b, aVar.f2234a);
                }
            }
            Bitmap a2 = GameUtil.a(aVar.d);
            GameUtil.a(a2, aVar.f2235b, SharePreferredActivity.this.f);
            if (aVar.f2235b >= 0 && bVar.j != null) {
                if (com.excelliance.kxqp.pay.ali.b.e(SharePreferredActivity.this.f)) {
                    BitmapDrawable bitmapDrawable = new BitmapDrawable(GameUtil.b(a2, aVar.f2235b + 1, SharePreferredActivity.this.f));
                    if (Build.VERSION.SDK_INT >= 16) {
                        bVar.j.setBackground(bitmapDrawable);
                    } else {
                        bVar.j.setBackgroundDrawable(bitmapDrawable);
                    }
                    bVar.j.setVisibility(0);
                } else {
                    bVar.j.setVisibility(8);
                }
            } else if (bVar.j != null) {
                bVar.j.setVisibility(8);
            }
            BitmapDrawable bitmapDrawable2 = new BitmapDrawable(a2);
            if (Build.VERSION.SDK_INT >= 16) {
                imageView.setBackground(bitmapDrawable2);
            } else {
                imageView.setBackgroundDrawable(bitmapDrawable2);
            }
            imageView4.setImageDrawable(null);
            return view;
        }

        public int a(int i) {
            if (this.d == null) {
                return -1;
            }
            a aVar = this.d.get(i);
            Intent intent = new Intent(this.f2239b);
            ActivityInfo activityInfo = aVar.f2234a.activityInfo;
            if (i < this.d.size() - 1) {
                intent.setComponent(new ComponentName(activityInfo.applicationInfo.packageName, activityInfo.name));
            }
            if (SharePreferredActivity.e) {
                Log.d(SharePreferredActivity.d, "new intent: " + intent);
            }
            if (aVar.f2235b < 0) {
                if (i >= this.d.size() - 1) {
                    String string = SharePreferredActivity.this.f.getResources().getString(SharePreferredActivity.this.f.getResources().getIdentifier("ic_share", "string", SharePreferredActivity.this.f.getPackageName()));
                    SharePreferredActivity.this.i.setComponent(null);
                    try {
                        SharePreferredActivity.this.f.startActivity(Intent.createChooser(SharePreferredActivity.this.i, string));
                    } catch (Exception unused) {
                    }
                } else if (activityInfo != null && activityInfo.name != null && activityInfo.name.endsWith(".ShareToTimeLineUI")) {
                    SharePreferredActivity.this.j.setComponent(new ComponentName(activityInfo.applicationInfo.packageName, activityInfo.name));
                    SharePreferredActivity.this.f.startActivity(SharePreferredActivity.this.j);
                } else if (activityInfo == null || activityInfo.name == null) {
                    SharePreferredActivity.this.f.startActivity(intent);
                } else {
                    SharePreferredActivity.this.i.setComponent(new ComponentName(activityInfo.applicationInfo.packageName, activityInfo.name));
                    SharePreferredActivity.this.f.startActivity(SharePreferredActivity.this.i);
                }
                return 0;
            }
            if (activityInfo == null || activityInfo.name == null || !activityInfo.name.endsWith(".ShareToTimeLineUI")) {
                SharePreferredActivity.this.i.setComponent(new ComponentName(activityInfo.applicationInfo.packageName, activityInfo.name));
                if (Build.VERSION.SDK_INT >= 14) {
                    try {
                        Intent.class.getDeclaredMethod("setAllowFds", Boolean.TYPE).invoke(SharePreferredActivity.this.i, false);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
                return com.excelliance.kxqp.wr.a.a().startActivity(aVar.f2235b, SharePreferredActivity.this.i);
            }
            SharePreferredActivity.this.j.setComponent(new ComponentName(activityInfo.applicationInfo.packageName, activityInfo.name));
            if (Build.VERSION.SDK_INT >= 14) {
                try {
                    Intent.class.getDeclaredMethod("setAllowFds", Boolean.TYPE).invoke(SharePreferredActivity.this.j, false);
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
            }
            return com.excelliance.kxqp.wr.a.a().startActivity(aVar.f2235b, SharePreferredActivity.this.j);
        }
    }

    public final class a {

        ResolveInfo f2234a;

        int f2235b;
        CharSequence c;
        Drawable d;

        a(ResolveInfo resolveInfo, int i, CharSequence charSequence) {
            this.f2234a = resolveInfo;
            this.f2235b = i;
            this.c = charSequence;
        }
    }
}