Violation of Impersonation policy and i'm getting the message stating remove the metadata that could mislead users - impersonation

I recently made one app and going to published in google console but after an hour i'm getting the message your app is rejected due to violation of impersonation policy.
can someone tell me what does it mean?Is i'm changing the meta-data in my manifest file or change the App's meta-data?what does it meant?Is that meta-data is copyrighted?I'm using the icon of other app Is this is my fault?
please give me solution to this problem i'm in problem or tense by this ,thanks in advance!!
//this is my manifest file
...
<meta-data android:name="io.fabric.ApiKey" android:value="ee23b7943cd81d7bd7b59c0653ac380b2600f9b4" />
</application>
//this is my gradle file
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:+'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'org.adw.library:discrete-seekbar:1.0.1'
implementation 'com.github.glomadrian:MaterialAnimatedSwitch:1.1#aar'
implementation 'com.android.support:cardview-v7:28.+'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
repositories {
maven {url 'https://maven.fabric.io/public'}
}
repositories{
maven {url 'http://dl.bintray.com/glomadrian/maven'}
}
implementation('com.crashlytics.sdk.android:crashlytics:2.6.3#aar'){
transitive = true;
}
This is the message from google

You need to specify that your app will use Google Firebase or something related to crashlytics.

Related

.NET Standard 2.0 logging NLOG gives System.TypeInitializationException

I did 2 projects to test out NLog on a .NET Framework 4.6.1 standard console app and on .NET Standard 2.0 Library. My intention is to port as much code as I can to .NET Standard 2.0 for future multiplatform compatibility.
Both share the same code but the .NET Standard version produces an exception.
Here's the code
Console.WriteLine("Writing log");
Logger _errorLog = LogManager.GetLogger("ErrorsLogger");
Logger _tradesLog = LogManager.GetLogger("TradesLogger");
_errorLog.Error("This is the log message!!!");
Console.WriteLine("End log");
Console.Read();
Here's the App.Config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
</configSections>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="ErrorsLogger" xsi:type="File" fileName="ErrorsLog.txt" />
<target name="TradesLogger" xsi:type="File" fileName="TradesLog.txt" />
</targets>
<rules>
<logger name="ErrorsLogger" minlevel="Info" writeTo="ErrorsLogger" />
<logger name="TradesLogger" minlevel="Info" writeTo="TradesLogger" />
</rules>
</nlog>
</configuration>
I get the log fine in the .NET 4.6.1 Console app and produces the expected log file with the log message in it.
If I run the .NET Standard 2.0 library through some Microsoft Unit Test project I get this exception when it tries to call _errorLog.GetLogger
UnitTestProject.UnitTest1.TestMethod1 threw exception:
System.TypeInitializationException: The type initializer for
'NLog.LogManager' threw an exception. --->
System.TypeInitializationException: The type initializer for
'NLog.LogFactory' threw an exception. --->
System.MissingMethodException: Method not found:
'System.AppDomainSetup System.AppDomain.get_SetupInformation()'.
EDIT:
Nuget NLOG Version: 4.4.12
Exception thrown in a non static method:
About the non static method to get a better exception:
The exception is thrown at the GetLogger("X") level, which is a non static constructor. The initialization routine crashes even before trying to log something.
In addition, I get a WARNING (yellow exclamation mark) in the error list saying:
Warning The 'configuration' element is not declared.
Adding internal logging doesn't produce any output. This is the configuration i have used, starting from their Internal logging guide:
InternalLogger.LogLevel = LogLevel.Trace;
InternalLogger.LogFile = #"C:\temp\int.txt";
InternalLogger.LogToConsole = true;
InternalLogger.LogToConsoleError = true;
InternalLogger.LogWriter = new StringWriter(new StringBuilder());
InternalLogger.LogToTrace = true;
LogManager.ThrowConfigExceptions = true;
LogManager.ThrowExceptions = true;
Logger logger = LogManager.GetLogger("foo");
I'm administrator and Visual Studio 2017 is started as administrator and I have permission to write in C:\temp ad .NET 4.6.1 console application is able to write in that folder and it's in the same project.
The internal log file is empty and the Unit test project runs the test successfully.
I have no clue of what is happening. No error is thrown now.
Any suggestion to debug the issue is welcome.
An ISSUE on GitHub is already opened.
HERE is a test solution that I made to show you (PASSWORD: logging123). Now that I've updated to Nlog 4.5 you will see that the .NET framework solution throws an error trying to get an old version of Nlog (that I've never referenced) and that .NET Core unit test solution works but doesn't produce any file.
I was experiencing the same issue though I was running .NET 4.7. I updated my NLog package from 4.4.12 to 4.5.0-rc04 and it worked. Knowing its pre-release you may want to be cautions about putting it on live environment though.
Your zipped solution is password protected, so now it is just me guessing, but it looks like you are using app.config to hold nlog.config.
Pretty sure app.config are not being used by NetCoreApps. Try to put your Nlog-config in a separate file called nlog.config and make sure it is Copy Always (In Visual Studio File Properties).

