Xamarin/Android resources-file has refs to Xamarin.Auth - xamarin.forms

Hmmm I bit confusing problem, hard to explain, but here goes.
I have a Xamarin Forms (.Net Standard 2.0)-project that happens to use "Xamarin.Auth"-NuGet package to do facebook-login, so thats why Im using Xamarin.Auth... Now to my problem.
This all started with that I VS didnt seem to find Resources.Id.toolbar. I looked in the resources-file and see what I only can interpret as a bug in the generation of the resources-file. There are a lot of references/definitions to Xamarin.Auth. I dont know what sense it would make to have for example
global::Xamarin.Auth.Resource.Animation.slide_out_left = global::MyProj.Droid.Resource.Animation.slide_out_left;
This is part of my Resources.designer.cs-file
public partial class Resource
{
static Resource()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
public static void UpdateIdValues()
{
global::Xamarin.Auth.Resource.Animation.slide_in_right = global::MyProj.Droid.Resource.Animation.slide_in_right;
global::Xamarin.Auth.Resource.Animation.slide_out_left = global::MyProj.Droid.Resource.Animation.slide_out_left;
global::Xamarin.Auth.Resource.Attribute.font = global::MyProj.Droid.Resource.Attribute.font;
global::Xamarin.Auth.Resource.Attribute.fontProviderAuthority = global::MyProj.Droid.Resource.Attribute.fontProviderAuthority;
global::Xamarin.Auth.Resource.Attribute.fontProviderCerts = global::MyProj.Droid.Resource.Attribute.fontProviderCerts;
global::Xamarin.Auth.Resource.Attribute.fontProviderFetchStrategy = global::MyProj.Droid.Resource.Attribute.fontProviderFetchStrategy;
...
Anyone knows if this would be related to that I cant find Resource.Ids.toolbar or how to not mix in Xamarin.Auth when creating the resource-file?

Related

Process to find camera pointer in a game using cheat engine?

I am trying to find out how to get a mouse working inside RPCS3 emulator for a game (Ghost Recon Future Soldier with patch 1.05)
There is a library that supports injecting the mouse but doesn't support the game I am trying to play. After a lot of digging, I found a library that actually implements mouse injection in a few games.
Sample implementation for the KillZone3 game to support mouse injection looks like this in C#
using KAMI.Core.Cameras;
using KAMI.Core.Utilities;
using System;
namespace KAMI.Core.Games
{
public class Killzone2PS3 : Game<HVecVACamera>
{
DerefChain m_hor;
DerefChain m_vert;
public Killzone2PS3(IntPtr ipc, string version) : base(ipc)
{
uint baseAddress = version switch
{
"01.01" => 0x117e740 + 0x234,
"01.29" => 0x11B0540 + 0x234,
_ => throw new NotImplementedException($"{nameof(Killzone2PS3)} [v'{version}'] is not implemented"),
};
var baseChain = DerefChain.CreateDerefChain(ipc, baseAddress, 0x0);
m_vert = baseChain.Chain(0x80).Chain(0x5c).Chain(0x11c).Chain(0x78);
m_hor = baseChain.Chain(0x78).Chain(0x0).Chain(0x68).Chain(0xc).Chain(0x90);
}
public override void UpdateCamera(int diffX, int diffY)
{
if (DerefChain.VerifyChains(m_hor, m_vert))
{
m_camera.HorY = IPCUtils.ReadFloat(m_ipc, (uint)m_hor.Value);
m_camera.HorX = IPCUtils.ReadFloat(m_ipc, (uint)(m_hor.Value + 4));
m_camera.Vert = IPCUtils.ReadFloat(m_ipc, (uint)m_vert.Value);
m_camera.Update(diffX * SensModifier, -diffY * SensModifier);
IPCUtils.WriteFloat(m_ipc, (uint)m_hor.Value, m_camera.HorY);
IPCUtils.WriteFloat(m_ipc, (uint)(m_hor.Value + 4), m_camera.HorX);
IPCUtils.WriteFloat(m_ipc, (uint)m_vert.Value, m_camera.Vert);
}
}
}
}
Main lines in the above program are those addresses which I believe are associated with the camera pointer stored in memory obtained mostly with Cheat Engine.
What is the process required to find these pointers for my game. I am aware that is may be different for each game but I could really use some direction here. Where do I start? How do I narrow down till I arrive at this pointer
What a coincidence, I am also doing the exact same thing on RPCS3 right now. After digging around I've found some videos that discuss into how to use Cheat Engine to find where a player's position and camera would be stored. It involves making a lot of separate scans in Cheat Engine to search for unknown values that are increasing/decreasing.
This video seems to be the closest thing to what you are looking for:
https://www.youtube.com/watch?v=yAl_6qg6ZnA
You should also make sure you set up Cheat Engine so it works with RPCS3 correctly as shown here:
https://exvsfbce.home.blog/2019/08/24/basic-cheat-engine-setup-on-rpcs3/
After you've found the correct pointer for the camera it should be fairly easy to implement it into the library by making your own class in the Games folder.

Caliburn.Micro multiple element custom Conventions (NumericUpDown.Value,NumericUpDown.Maximum)

I've been messing around with CM conventions trying to understand how they work but i haven't found a decent article somewhere explaining step-by-step how and why.
However I've found a few code snippets that i've been working with with some success.
In this case, however, i don't understand what is going on.
I'm trying to bind a NumericUpDown Value and Maximum to a corresponding ViewModel property. I was able to do it with the following code:
Value
ConventionManager.AddElementConvention<NumericUpDown>(NumericUpDown.ValueProperty, "Value", "ValueChanged");
Maximum
ConventionManager.AddElementConvention<NumericUpDown>(NumericUpDown.MaximumProperty, "Maximum", "MaximumChanged");
var baseBindProperties = ViewModelBinder.BindProperties;
ViewModelBinder.BindProperties =
(frameWorkElements, viewModels) =>
{
foreach (var frameworkElement in frameWorkElements)
{
var propertyName = frameworkElement.Name + "Max";
var property = viewModels.GetPropertyCaseInsensitive(propertyName);
if (property != null)
{
var convention = ConventionManager.GetElementConvention(typeof(NumericUpDown));
ConventionManager.SetBindingWithoutBindingOverwrite(
viewModels,
propertyName,
property,
frameworkElement,
convention,
convention.GetBindableProperty(frameworkElement));
}
}
return baseBindProperties(frameWorkElements, viewModels);
};
However, an here comes the weird part, i can only make one of them to work. That makes me believe that i'm doing some noob mistake somewhere. It almost seems i can only call AddElementConvention and therefor only the last call is executed.
I would appreciate either a help with this piece of code or a reference to some good documentation that could help me with it.
Best Regards
i found out somewhere that CM only allows one convention per item so that's the reason of this behavior...
However since items like ComboBox allows binding for multiple properties (SelectedItem, ItemSource and so on...) i'm not completed convinced...

How to override the NSPersistentStoreCoordinator in UIManagedDocument

I have an application that uses Core Data through UIManagedObjectDocument. I am trying to add encryption to the underlying SQLite database by using Encrypted Core Data (https://github.com/project-imas/encrypted-core-data). From the description for ECD, I need to create a new type of NSPersistentSroreCoordinator. However, I cannot seem to do this with a UIManagedObjectDocument since it creates its own internal NSPersistenStoreCoordinator (which s marked private).
I create the database with this line:
UIManagedDocument* managedDoc = [[UIManagedDocument alloc] initWithFileURL:url];
I tried subclassing UIManagedDocument and creating it this way with no luck:
UIManagedDocument* managedDoc = [[EncryptedManagedDocument alloc] initWithFileURL:url];
And my implementation of the class:
#interface EncryptedManagedDocument()
#property (nonatomic,retain,readonly) NSPersistentStoreCoordinator *encryptedStoreCoordinator;
#end
#implementation EncryptedManagedDocument
#synthesize encryptedStoreCoordinator = _encryptedStoreCoordinator;
-(NSPersistentStoreCoordinator*)encryptedStoreCoordinator
{
if (_encryptedStoreCoordinator)
return _encryptedStoreCoordinator;
_encryptedStoreCoordinator = [EncryptedStore makeStore:[self managedObjectModel]:#"SOME_PASSCODE"];
return _encryptedStoreCoordinator;
}
-(NSPersistentStoreCoordinator*)persistentStoreCoordinator
{
return self.encryptedStoreCoordinator;
}
#end
Does anyone know the right way to do this?
Thanks!
I'm going to say this is not possible. UIManagedDocument wraps things up nicely and is a great time saver for the common case, but to enable my scenario I created an EncryptedManagedDocument class that is similar to UIManagedDocument but gave me control to create my own persistent store coordinator.
Thanks, everyone.

Microsoft Speech Recognition in webservices is not returning the result

Well i'm using Microsoft Speech Platform SDK 10.2.
I made a asp.Net WebService application and most of the WebServices works fine (HelloWorld(), etc...), but I have one service that uses the SpeechRecognitionEngine and when I deploy the application and try to run this webservice I get no result, i.e, I can see through the debug mode that it reaches the return line, but when I call it trought the browser the page keeps loading for ever, without any response.
Here's a sample of the code:
[WebMethod]
public bool voiceRecognition() {
SpeechRecognitionEngine sre = new SpeechRecognitionEngine(new System.Globalization.CultureInfo("pt-PT"));
Choices c = new Choices();
c.Add("test");
GrammarBuilder gb = new GrammarBuilder();
gb.Append(c);
Grammar g = new Grammar(gb);
sre.LoadGrammar(g);
sre.InitialSilenceTimeout = TimeSpan.FromSeconds(5);
//// just for Testing
RecognitionResult result = null;
if (result != null) {
return true;
} else {
return false;
}
}
Note: I'm using IIS to deploy the WebService Application.
If someone have some thoughts please let me know.
I don't know if you've found your answer or not. When trying to solve this myself a couple of days ago, I stumbled across your question and it matched our circumstances to a "T".
In order to fix it all we had to do was put...
sre.RecognizeAsyncStop();
sre.Dispose();
where "sre" is your SpeechRecognitionEngine variable. If you don't stop it and dispose of it at the end of your web service then the web service won't return.
Hope this helps. :)

Javascript permission denied error when using Atalasoft DotImage

Have a real puzzler here. I'm using Atalasoft DotImage to allow the user to add some annotations to an image. When I add two annotations of the same type that contain text that have the same name, I get a javascript permission denied error in the Atalasoft's compressed js. The error is accessing the style member of a rule:
In the debugger (Visual Studio 2010 .Net 4.0) I can access
h._rule
but not
h._rule.style
What in javascript would cause permission denied when accessing a membere of an object?
Just wondering if anyone else has encountered this. I see several people using Atalasoft on SO and I even saw a response from someone with Atalasoft. And yes, I'm talking to them, but it never hurts to throw it out to the crowd. This only happens in IE8, not FireFox.
Thanks, Brian
Updates: Yes, using latest version: 9.0.2.43666
By same name (see comment below) I mean, I created default annotations and they are named so they can be added with javascript later.
// create a default annotation
TextData text = new TextData();
text.Name = "DefaultTextAnnotation";
text.Text = "Default Text Annotation:\n double-click to edit";
//text.Font = new AnnotationFont("Arial", 12f);
text.Font = new AnnotationFont(_strAnnotationFontName, _fltAnnotationFontSize);
text.Font.Bold = true;
text.FontBrush = new AnnotationBrush(Color.Black);
text.Fill = new AnnotationBrush(Color.Ivory);
text.Outline = new AnnotationPen(new AnnotationBrush(Color.White), 2);
WebAnnotationViewer1.Annotations.DefaultAnnotations.Add(text);
In javascript:
CreateAnnotation('TextData', 'DefaultTextAnnotation');
function CreateAnnotation(type, name) {
SetAnnotationModified(true);
WebAnnotationViewer1.DeselectAll();
var ann = WebAnnotationViewer1.CreateAnnotation(type, name);
WebThumbnailViewer1.Update();
}
There was a bug in an earlier version that allowed annotations to be saved with the same unique id's. This generally doesn't cause problems for any annotations except for TextAnnotations, since they use the unique id to create a CSS class for the text editor. CSS doesn't like having two or more classes defined by the same name, this is what causes the "Permission denied" error.
You can remove the unique id's from the annotations without it causing problems. I have provided a few code snippets below that demonstrate how this can be done. Calling ResetUniques() after you load the annotation data (on the server side) should make everything run smoothly.
-Dave C. from Atalasoft
protected void ResetUniques()
{
foreach (LayerAnnotation layerAnn in WebAnnotationViewer1.Annotations.Layers)
{
ResetLayer(layerAnn.Data as LayerData);
}
}
protected void ResetLayer(LayerData layer)
{
ResetUniqueID(layer);
foreach (AnnotationData data in layer.Items)
{
LayerData group = data as LayerData;
if (group != null)
{
ResetLayer(data as LayerData);
}
else
{
ResetUniqueID(data);
}
}
}
protected void ResetUniqueID(AnnotationData data)
{
data.SetExtraProperty("_atalaUniqueIndex", null);
}

Resources