package ye;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import xyz.netfly.ui.log.LocalLogActivity;
import xyz.stream.utils.h;
import xyz.stream.view.UiUtils;

/* JADX INFO: loaded from: classes3.dex */
public final /* synthetic */ class a implements Runnable {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f36972a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ LocalLogActivity f36973b;

    public /* synthetic */ a(LocalLogActivity localLogActivity, int i10) {
        this.f36972a = i10;
        this.f36973b = localLogActivity;
    }

    @Override // java.lang.Runnable
    public final void run() {
        BufferedReader bufferedReader;
        int i10;
        int i11 = this.f36972a;
        int i12 = 1;
        LocalLogActivity localLogActivity = this.f36973b;
        switch (i11) {
            case 0:
                int i13 = LocalLogActivity.f35494f;
                localLogActivity.getClass();
                try {
                    StringBuilder sb = new StringBuilder();
                    sb.append(localLogActivity.getCacheDir().getAbsolutePath());
                    i10 = 2;
                    sb.append(localLogActivity.getIntent().getIntExtra("logType", 1) == 2 ? "/logs/sdk.log" : "/logs/video.log");
                    bufferedReader = new BufferedReader(new FileReader(sb.toString()), 16384);
                } catch (Exception e10) {
                    h.c(e10.getMessage());
                    return;
                }
                while (true) {
                    int i14 = 0;
                    do {
                        try {
                            String line = bufferedReader.readLine();
                            ArrayList arrayList = localLogActivity.f35499e;
                            if (line == null) {
                                if (!arrayList.isEmpty()) {
                                    localLogActivity.runOnUiThread(new a(localLogActivity, i10));
                                    break;
                                }
                                bufferedReader.close();
                                return;
                            }
                            arrayList.add(line);
                            i14++;
                        } finally {
                            try {
                                break;
                            } catch (Throwable th) {
                            }
                        }
                        h.c(e10.getMessage());
                        return;
                    } while (i14 < 100);
                    localLogActivity.runOnUiThread(new a(localLogActivity, i12));
                }
                break;
            case 1:
                localLogActivity.f35498d.notifyDataSetChanged();
                return;
            default:
                localLogActivity.f35498d.notifyDataSetChanged();
                localLogActivity.f35497c.f27167c.scrollToPosition(localLogActivity.f35498d.getItemCount() - 1);
                UiUtils.dismissProgressDialog();
                return;
        }
    }
}