Liferay scheduled job fails on missing Liferay's classes

I have a Liferay job written using this guide. I am running liferay-ce-portal-tomcat-7.0-ga3. The job uses DLAppServiceUtil to work with document library.
The job starts exactly as scheduled. But the problem is this exception:
Exception in thread "liferay/scheduler_dispatch-407" java.lang.NoClassDefFoundError: com/liferay/portlet/documentlibrary/service/DLAppServiceUtil
What's wrong?
My pom.xml is:
<!-- ... -->
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<version>7.0.0-nightly</version>
<scope>provided</scope>
</dependency>
<!-- ... -->
My job class is:
public class MyJob implements MessageListener {
#Override
public void receive(Message message) throws MessageListenerException {
// DLAppServiceUtil usage...
}
}
How can I fix it?
In Liferay 7, do not use the serviceUtil classes any more (provided you write an OSGi bundle).
Instead add
#Reference
DLAppService dlAppService;
to your component class. Look up how to make the listener a proper OSGi component. Liferay's blade-samples on github might have a template. I am on my phone which makes it hard to look up&explain everything in more detail.
If this doesn't work (as you indicate in your comment), you'll have to check your build process: Make sure that the plugin's Manifest declares the dependencies that it has on the required service. From this you can see that I'm recommending to build OSGi plugins - I'm assuming that you're not doing this, because OSGi would not start your plugin until the dependencies are resolved.
You can do so by utilizing bnd. Check the numerous Maven examples within the blade-samples for more detail.
The classes are no longer part of portal-service, com.liferay.portal.kernel is the correct artifact.
Weird that IDE doesn't complain...

Azure mobile client 4.0 - how use LoginAsync?

