• Stars
    star
    104
  • Rank 330,604 (Top 7 %)
  • Language
    Java
  • Created about 11 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A library to ease implementation of unlock application for your freemium apps

Android Unlocker Library Release

Provides a full system to help you develop Android applications that have a free version and some commercial unlocking application. There is also the flexibility for implementing multiple features to be unlocked by various unlocker applications.

Gradle (via JitPack.io)

  1. add jitpack to your project's build.gradle:
repositories {
	maven { url "https://jitpack.io" }
}
  1. add the compile statement to your module's build.gradle:
dependencies {
        // unlocker app
	implementation 'com.github.marvinlabs.android-unlocker-library:library:1.0.1'
	// main app
	implementation 'com.github.marvinlabs.android-unlocker-library:library-core:1.0.1'
}

Usage

Assumption

  • you have an app with the package com.my.app
  • you want to create an unlocker app with the package com.my.app.unlocker

Adjust those package names accordingly to fit your requirements

The unlocker app

  1. Create an unlocker app. No need to add anything to this project, create a complete empty project (no activities or similar).

  2. Add the correct dependency to this project: implementation 'com.github.marvinlabs.android-unlocker-library:library:1.0.1'

  3. A simply default activity is added to this project by default - define a custom string for unlocker_info_app with your apps name for the unlocker apps info string

  4. Adjust the manifest like following (read the comments for explanations)

     <!-- define the permission -->
     <permission
     	android:name="com.my.app.AUTHORIZATION_PROVIDER"
     	android:protectionLevel="signature" />
    
     <application
     	android:label="@string/app_name"
     	android:allowBackup="true"
     	android:icon="@mipmap/icon"
     	android:roundIcon="@mipmap/icon_round">
    
     	<!-- ************* -->
     	<!-- optional data -->
     	<!-- ************* -->
    
     	<!-- string data - define a feature that you want to check or just leave this meta-data away if you just want to check against the unlocker app at all -->
     	<meta-data
     		android:name="unlocker_app_feature_name"
     		android:value="pro" />
     		
     	<!-- boolean data - set it to true, if you want the unlocker to print it's debug messages, leave it away if not-->
     	<meta-data
     		android:name="unlocker_debug"
     		android:value="true" />
    
     	<!-- ************* -->
     	<!-- required data -->
     	<!-- ************* -->
    
     	<!-- the package name of the app that needs to be unlocked -->
     	<meta-data
     		android:name="unlocker_app_package_name"
     		android:value="com.my.app" />
    
     	<!-- the provider with the correct authority, permission and exported flag -->
     	<provider
     		android:name="fr.marvinlabs.unlocker.core.provider.UnlockerProvider"
     		android:authorities="com.my.app"
     		android:exported="true"
     		android:permission="com.my.app.AUTHORIZATION_PROVIDER" />
    
     </application>
    
  5. you're done, compile the app and you can already use the unlocker app. IMPORTANT: you must sign the unlocker app and the app with the same signature!

The main app

  1. In your app's manifest add following:

     <manifest 
     	<permission
     		android:name="com.my.app.AUTHORIZATION_PROVIDER"
     		android:protectionLevel="signature" />
     		
     </manifest>
    
  2. Add the correct dependency: implementation 'com.github.marvinlabs.android-unlocker-library:library-core:1.0.1'

  3. Check the unlocker state like following:

    3.1 Check if the unlocker app is available

     // If the authority is equal to the apps package name, simply pass the context
     boolean unlockerAppAvailable1 = UnlockerProvider.getPackageLevelAuthorization(context);
     // otherwise pass the package name to check as well
     boolean unlockerAppAvailable2 = UnlockerProvider.getPackageLevelAuthorization(context, "com.my.app");
    

    3.2 Check if the unlocker app with a special feature is available

     // the above written example manifest defines a "unlocker_app_feature_name" with the value "pro", so if we want to check this feature this works like following
     String featureToCheck = "pro"; 
     // If the authority is equal to the apps package name, simply pass the context + feature
     boolean unlockerAppFeatureAvailable1 = UnlockerProvider.getFeatureLevelAuthorization(context, featureToCheck);
     // otherwise pass the package name as well to check as well
     boolean unlockerAppFeatureAvailable2 = UnlockerProvider.getPackageLevelAuthorization(context, "com.my.app", featureToCheck);
    

History

v1.0.1 (2018-02-17)

  • full gradle support added
  • jitpack.io release added
  • simplified usage - setup via app manifest meta-data

v1.0.0 (2013-09-19)

  • Library project added
  • Packaged as a JAR file

License

Copyright 2013 Vincent Mimoun-Prat

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More info

More Repositories

1

android-floatinglabel-widgets

Floating label input widgets
Java
446
star
2

android-intents

A small library which will save you from writing the same intent creation code again and again for the most simple tasks
Java
421
star
3

android-slideshow-widget

A set of widgets to create smooth slideshows with ease.
Java
209
star
4

laravel-setup-wizard

A Laravel package to help you build a web setup wizard for your application
PHP
204
star
5

laravel-discord-logger

Logging to a discord channel in Laravel
PHP
169
star
6

notepad-plus-plus-scss-syntax-highlighting

Add some syntax highlighting with the default CSS settings provided by Notepad++
133
star
7

laravel-luhn

Laravel utilities to ease validation and computation of credit cards, SIREN, etc.
PHP
106
star
8

android-constrained-widgets

Set of Android widgets that will respect a given aspect ratio
Java
43
star
9

laravel-html-bootstrap-4

Bootstrap 4 fluent HTML builder
PHP
42
star
10

android-tutorials-custom-selectable-listview

Source code for our tutorial about how to get checkable rows in a custom ListView
Java
32
star
11

customer-area

A WordPress plugin to offer private content to your users -- MOVED TO https://gitlab.com/wp-customerarea/plugins/customer-area
PHP
31
star
12

acra-server

A server to collect crash data of your android applications
PHP
26
star
13

android-progress-panel

A widget to hold information that can be shown after a task completes
Java
25
star
14

laravel-html-font-awesome

A fluent html builder for Font Awesome icons
PHP
14
star
15

bxslider-for-wordpress

bxSlider for WordPress integrates the cool responsive content slider "bxSlider jQuery plugin" in your very own WordPress site
JavaScript
5
star
16

wpca-twenty-twelve

Sample theme for Customer Area developers -- MOVED TO https://gitlab.com/wp-customerarea/themes/wpca-twenty-twelve/
PHP
4
star
17

wpca-translations

Translation files for add-ons to WP Customer Area plugin -- MOVED to https://gitlab.com/wp-customerarea/tools/wpca-translations/
3
star
18

wpca-products-build-environment

Our developer environment to help building add-ons and contributing to the plugin -- MOVED TO https://gitlab.com/wp-customerarea/tools/wpca-products-build-environment
PHP
3
star
19

acra-bug-generator

A simple android application to create crashes for testing your ACRA backend
Java
2
star
20

jquery.hoverme

A jQuery plugin for cool sliding boxes
JavaScript
1
star
21

grunt-wpca

Grunt plugin to ease WP Customer Area development
JavaScript
1
star
22

wordpress-project-starter

A basic structure to easily start a WordPress project
PHP
1
star