导航菜单

页面标题

页面副标题

Minits v4.9.3.32 - TextFileViewerActivity.java 源代码

正在查看: Minits v4.9.3.32 应用的 TextFileViewerActivity.java JAVA 源代码文件

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


package com.xone.android.browser.activities;

import android.app.Activity;
import android.content.Intent;
import android.text.Editable;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import com.xone.android.utils.Utils;
import java.io.File;
import java.io.FileOutputStream;
import java.util.Locale;
import p7.AbstractActivityC2812n;
import r7.e;

public final class TextFileViewerActivity extends AbstractActivityC2812n {

    public File f17902m;

    public String f17903n;

    public EditText f17904o;

    public static String L0(String str) {
        int indexOf;
        String substring;
        int indexOf2;
        if (TextUtils.isEmpty(str) || (indexOf = str.indexOf("encoding=\"")) < 0 || (indexOf2 = (substring = str.substring(indexOf + 10)).indexOf("\"")) < 0) {
            return "UTF-8";
        }
        String substring2 = substring.substring(0, indexOf2);
        return TextUtils.isEmpty(substring2) ? "UTF-8" : substring2;
    }

    public static String M0(File file) {
        String lowerCase;
        int lastIndexOf;
        String name = file.getName();
        return (!TextUtils.isEmpty(name) && (lastIndexOf = (lowerCase = name.toLowerCase(Locale.US)).lastIndexOf(".")) >= 0) ? lowerCase.substring(lastIndexOf + 1) : "";
    }

    public void Q0(View view) {
        try {
            finish();
        } catch (Exception e8) {
            b(e8);
        }
    }

    public static void S0(Activity activity, e eVar) {
        Intent intent = new Intent(activity, (Class<?>) TextFileViewerActivity.class);
        intent.putExtra("file", eVar.c());
        intent.putExtra("encoding", "");
        activity.startActivity(intent);
    }

    public final String N0(byte[] bArr) {
        String O02 = O0(bArr, "UTF-8");
        return !O02.startsWith("<?xml version=") ? "" : O02.substring(0, O02.indexOf("\"?>") + 3);
    }

    public final String O0(byte[] bArr, String str) {
        return new String(bArr, str);
    }

    public final String P0() {
        Editable text = this.f17904o.getText();
        return text == null ? "" : text.toString();
    }

    public final void R0(View view) {
        try {
            byte[] bytes = P0().getBytes(this.f17903n);
            FileOutputStream fileOutputStream = new FileOutputStream(this.f17902m);
            try {
                fileOutputStream.write(bytes);
                Utils.N(fileOutputStream);
                Utils.g4(this, "OK!");
            } catch (Throwable th) {
                Utils.N(fileOutputStream);
                throw th;
            }
        } catch (Exception e8) {
            b(e8);
        }
    }

    @Override
    public void onCreate(android.os.Bundle r5) {
        throw new UnsupportedOperationException("Method not decompiled: com.xone.android.browser.activities.TextFileViewerActivity.onCreate(android.os.Bundle):void");
    }
}