Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/Xamarin.Android.Build.Tasks/Resources/MonoPackageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static void LoadApplication (Context context, ApplicationInfo runtimePack
);
context.registerReceiver (new mono.android.app.NotifyTimeZoneChanges (), timezoneChangedFilter);

preloadAppNativeLibraries(context);
System.loadLibrary("monodroid");
Locale locale = Locale.getDefault ();
String language = locale.getLanguage () + "-" + locale.getCountry ();
Expand Down Expand Up @@ -79,6 +80,27 @@ static String getNativeLibraryPath (ApplicationInfo ainfo)
return ainfo.dataDir + "/lib";
}

static void preloadAppNativeLibraries(Context context) {
InputStream assetStream = null;
try {
assetStream = context.getAssets().open("ld_preload.txt");
BufferedReader reader = new BufferedReader(new InputStreamReader(assetStream));

String lib = null;
while ((lib = reader.readLine()) != null) {
try {
System.loadLibrary(lib);
} catch (Throwable t) {
Log.e("MonoPackageManager", "OOPS : " + t);
}
}
} catch (Throwable t) {

} finally {
try { assetStream.close(); } catch (Throwable t2) { }
}
}

public static String[] getAssemblies ()
{
return MonoPackageManager_Resources.Assemblies;
Expand Down