导航菜单

页面标题

页面副标题

Hyouka private v5.8.9 - ShareManger.java 源代码

正在查看: Hyouka private v5.8.9 应用的 ShareManger.java JAVA 源代码文件

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


package com.beint.project.utils;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.res.AssetFileDescriptor;
import android.net.Uri;
import android.provider.ContactsContract;
import com.beint.project.core.managers.InviteDeepLinkRequest;
import com.beint.project.core.model.sms.ZangiMessage;
import com.beint.project.core.utils.AppUserManager;
import com.beint.project.core.utils.Log;
import com.beint.project.managers.InviteController;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.util.List;

public final class ShareManger {
    public static final ShareManger INSTANCE = new ShareManger();
    private static File vcfFile;

    private ShareManger() {
    }

    private final void makeDeepLinkRequest(Context context, String str, String str2, qb.a<fb.r> aVar) {
        String userNumber = AppUserManager.INSTANCE.getUserNumber();
        if (userNumber == null) {
            userNumber = "";
        }
        new InviteDeepLinkRequest(userNumber).sendRequestAsync(new ShareManger$makeDeepLinkRequest$1(aVar, str, str2, context));
    }

    public final void shareText(String str, Context context) {
        Intent intent = new Intent("android.intent.action.SEND");
        intent.setType("text/plain");
        intent.putExtra("android.intent.extra.TEXT", str);
        if (intent.getAction() != null) {
            intent.addFlags(268435456);
            if (context != null) {
                try {
                    context.startActivity(Intent.createChooser(intent, context.getResources().getString(2131887416)));
                } catch (ActivityNotFoundException unused) {
                }
            }
        }
    }

    public final String getLocationUrl(ZangiMessage zangiMessage) {
        if (zangiMessage == null) {
            return "";
        }
        String msgInfo = zangiMessage.getMsgInfo();
        kotlin.jvm.internal.k.c(msgInfo);
        String substring = msgInfo.substring(0, zb.f.H(msgInfo, "*", 0, false, 6, (Object) null));
        kotlin.jvm.internal.k.e(substring, "this as java.lang.String…ing(startIndex, endIndex)");
        String substring2 = msgInfo.substring(zb.f.H(msgInfo, "*", 0, false, 6, (Object) null) + 1);
        kotlin.jvm.internal.k.e(substring2, "this as java.lang.String).substring(startIndex)");
        return "http://maps.apple.com/maps?q=" + substring + ',' + substring2;
    }

    public final java.lang.String getLookUpKey(android.content.Context r12, com.beint.project.core.model.sms.ZangiMessage r13) {
        throw new UnsupportedOperationException("Method not decompiled: com.beint.project.utils.ShareManger.getLookUpKey(android.content.Context, com.beint.project.core.model.sms.ZangiMessage):java.lang.String");
    }

    public final File getVcfFile() {
        return vcfFile;
    }

    public final void setVcfFile(File file) {
        vcfFile = file;
    }

    public final void share(com.beint.project.core.model.sms.ZangiMessage r12, android.content.Context r13) {
        throw new UnsupportedOperationException("Method not decompiled: com.beint.project.utils.ShareManger.share(com.beint.project.core.model.sms.ZangiMessage, android.content.Context):void");
    }

    public final void sharePrivateNumber(String str, String str2, Context context, qb.a<fb.r> aVar) {
        kotlin.jvm.internal.k.f(str, "shareText");
        kotlin.jvm.internal.k.f(str2, "shareNumber");
        kotlin.jvm.internal.k.f(aVar, "completion");
        InviteController inviteController = InviteController.INSTANCE;
        String deepLink = inviteController.getDeepLink();
        if (deepLink == null || deepLink.length() == 0) {
            makeDeepLinkRequest(context, str, str2, aVar);
            return;
        }
        aVar.invoke();
        shareText(str + "\n\n" + str2 + "\n\n" + inviteController.getDeepLink(), context);
    }

    public final void writeInFile(Context context, ZangiMessage zangiMessage) {
        kotlin.jvm.internal.k.f(context, "context");
        kotlin.jvm.internal.k.f(zangiMessage, "message");
        String lookUpKey = getLookUpKey(context, zangiMessage);
        if (lookUpKey.length() == 0) {
            return;
        }
        AssetFileDescriptor openAssetFileDescriptor = context.getApplicationContext().getContentResolver().openAssetFileDescriptor(Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookUpKey), "r");
        FileInputStream createInputStream = openAssetFileDescriptor != null ? openAssetFileDescriptor.createInputStream() : null;
        long declaredLength = openAssetFileDescriptor != null ? openAssetFileDescriptor.getDeclaredLength() : 0L;
        if (declaredLength < 0) {
            declaredLength = 1;
        }
        byte[] bArr = new byte[(int) declaredLength];
        if (createInputStream != null) {
            createInputStream.read(bArr);
        }
        List<String> Z = zb.f.Z(new String(bArr, zb.c.b), new String[]{"\n"}, false, 0, 6, (Object) null);
        String str = "";
        if (!Z.isEmpty()) {
            for (String str2 : Z) {
                if (zb.f.t(str2, "TEL;", false, 2, (Object) null)) {
                    str2 = zb.f.p(str2, "TEL;", "TEL;TYPE=", false, 4, (Object) null);
                } else if (zb.f.t(str2, "EMAIL;", false, 2, (Object) null)) {
                    str2 = zb.f.p(str2, "EMAIL;", "EMAIL;TYPE=", false, 4, (Object) null);
                }
                str = str + str2 + '\n';
            }
        }
        try {
            FileWriter fileWriter = new FileWriter(vcfFile);
            fileWriter.write(str);
            fileWriter.close();
        } catch (Exception e) {
            Log.i("ShareManger .....  === ", e.getMessage());
        }
    }
}