Skip to content

Commit

Permalink
Added a custom_rules.xml that will a) include the version in the APK …
Browse files Browse the repository at this point in the history
…filename b) create an assets/build.properties file that contains compile time options (given to ant via commandline properties). The default is now to build an APK for sideloading. The playstore.txt file is now retired.
  • Loading branch information
onyxbits committed Jan 5, 2013
1 parent 06ac495 commit 2bd444d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -14,3 +14,4 @@ libs/*
compiled/
compiled/*
local.properties
assets/build.properties
2 changes: 0 additions & 2 deletions assets/playstore.txt

This file was deleted.

30 changes: 20 additions & 10 deletions src/de/onyxbits/pocketbandit/SlotMachine.java
Expand Up @@ -7,6 +7,8 @@
import com.badlogic.gdx.graphics.g2d.*;
import com.badlogic.gdx.graphics.*;

import java.util.*;

import de.onyxbits.bureauengine.*;
import de.onyxbits.bureauengine.util.*;
import de.onyxbits.bureauengine.audio.*;
Expand All @@ -30,18 +32,26 @@ protected void bootGame() {
loader=new Loader(prefs);
loader.rescan();
linkHandler = new LinkHandler();

if (Gdx.files.internal("playstore.txt").exists()) {
trialPeriod = new TrialPeriod(prefs,"trial.count","trial.first","trial.state");
if (trialPeriod.getState()==TrialPeriod.UNKNOWN) {
// First launch -> set the trial active
trialPeriod.setState(TrialPeriod.INPROGRESS);
}
if ( (trialPeriod.getState() & TrialPeriod.ENDED) != TrialPeriod.ENDED) {
// We only count when the period is not over.
trialPeriod.trialed();

try {
Properties prop = new Properties();
prop.load(Gdx.files.internal("build.properties").read(512));
if (prop.getProperty("dist.channel").equals("googleplay")) {
trialPeriod = new TrialPeriod(prefs,"trial.count","trial.first","trial.state");
if (trialPeriod.getState()==TrialPeriod.UNKNOWN) {
// First launch -> set the trial active
trialPeriod.setState(TrialPeriod.INPROGRESS);
}
if ( (trialPeriod.getState() & TrialPeriod.ENDED) != TrialPeriod.ENDED) {
// We only count when the period is not over.
trialPeriod.trialed();
}
}
}
catch (Exception e) {
// Don't care
Gdx.app.error("PocketBandit","No build.properties?",e);
}
}

protected Preferences createPreferences() {
Expand Down

0 comments on commit 2bd444d

Please sign in to comment.