Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 578
Remove the obsolete AndroidClientHandler class#11393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
fdc9d89bd17e91695d481552083dff91508afecf6a21c1cbdf5e7f1f88da0230aef2c130aa559d893c52518fb045fc30257451f40File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -16,11 +16,10 @@ public class MarkJavaObjects : BaseMarkHandler | ||
| public override void Initialize (LinkContext context, MarkContext markContext) | ||
| { | ||
| base.Initialize (context, markContext); | ||
| context.TryGetCustomData ("AndroidHttpClientHandlerType", out string androidHttpClientHandlerType); | ||
| context.TryGetCustomData ("AndroidCustomViewMapFile", out string androidCustomViewMapFile); | ||
| var customViewMap = MonoAndroidHelper.LoadCustomViewMapFile (androidCustomViewMapFile); | ||
| markContext.RegisterMarkAssemblyAction (assembly => ProcessAssembly (assembly, androidHttpClientHandlerType, customViewMap)); | ||
| markContext.RegisterMarkAssemblyAction (assembly => ProcessAssembly (assembly, customViewMap)); | ||
| markContext.RegisterMarkTypeAction (type => ProcessType (type)); | ||
| } | ||
| @@ -29,28 +28,16 @@ bool IsActiveFor (AssemblyDefinition assembly) | ||
| if (MonoAndroidHelper.IsFrameworkAssembly (assembly)) | ||
| return false; | ||
| return assembly.MainModule.HasTypeReference ("System.Net.Http.HttpMessageHandler") || | ||
| assembly.MainModule.HasTypeReference ("Java.Lang.Object") || | ||
| return assembly.MainModule.HasTypeReference ("Java.Lang.Object") || | ||
| assembly.MainModule.HasTypeReference ("Android.Util.IAttributeSet"); | ||
| } | ||
| public void ProcessAssembly (AssemblyDefinition assembly, string androidHttpClientHandlerType, Dictionary<string, HashSet<string>> customViewMap) | ||
| public void ProcessAssembly (AssemblyDefinition assembly, Dictionary<string, HashSet<string>> customViewMap) | ||
simonrozsival marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| { | ||
| if (!IsActiveFor (assembly)) | ||
| return; | ||
| foreach (var type in assembly.MainModule.Types) { | ||
| // Custom HttpMessageHandler | ||
| if (!string.IsNullOrEmpty (androidHttpClientHandlerType) && | ||
| androidHttpClientHandlerType.StartsWith (type.Name, StringComparison.Ordinal)) { | ||
| var assemblyQualifiedName = type.GetPartialAssemblyQualifiedName (Context); | ||
| if (assemblyQualifiedName == androidHttpClientHandlerType) { | ||
| Annotations.Mark (type); | ||
| PreservePublicParameterlessConstructors (type); | ||
| continue; | ||
| } | ||
| } | ||
| // Continue if not an IJavaObject | ||
| if (!type.ImplementsIJavaObject (cache)) | ||
| continue; | ||
| @@ -118,21 +105,6 @@ void PreserveJavaObjectImplementation (TypeDefinition type) | ||
| PreserveInterfaces (type); | ||
| } | ||
| void PreservePublicParameterlessConstructors (TypeDefinition type) | ||
| { | ||
| if (!type.HasMethods) | ||
| return; | ||
| foreach (var constructor in type.Methods) | ||
| { | ||
| if (!constructor.IsConstructor || constructor.IsStatic || !constructor.IsPublic || constructor.HasParameters) | ||
| continue; | ||
| PreserveMethod (type, constructor); | ||
| break; // We can stop when found | ||
| } | ||
| } | ||
| void PreserveAttributeSetConstructor (TypeDefinition type) | ||
| { | ||
| if (!type.HasMethods) | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.