I used azure mobile net client 3.1.0.0. This is my old code in my Android client:
IMobileServiceClient client;
//for Android
//from Microsoft.WindowsAzure.Mobile.Ext
var user = await client.LoginAsync(Forms.Context, provider);
Now I have updated to the new version 4.0. I need authorization with Google account. This is the code I found in the documentation:
IMobileServiceClient client;
var token = new JObject {{"access_token", "access_token_value"}};
user = await client.LoginAsync(provider, token);
How do I get "access_token_value" on client Android?
Please help me. I need a small example or reference to the documentation.
I solved this issue.
1.It was necessary to use this class:
Microsoft.WindowsAzure.MobileServices.MobileServiceClient client;
var user = await client.LoginAsync(Forms.Context, provider, "{url_scheme_of_your_app}");
2.It is necessary to add this to AndroidManifest.xml:
<activity android:name="com.microsoft.windowsazure.mobileservices.authentication.RedirectUrlActivity"
android:launchMode="singleTop" android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="{url_scheme_of_your_app}" android:host="easyauth.callback" />
</intent-filter>
"url_scheme_of_your_app" - text identifier. Ex - "app911";
Add your app to the Allowed External Redirect URLs
Ex. url app911://easyauth.callback
This is example.
According to your description, I created my Xamarin.Android application to test this issue. For Microsoft.Azure.Mobile.Client 4.0.0, I found my project would reference the sdk under the following path:
Microsoft.Azure.Mobile.Client.4.0.0\lib\netstandard1.4\Microsoft.Azure.Mobile.Client.dll
And I would encounter the same issue as you mentioned. Then I tried to downgrade to Microsoft.Azure.Mobile.Client 4.0.0-alpha-001, and I could find the expected extension methods for LoginAsync. At this time, the sdk would under the following path:
Microsoft.Azure.Mobile.Client.4.0.0-alpha-001\lib\monoandroid44\Microsoft.Azure.Mobile.Client.dll
Also, for Azure Mobile Client SDK 3.1.0, the reference path looks like this:
Microsoft.Azure.Mobile.Client.3.1.0\lib\monoandroid\Microsoft.WindowsAzure.Mobile.Ext.dll
After some trials, I found the following sdk supports the extension method for LoginAsync as follows:
C:\Bruce\Thread Handling Projects\Bruce.AndroidApp\packages\Microsoft.Azure.Mobile.Client.4.0.0\lib\monoandroid71
How do I get "access_token_value" on client Android? Please help me. I need a small example or reference to the documentation.
From your old code, I assumed that you are using server-flow authentication, for using server-flow via Microsoft.Azure.Mobile.Client 4.0.0 which supports MonoAndroid >= 7.1, I assumed that you need to upgrade your android version for your xamarin.android project. Or you need to downgrade to the version before 4.0.0. Additionally, you could refer to client-managed flow and server-managed flow.
UPDATE:
After change android version to 7.1, then I could use Microsoft.Azure.Mobile.Client 4.0.0 as follows:
For upgrading to android 7.1, you could refer to here.

PrimeFaces 6 FileUploadFilter configuration with Spring Boot embedded Jetty

org.primefaces.webapp.filter.FileUploadFilter does not registered to my application, unless I define FileUploadFilter explicitly in my spring configuration like;
#Bean
FileUploadFilter fileUploadFilter() {
return new FileUploadFilter();
}
Referring to this question;
If you're however not using JSF 2.2 yet and you can't upgrade it
(should be effortless when already on a Servlet 3.0 compatible
container), then you need to manually register the below PrimeFaces
file upload filter in web.xml (it will parse the multi part request
and fill the regular request parameter map so that FacesServlet can
continue working as usual)
Conversely I have javax.faces in my classpath: org.glassfish:javax.faces:jar:2.2.13:compile. (and mojarra impl)
Should we go manually with this? Or else It can not be detected and registered automatically, we have to register a manual configuration to joinfaces
UPDATE: Actually this is not directly relevant to registration of FileUploadFilter. Embedded jetty in spring-boot does not pick up annotated configurations example of which FacesServlet has a #MultipartConfig annotation. I have opened an issue to spring-boot for that:
https://github.com/spring-projects/spring-boot/issues/6681
https://github.com/spring-projects/spring-boot/issues/6680 will fix the issue. WebServletHandler will pick up #MultipartConfig annotated classes.

How can I use annotations instead of XML to create a custom component tag in embedded Tomcat

