-
-
Notifications
You must be signed in to change notification settings - Fork 30
Setting up your MainActivity.kt
After you have imported your project successfully, go to the java files and edit MainActivity.kt
, which is located at app/src/main/kotlin/your/package/name/
class MainActivity : KuperActivity() {
/**
* These things here have the default values. You can delete the ones you don't want to change
* and/or modify the ones you want to.
*/
override val billingEnabled = true
override fun amazonInstallsEnabled():Boolean = false
override fun checkLPF():Boolean = true
override fun checkStores():Boolean = true
/**
* This is your app's license key. Get yours on Google Play Dev Console.
* Default one isn't valid and could cause issues in your app.
*/
override fun getLicKey():String? = "MIIBIjANBgkqhkiGgKglYGYGihLuihUuhhuBlouBkuiuBIyvYV"
/**
* This is the license checker code. Feel free to create your own implementation or
* leave it as it is.
* Anyways, keep the 'destroyChecker()' as the very first line of this code block
* Return null to disable license check
*/
override fun getLicenseChecker():PiracyChecker? {
destroyChecker() // Important
return if (BuildConfig.DEBUG) null else super.getLicenseChecker()
}
override val billingEnabled = true
If you plan to provide in-app purchases, keep this function unchanged, otherwise set it to false
.
If it is set to true
, be sure that you enable the required permission in AndroidManifest.xml
Also, if you want to enable donations, you must add your license key too, otherwise they won't work.
override fun amazonInstallsEnabled():Boolean = false
If you plan to distribute your app in the Amazon's Appstore, change this function to true
, instead of false
.
override fun checkLPF():Boolean = true
If you want the License Checker to check whether user has Lucky Patcher installed and prevent him from using your app until he uninstalls it, keep this function unchanged, otherwise set it to false
.
override fun checkStores():Boolean = true
If you want the License Checker to check whether user has installed 3rd party stores that let people download pirated apps (such as Aptoide or BlackMarket) and prevent him from using your app until he uninstalls it, keep this function unchanged, otherwise set it to false
.
override fun getLicKey():String? = "MIIBIjANBgkqhkiGgKglYGYGihLuihUuhhuBlouBkuiuBIyvYV"
If your app is going to be paid, you may want to enable the License Checker. In order to make it work, you need to paste an API key into this function. The API key gets generated by Dev Console right after creating app page. You can find it by going to your app's page (in Dev Console), then click Development tools
tab and you should see a link to Services and APIs
. You can find your API key in this page, then copy it and replace "MIIBIjANBgkqhkiGgKglYGYGihLuihUuhhuBlouBkuiuBIyvYV"
with your key. Don't forget to put it in quotes.
Android Studio may wrongly import a BuildConfig
class from Kuper's default package which will cause a Build Error.
This bad import would look like this
import dev.jahir.kuper.app.BuildConfig
Where it will have a red color. All you have to do to fix this error is change the line above to:
import your.package.name.BuildConfig
and Rebuild your project.
Copyright 2022 by Jahir Fiquitiva. This work is licensed under the CreativeCommons Attribution-ShareAlike 4.0 International License.
This list represents the step-to-step process to setup Kuper. It's organized so it's easier to follow. (Although you can do it in the order you want.)
- First steps
- Setting
build.gradle
up - Setting
AndroidManifest.xml
up - Change app icons
- Setting colors up
- Setting
MainActivity.kt
up - Setting
strings.xml
up - Setting
kuper_setup.xml
up - Setting
frames_setup.xml
up - Setting custom styles
- Adding Zooper widgets
- Adding Kustom assets
- Setting up Credits
- Optimize your wallpapers
- Setting up the wallpapers JSON file
- Enabling notifications
- Update your app's changelog
- Publish your app! 😃
- Update to latest version