mattleibow / android.play.expansionlibrary Goto Github PK
View Code? Open in Web Editor NEWMOVED to xamarin/XamarinComponents
Home Page: https://github.com/xamarin/XamarinComponents/tree/master/Android/GoogleAndroidVending
MOVED to xamarin/XamarinComponents
Home Page: https://github.com/xamarin/XamarinComponents/tree/master/Android/GoogleAndroidVending
private const string PrefsFile = "com.android.vending.licensing.ServerManagedPolicy";
Is what you have... am I supposed to update this?
The download database files are updated using the System.Xml libraries. The database file is tiny and the extra overhead of the System.Xml,dll is huge for such a small part.
Consider using Preferences or even plain text/serialization
Inside of "ProecessServerResponse" it looks like only the "VT" is there.
I changed it to this in the else:
this.SetValidityTimestamp(extras.ContainsKey("VT") ? extras["VT"] : DefaultValidityTimestamp);
this.SetRetryUntil(extras.ContainsKey("GT") ? extras["GT"] : DefaultRetryUntil);
this.SetMaxRetries(extras.ContainsKey("GR") ? extras["GR"] : DefaultMaxRetries);
Ahh:
- public static readonly long MillisPerMinute = TimeSpan.FromMinutes(1).Milliseconds;
+ public static readonly long MillisPerMinute = (long)TimeSpan.FromMinutes(1).TotalMilliseconds;
As far as I can see this handles the notifications for you, downloading, paused etc. When exiting the application (fully closing it) the download notification stops but does not clear and is unclearable by the user. So you can end up with a load of them if you repeat.
Is this something I should be handling? As I cannot seem to find how to clear the notification.
Hi Matt, its Ryan from Buzz Interactive.
Thanks for the recent update, it has generally been running smoothly but we have noticed a particular crash which happens occasionally in the Client Marshaller. I have pasted a screenshot and here is the trace:
System.ArgumentException: 'jobject' must not be IntPtr.Zero.
Parameter name: jobject
at Android.Runtime.JNIEnv.CallObjectMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00010] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:187
at Android.OS.Bundle.GetString (string) [0x00034] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.OS.Bundle.cs:818
at ExpansionDownloader.Client.ClientMarshaller/DownloaderServiceConnection.SendMessage (Android.OS.Message) [0x00030] in /Users/ryanpalmer/Documents/Clients/Git_Repos/D/Dogbite/Mutu Android/ExpansionDownloader/Client/ClientMarshaller.cs:225
at Android.OS.ActionHandlerCallback.HandleMessage (Android.OS.Message) [0x00000] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/src/Android.OS/Handler.cs:75
at Android.OS.Handler/ICallbackInvoker.n_HandleMessage_Landroid_os_Message_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.OS.Handler.cs:76
at at (wrapper dynamic-method) object.f77b0410-1841-4cd6-a6e9-ee511fde2dde (intptr,intptr,intptr) <IL 0x00017, 0x0004b>
I tested on android 4.0 Galaxy Nexus.
Got via:
http://developer.android.com/guide/google/play/licensing/adding-licensing.html#manifest-permission
06-26 10:50:12.420 E/ActivityThread(29293): Activity crosspuppy.SplashScreenActivity has leaked ServiceConnection expansiondownloader.client.ClientMarshaller_DownloaderServiceConnection_ServiceConnection@408015f8 that was originally bound here
06-26 10:50:12.420 E/ActivityThread(29293): android.app.ServiceConnectionLeaked: Activity crosspuppy.SplashScreenActivity has leaked ServiceConnection expansiondownloader.client.ClientMarshaller_DownloaderServiceConnection_ServiceConnection@408015f8 that was originally bound here
06-26 10:50:12.420 E/ActivityThread(29293): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:923)
06-26 10:50:12.420 E/ActivityThread(29293): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:818)
06-26 10:50:12.420 E/ActivityThread(29293): at android.app.ContextImpl.bindService(ContextImpl.java:1077)
06-26 10:50:12.420 E/ActivityThread(29293): at android.content.ContextWrapper.bindService(ContextWrapper.java:370)
06-26 10:50:12.420 E/ActivityThread(29293): at crosspuppy.SplashScreenActivity.n_onResume(Native Method)
06-26 10:50:12.420 E/ActivityThread(29293): at crosspuppy.SplashScreenActivity.onResume(SplashScreenActivity.java:47)
06-26 10:50:12.420 E/ActivityThread(29293): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1153)
06-26 10:50:12.420 E/ActivityThread(29293): at android.app.Activity.performResume(Activity.java:4428)
06-26 10:50:12.420 E/ActivityThread(29293): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2217)
06-26 10:50:12.420 E/ActivityThread(29293): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2255)
06-26 10:50:12.420 E/ActivityThread(29293): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1769)
06-26 10:50:12.420 E/ActivityThread(29293): at android.app.ActivityThread.access$1500(ActivityThread.java:122)
06-26 10:50:12.420 E/ActivityThread(29293): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1002)
06-26 10:50:12.420 E/ActivityThread(29293): at android.os.Handler.dispatchMessage(Handler.java:99)
06-26 10:50:12.420 E/ActivityThread(29293): at android.os.Looper.loop(Looper.java:132)
06-26 10:50:12.420 E/ActivityThread(29293): at android.app.ActivityThread.main(ActivityThread.java:4025)
06-26 10:50:12.420 E/ActivityThread(29293): at java.lang.reflect.Method.invokeNative(Native Method)
06-26 10:50:12.420 E/ActivityThread(29293): at java.lang.reflect.Method.invoke(Method.java:491)
06-26 10:50:12.420 E/ActivityThread(29293): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
06-26 10:50:12.420 E/ActivityThread(29293): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
06-26 10:50:12.420 E/ActivityThread(29293): at dalvik.system.NativeStart.main(Native Method)
java.lang.IllegalArgumentException: Service Intent must be explicit: Intent
The following fixes it:
- var i = new Intent(LicensingServiceIntentString)
+ var i = new Intent(LicensingServiceIntentString).SetPackage("com.android.vending");
In LicenseChecker
Tested and working on Android TV.
See:
http://stackoverflow.com/questions/26530565/android-5-0-l-service-intent-must-be-explicit
response by:
milosmns (not officially accepted response)
Remove this exception:
06-26 10:44:09.730 E/ActivityThread(29293): Service crosspuppy.PuppyDownloaderService has leaked ServiceConnection licenseverificationlibrary.LicenseChecker@4080b978 that was originally bound here
06-26 10:44:09.730 E/ActivityThread(29293): android.app.ServiceConnectionLeaked: Service crosspuppy.PuppyDownloaderService has leaked ServiceConnection licenseverificationlibrary.LicenseChecker@4080b978 that was originally bound here
06-26 10:44:09.730 E/ActivityThread(29293): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:923)
06-26 10:44:09.730 E/ActivityThread(29293): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:818)
06-26 10:44:09.730 E/ActivityThread(29293): at android.app.ContextImpl.bindService(ContextImpl.java:1077)
06-26 10:44:09.730 E/ActivityThread(29293): at android.content.ContextWrapper.bindService(ContextWrapper.java:370)
06-26 10:44:09.730 E/ActivityThread(29293): at expansiondownloader.service.DownloaderService_LvlRunnable.n_run(Native Method)
06-26 10:44:09.730 E/ActivityThread(29293): at expansiondownloader.service.DownloaderService_LvlRunnable.run(DownloaderService_LvlRunnable.java:36)
06-26 10:44:09.730 E/ActivityThread(29293): at android.os.Handler.handleCallback(Handler.java:587)
06-26 10:44:09.730 E/ActivityThread(29293): at android.os.Handler.dispatchMessage(Handler.java:92)
06-26 10:44:09.730 E/ActivityThread(29293): at android.os.Looper.loop(Looper.java:132)
06-26 10:44:09.730 E/ActivityThread(29293): at android.app.ActivityThread.main(ActivityThread.java:4025)
06-26 10:44:09.730 E/ActivityThread(29293): at java.lang.reflect.Method.invokeNative(Native Method)
06-26 10:44:09.730 E/ActivityThread(29293): at java.lang.reflect.Method.invoke(Method.java:491)
06-26 10:44:09.730 E/ActivityThread(29293): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
06-26 10:44:09.730 E/ActivityThread(29293): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
06-26 10:44:09.730 E/ActivityThread(29293): at dalvik.system.NativeStart.main(Native Method)
I'm developing a app using xamarin and your plug-in for Google Licensing. And I can't get it to work... I set 3 testers to reply licenced in the developer console ( including myself ) and on those accounts I get NotLicenced response... Even logged in with my publisher account.
this is the code I'm using:
bool internet = Task.Run(CheckNET).Result;
// Construct the LicenseChecker with a policy.
var obfuscator = new AesObfuscator(Salt, this.PackageName, Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId));
var policy = new ServerManagedPolicy(this, obfuscator);
this.checker = new LicenseChecker(this, policy, "Here is my API public key");
if (internet)
{
checker.CheckAccess(this);
}
I've fixed all application error messages in within the first tries (permissions and then NotMarketManaged) and now I'm stuck getting NotLicensed...
So the communication is working, just the License response isn't comming back as it should be for the emails listed in License Testing.
So.. with more testing it a bit strange... I've set ERROR_NON_MATCHING_UID as default response for testers and it did reply that exact error.... but when I changed back to Licensed I got NOT_LICENSED response...
After that it got way stranger... I've played a bit with the response options and this is what responses I got from Google Licensing server:
Google Console set to: -> Server Response:
Licensed -> Not_licensed
Licensed_old_Key -> Not_Licensed
Not_Licensed -> Not_licensed
Error_server_failuere -> LICENSED
Error_contacting_server -> Licensed
Error_invalid_packagename -> InvalidPackageName
error_nonmatching_uid -> NonMatchingUid
so... can anyone explain what is going on? Could the plugin be analysing the codes wrongly?
I've checked the plugin code and this is what I found that it is using these response codes:
Licensed = 0x0,
NotLicensed = 0x1,
LicensedOldKey = 0x2,
NotMarketManaged = 0x3,
ServerFailure = 0x4,
OverQuota = 0x5,
ErrorContactingServer = 0x101,
InvalidPackageName = 0x102,
NonMatchingUid = 0x103
can anyone confirm if these are the correct codes that Google Licensing replies?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.