diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 7153a53..b022a3d 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -3,8 +3,8 @@ + android:versionCode="77" + android:versionName="4.0.9a" > diff --git a/src/acr/browser/lightning/AdBlock.java b/src/acr/browser/lightning/AdBlock.java index ae3286d..0806cfc 100644 --- a/src/acr/browser/lightning/AdBlock.java +++ b/src/acr/browser/lightning/AdBlock.java @@ -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(); diff --git a/src/acr/browser/lightning/BrowserActivity.java b/src/acr/browser/lightning/BrowserActivity.java index 96cc433..83ae1e2 100644 --- a/src/acr/browser/lightning/BrowserActivity.java +++ b/src/acr/browser/lightning/BrowserActivity.java @@ -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) { diff --git a/src/acr/browser/lightning/Constants.java b/src/acr/browser/lightning/Constants.java index 95a2b33..5a4aa9f 100644 --- a/src/acr/browser/lightning/Constants.java +++ b/src/acr/browser/lightning/Constants.java @@ -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; diff --git a/src/acr/browser/lightning/SettingsActivity.java b/src/acr/browser/lightning/SettingsActivity.java index d4317de..d286a28 100644 --- a/src/acr/browser/lightning/SettingsActivity.java +++ b/src/acr/browser/lightning/SettingsActivity.java @@ -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 { 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);