105 lines
3.5 KiB
Java
105 lines
3.5 KiB
Java
package c.f.m;
|
|
|
|
import android.os.StrictMode;
|
|
import android.os.Trace;
|
|
import android.util.Log;
|
|
import c.d.b.a.a;
|
|
import com.airbnb.lottie.parser.AnimatableValueParser;
|
|
import com.facebook.soloader.Api18TraceUtils;
|
|
import com.facebook.soloader.SoLoader;
|
|
import java.io.File;
|
|
import java.io.FileInputStream;
|
|
import java.io.IOException;
|
|
import java.util.Arrays;
|
|
/* compiled from: DirectorySoSource */
|
|
public class c extends l {
|
|
public final File a;
|
|
public final int b;
|
|
|
|
public c(File file, int i) {
|
|
this.a = file;
|
|
this.b = i;
|
|
}
|
|
|
|
@Override // c.f.m.l
|
|
public int a(String str, int i, StrictMode.ThreadPolicy threadPolicy) throws IOException {
|
|
return c(str, i, this.a, threadPolicy);
|
|
}
|
|
|
|
public int c(String str, int i, File file, StrictMode.ThreadPolicy threadPolicy) throws IOException {
|
|
File file2 = new File(file, str);
|
|
if (!file2.exists()) {
|
|
StringBuilder P = a.P(str, " not found on ");
|
|
P.append(file.getCanonicalPath());
|
|
Log.d("SoLoader", P.toString());
|
|
return 0;
|
|
}
|
|
StringBuilder P2 = a.P(str, " found on ");
|
|
P2.append(file.getCanonicalPath());
|
|
Log.d("SoLoader", P2.toString());
|
|
if ((i & 1) == 0 || (this.b & 2) == 0) {
|
|
if ((this.b & 1) != 0) {
|
|
boolean z2 = SoLoader.a;
|
|
if (z2) {
|
|
Api18TraceUtils.a("SoLoader.getElfDependencies[", file2.getName(), "]");
|
|
}
|
|
try {
|
|
FileInputStream fileInputStream = new FileInputStream(file2);
|
|
try {
|
|
String[] l0 = AnimatableValueParser.l0(fileInputStream.getChannel());
|
|
if (z2) {
|
|
Trace.endSection();
|
|
}
|
|
StringBuilder L = a.L("Loading lib dependencies: ");
|
|
L.append(Arrays.toString(l0));
|
|
Log.d("SoLoader", L.toString());
|
|
for (String str2 : l0) {
|
|
if (!str2.startsWith("/")) {
|
|
SoLoader.d(str2, null, null, i | 1, threadPolicy);
|
|
}
|
|
}
|
|
} finally {
|
|
fileInputStream.close();
|
|
}
|
|
} catch (Throwable th) {
|
|
if (SoLoader.a) {
|
|
Trace.endSection();
|
|
}
|
|
throw th;
|
|
}
|
|
} else {
|
|
Log.d("SoLoader", "Not resolving dependencies for " + str);
|
|
}
|
|
try {
|
|
((SoLoader.a) SoLoader.b).b(file2.getAbsolutePath(), i);
|
|
return 1;
|
|
} catch (UnsatisfiedLinkError e) {
|
|
if (e.getMessage().contains("bad ELF magic")) {
|
|
Log.d("SoLoader", "Corrupted lib file detected");
|
|
return 3;
|
|
}
|
|
throw e;
|
|
}
|
|
} else {
|
|
Log.d("SoLoader", str + " loaded implicitly");
|
|
return 2;
|
|
}
|
|
}
|
|
|
|
@Override // c.f.m.l
|
|
public String toString() {
|
|
String str;
|
|
try {
|
|
str = String.valueOf(this.a.getCanonicalPath());
|
|
} catch (IOException unused) {
|
|
str = this.a.getName();
|
|
}
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(getClass().getName());
|
|
sb.append("[root = ");
|
|
sb.append(str);
|
|
sb.append(" flags = ");
|
|
return a.y(sb, this.b, ']');
|
|
}
|
|
}
|