TikTok.apk(点击下载) / C518922w.java


package X;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import com.bytedance.covode.number.Covode;
import java.net.URLEncoder;
import kotlin.g.b.m;

/* renamed from: X.22w  reason: invalid class name and case insensitive filesystem */
public final class C518922w {
    static {
        Covode.recordClassIndex(78096);
    }

    public static final boolean LIZ(Context context, String str, String str2) {
        PackageManager packageManager = context.getPackageManager();
        m.LIZIZ(packageManager, "");
        Intent intent = new Intent("android.intent.action.VIEW");
        try {
            String concat = "https://api.whatsapp.com/send?phone=".concat(String.valueOf(str));
            if (C20890sI.LIZ(str2)) {
                concat = concat + "&text=" + URLEncoder.encode(str2, "UTF-8");
            }
            intent.setPackage("com.whatsapp");
            intent.setData(Uri.parse(concat));
            if (intent.resolveActivity(packageManager) == null) {
                return false;
            }
            C21280sv.LIZ(intent, context);
            context.startActivity(intent);
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
}