CrackMe.apk
Download file
package com.facebook.soloader;
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;
import java.util.Collection;
import javax.annotation.Nullable;
public class ApplicationSoSource extends SoSource {
private Context applicationContext;
private int flags;
private DirectorySoSource soSource;
public ApplicationSoSource(Context context, int i) {
Context applicationContext2 = context.getApplicationContext();
this.applicationContext = applicationContext2;
if (applicationContext2 == null) {
Log.w("SoLoader", "context.getApplicationContext returned null, holding reference to original context.ApplicationSoSource fallbacks to: " + context.getApplicationInfo().nativeLibraryDir);
this.applicationContext = context;
}
this.flags = i;
this.soSource = new DirectorySoSource(new File(this.applicationContext.getApplicationInfo().nativeLibraryDir), i);
}
public boolean checkAndMaybeUpdate() throws IOException {
File file = this.soSource.soDirectory;
Context updatedContext = getUpdatedContext();
File nativeLibDirFromContext = getNativeLibDirFromContext(updatedContext);
if (file.equals(nativeLibDirFromContext)) {
return false;
}
Log.d("SoLoader", "Native library directory updated from " + file + " to " + nativeLibDirFromContext);
int i = this.flags | 1;
this.flags = i;
DirectorySoSource directorySoSource = new DirectorySoSource(nativeLibDirFromContext, i);
this.soSource = directorySoSource;
directorySoSource.prepare(this.flags);
this.applicationContext = updatedContext;
return true;
}
public Context getUpdatedContext() {
try {
Context context = this.applicationContext;
return context.createPackageContext(context.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
throw new RuntimeException(e);
}
}
public static File getNativeLibDirFromContext(Context context) {
return new File(context.getApplicationInfo().nativeLibraryDir);
}
public int loadLibrary(String str, int i, StrictMode.ThreadPolicy threadPolicy) throws IOException {
return this.soSource.loadLibrary(str, i, threadPolicy);
}
@Nullable
public File getSoFileByName(String str) throws IOException {
return this.soSource.getSoFileByName(str);
}
@Nullable
public String getLibraryPath(String str) throws IOException {
return this.soSource.getLibraryPath(str);
}
@Nullable
public String[] getLibraryDependencies(String str) throws IOException {
return this.soSource.getLibraryDependencies(str);
}
@Nullable
public File unpackLibrary(String str) throws IOException {
return this.soSource.unpackLibrary(str);
}
/* access modifiers changed from: protected */
public void prepare(int i) throws IOException {
this.soSource.prepare(i);
}
public void addToLdLibraryPath(Collection<String> collection) {
this.soSource.addToLdLibraryPath(collection);
}
public String toString() {
return this.soSource.toString();
}
}
Download file