discord-jadx/app/src/main/java/c/f/m/b.java

71 lines
2.0 KiB
Java

package c.f.m;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.StrictMode;
import android.util.Log;
import java.io.File;
import java.io.IOException;
/* compiled from: ApplicationSoSource */
public class b extends l {
public Context a;
public int b;
/* renamed from: c reason: collision with root package name */
public c f509c;
public b(Context context, int i) {
Context applicationContext = context.getApplicationContext();
this.a = applicationContext;
if (applicationContext == null) {
Log.w("SoLoader", "context.getApplicationContext returned null, holding reference to original context.");
this.a = context;
}
this.b = i;
this.f509c = new c(new File(this.a.getApplicationInfo().nativeLibraryDir), i);
}
public static File d(Context context) {
return new File(context.getApplicationInfo().nativeLibraryDir);
}
@Override // c.f.m.l
public int a(String str, int i, StrictMode.ThreadPolicy threadPolicy) throws IOException {
return this.f509c.a(str, i, threadPolicy);
}
@Override // c.f.m.l
public void b(int i) throws IOException {
this.f509c.b(i);
}
public boolean c() throws IOException {
File file = this.f509c.a;
Context e = e();
File d = d(e);
if (file.equals(d)) {
return false;
}
Log.d("SoLoader", "Native library directory updated from " + file + " to " + d);
int i = this.b | 1;
this.b = i;
this.f509c = new c(d, i);
this.a = e;
return true;
}
public Context e() {
try {
Context context = this.a;
return context.createPackageContext(context.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
throw new RuntimeException(e);
}
}
@Override // c.f.m.l
public String toString() {
return this.f509c.toString();
}
}