Browse Source

Use boolean constant to make free/plus builds easier to generate

master
Anthony Restaino 10 years ago
parent
commit
4fb1a50f03
  1. 4
      AndroidManifest.xml
  2. 2
      src/acr/browser/lightning/AdBlock.java
  3. 5
      src/acr/browser/lightning/BrowserActivity.java
  4. 2
      src/acr/browser/lightning/Constants.java
  5. 2
      src/acr/browser/lightning/SettingsActivity.java

4
AndroidManifest.xml

@ -3,8 +3,8 @@ @@ -3,8 +3,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="acr.browser.lightning"
android:versionCode="76"
android:versionName="4.0.8a" >
android:versionCode="77"
android:versionName="4.0.9a" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />

2
src/acr/browser/lightning/AdBlock.java

@ -30,7 +30,7 @@ public class AdBlock { @@ -30,7 +30,7 @@ public class AdBlock {
}
private AdBlock(Context context) {
if (mBlockedDomainsList.isEmpty()) {
if (mBlockedDomainsList.isEmpty() && Constants.FULL_VERSION) {
loadBlockedDomainsList(context);
}
mBlockAds = PreferenceManager.getInstance().getAdBlockEnabled();

5
src/acr/browser/lightning/BrowserActivity.java

@ -1135,6 +1135,11 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll @@ -1135,6 +1135,11 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
}
protected synchronized boolean newTab(String url, boolean show) {
// Limit number of tabs for limited version of app
if (!Constants.FULL_VERSION && mWebViews.size() >= 10) {
Utils.showToast(this, this.getString(R.string.max_tabs));
return false;
}
mIsNewIntent = false;
LightningView startingTab = new LightningView(mActivity, url, mDarkTheme);
if (mIdGenerator == 0) {

2
src/acr/browser/lightning/Constants.java

@ -10,6 +10,8 @@ public final class Constants { @@ -10,6 +10,8 @@ public final class Constants {
private Constants() {
}
public static final boolean FULL_VERSION = true;
public static final String DESKTOP_USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36";
public static final String MOBILE_USER_AGENT = "Mozilla/5.0 (Linux; U; Android 4.4; en-us; Nexus 4 Build/JOP24G) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30";
public static final int API = android.os.Build.VERSION.SDK_INT;

2
src/acr/browser/lightning/SettingsActivity.java

@ -61,6 +61,7 @@ public class SettingsActivity extends ThemableSettingsActivity { @@ -61,6 +61,7 @@ public class SettingsActivity extends ThemableSettingsActivity {
// initialize UI
RelativeLayout layoutFlash = (RelativeLayout) findViewById(R.id.layoutFlash);
RelativeLayout layoutBlockAds = (RelativeLayout) findViewById(R.id.layoutAdBlock);
layoutBlockAds.setEnabled(Constants.FULL_VERSION);
RelativeLayout layoutImages = (RelativeLayout) findViewById(R.id.layoutImages);
RelativeLayout layoutEnableJS = (RelativeLayout) findViewById(R.id.layoutEnableJS);
RelativeLayout layoutOrbot = (RelativeLayout) findViewById(R.id.layoutUseOrbot);
@ -85,6 +86,7 @@ public class SettingsActivity extends ThemableSettingsActivity { @@ -85,6 +86,7 @@ public class SettingsActivity extends ThemableSettingsActivity {
CheckBox flash = (CheckBox) findViewById(R.id.cbFlash);
CheckBox adblock = (CheckBox) findViewById(R.id.cbAdblock);
adblock.setEnabled(Constants.FULL_VERSION);
CheckBox images = (CheckBox) findViewById(R.id.cbImageBlock);
CheckBox enablejs = (CheckBox) findViewById(R.id.cbJavascript);
CheckBox orbot = (CheckBox) findViewById(R.id.cbOrbot);

Loading…
Cancel
Save