package com.flurry.android;

import java.io.File;
import java.io.FileOutputStream;
import java.util.List;
import java.util.Map;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: /storage/emulated/0/Documents/jadec/sources/com.UBI.A90.WW/dex-files/0.dex */
public final class av implements Runnable {
    private /* synthetic */ String a;
    private /* synthetic */ InstallReceiver b;

    /* JADX INFO: Access modifiers changed from: package-private */
    public av(InstallReceiver installReceiver, String str) {
        this.b = installReceiver;
        this.a = str;
    }

    @Override // java.lang.Runnable
    public final void run() {
        File file;
        File file2;
        File file3;
        String b;
        FileOutputStream fileOutputStream = null;
        fileOutputStream = null;
        List<String> list = null;
        try {
            file = this.b.b;
            File parentFile = file.getParentFile();
            String str = "dir is..." + parentFile.toString();
            if (parentFile.mkdirs() || parentFile.exists()) {
                file2 = this.b.b;
                FileOutputStream fileOutputStream2 = new FileOutputStream(file2);
                try {
                    fileOutputStream2.write(this.a.getBytes());
                    file3 = this.b.b;
                    b = InstallReceiver.b(file3);
                    for (Map.Entry<String, List<String>> entry : InstallReceiver.a(b).entrySet()) {
                        StringBuilder append = new StringBuilder().append("entry: ").append(entry.getKey()).append("=");
                        List<String> value = entry.getValue();
                        append.append(value).toString();
                        list = value;
                    }
                    y.a(fileOutputStream2);
                    fileOutputStream = list;
                } catch (Throwable th) {
                    th = th;
                    fileOutputStream = fileOutputStream2;
                    try {
                        bc.b("InstallReceiver", "", th);
                    } finally {
                        y.a(fileOutputStream);
                    }
                }
            } else {
                bc.b("InstallReceiver", "Unable to create persistent dir: " + parentFile);
            }
        } catch (Throwable th2) {
            th = th2;
        }
    }
}
