[tuner] Properly preserve AesCryptoServiceProvider.
[merged by rodo from monodroid - the mentioned test is not included here]
Fixes: https://xamarin.desk.com/agent/case/35534
Commit
5ca3cb4b wasn't propertly tested (doh!).
The problem with Aes and AesCryptoServiceProvider is that there's a
cross-assembly dependency: Aes is in mscorlib, while
AesCryptoServiceProvider is in System.Core. The
PreserveCrypto.ProcessSystemCore() method didn't properly handle this
setup.
Fix the linker, and add a test to Hello.
WARNING: The test sucks. In particular, to "test" this fix you need to
run the app and then grep the `adb logcat` output for:
# DownloadDataTaskAsync complete; status=RanToCompletion; exception=
If the status is anything else, or the exception is non-null, it's
busted.
FURTHERMORE, it's only useful in Release apps, not Debug apps.
(No linker in Debug apps.)
The reason for the need to grep is that there's no sane mechanism to
wait until the Task has completed before checking the status of the
Task, and throwing an exception from within the continuation wouldn't
do anything.
FIXME: The real problem is that Task.Wait() blocks forever and never
returns. This needs further investigation.
https://bugzilla.xamarin.com/show_bug.cgi?id=12681