Edit: The only technologies required to reproduce this issue are JSF 2.2 and Spring Boot 1.2.1 + Its embedded Tomcat 8.0.5 server. Everything else listed in this question is just to give context on the tech I'm using.
Update #2: Following along with BalusC's thoughts, I ported my sample custom component into a barebones Servlet 3.1 + JSF 2.2 application. You can find the code for it on Github here.
This simple case does not exhibit the issue I'm describing here. The #FacesComponent annotation works. This heavily implies that the problem is being caused either by Spring 4.1.2 or Spring Boot itself. It's getting late, so I'll be investigating this further tomorrow.
TL;DR: I want to use #FacesComponent and its attributes to replace foundation-components-html.taglib.xml and the <component> entry in faces-config.xml
I currently have custom components working in my project using XML definitions. I recently learned that JSF 2.2 introduced a feature which removes the need for XML entirely. I would love to use this, but when I purely use annotations, they are ignored by JSF. Raw tags show up in my HTML.
(i.e. <custom:paragraph></custom:paragraph>)
I have demonstrated this issue in a sandbox of mine I keep hosted on Github. If you want to take a crack at that, I'll explain how at the bottom of this post.
All you need to do is delete foundation-components-html.taglib.xml, and comment out the faces-config.xml entry for <component> and run the application to encounter the issue. I left it in the 'functioning' state so that anyone who wishes to help has an easy, verifiably correct starting point. Just hit up http://localhost:8080
Technologies Used:
Spring Boot 1.2.1
JSF 2.2 via Mojarra 2.2.6
Embedded Tomcat 8.0.5
NOTE: Remember, this setup currently works, but it's running on the taglib and faces-config entries! My question is how to remove these dependencies using the latest features in JSF 2.2
Full Project
Custom Component
package foundation.components;
import java.io.IOException;
import javax.faces.component.FacesComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
/**
* The Paragraph Component
* #author Seth Ellison
*/
#FacesComponent(value=UIParagraph.COMPONENT_TYPE, createTag=true, tagName="paragraph", namespace="http://www.blah.com/components/html")
public class UIParagraph extends UIComponentBase {
public static final String COMPONENT_TYPE = "foundation.components.Paragraph";
private String value;
private String styleClass;
#Override
public void encodeBegin(final FacesContext facesContext) throws IOException {
// Encode Implementation Omitted for Brevity.
}
#Override
public String getFamily() {
return "blah.components.family";
}
// Getters/Setters...
}
Taglib Definition
<facelet-taglib version="2.2"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facelettaglibrary_2_2.xsd">
<namespace>http://www.blah.com/components/html</namespace>
<tag>
<tag-name>paragraph</tag-name>
<component>
<component-type>foundation.components.Paragraph</component-type>
</component>
</tag>
</facelet-taglib>
Faces Config
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2" metadata-complete="false">
<component>
<component-type>foundation.components.Paragraph</component-type>
<component-class>foundation.components.UIParagraph</component-class>
</component>
</faces-config>
XHTML Template (Stripped down for clarity)
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsf="http://xmlns.jcp.org/jsf"
xmlns:custom="http://www.blah.com/components/html">
<head jsf:id="head"></head>
<body jsf:id="body">
<custom:paragraph value="This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique." />
</body>
</html>
If you'd like to run this, the easiest way would be to download the Spring Tool Suite, grab the code from Github, right click the project, and run it as a Spring Boot App. You'll get a connection error when the JPA configuration fires up, because you (likely) aren't running a local MySQL server. Don't worry about this. It's not at all required to visit the index page and check out the tag status. I frequently run the app both with, and without the DB fired up to no ill effect. Lastly, to get PrettyFaces to play nice with Spring Boot, you have to create either a Symbolic Link or a Hard Link from target/classes into WEB-INF/ -- PrettyFaces is coded to look in WEB-INF/classes or WEB-INF/lib when scanning for annotations.
Snippets for BalusC
This function exists in a class which is marked with #Configuration and implements ServletContextAware
#Bean
public ServletListenerRegistrationBean<ConfigureListener> jsfConfigureListener() {
return new ServletListenerRegistrationBean<ConfigureListener>(
new ConfigureListener());
}
Alright, I figured out what was causing the issue.
This morning I sat down to think about the differences between my working Servlet 3.1 version of the code, and the broken Spring Boot version. The main difference was how the code was being run. Embedded server vs. Standalone.
Spring Boot's embedded Tomcat server was the cause.
When I switched my sandbox around in accordance with this answer, everything turned on normally, and my custom components worked purely off of the #FacesComponent annotation!
I figure this has something to do with the way classes are organized post-startup on the embedded server vs. a discrete deploy to the Pivotal Tomcat server. JSF's annotation scanner seems to simply ignore annotations in that case.

Resources