2015-12-30 08:58:21 +00:00
|
|
|
package eu.faircode.netguard;
|
|
|
|
|
|
|
|
/*
|
|
|
|
This file is part of NetGuard.
|
|
|
|
|
|
|
|
NetGuard is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
NetGuard is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with NetGuard. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2016-12-29 08:27:58 +00:00
|
|
|
Copyright 2015-2017 by Marcel Bokhorst (M66B)
|
2015-12-30 08:58:21 +00:00
|
|
|
*/
|
|
|
|
|
2016-02-18 08:16:18 +00:00
|
|
|
import android.app.PendingIntent;
|
2015-12-30 08:58:21 +00:00
|
|
|
import android.content.Intent;
|
2015-12-31 09:03:32 +00:00
|
|
|
import android.os.Build;
|
2015-12-30 08:58:21 +00:00
|
|
|
import android.os.Bundle;
|
2016-02-02 08:01:04 +00:00
|
|
|
import android.support.v4.app.NavUtils;
|
2015-12-30 08:58:21 +00:00
|
|
|
import android.support.v7.app.AppCompatActivity;
|
2015-12-31 09:03:32 +00:00
|
|
|
import android.text.Editable;
|
|
|
|
import android.text.TextWatcher;
|
2016-01-21 13:33:19 +00:00
|
|
|
import android.text.util.Linkify;
|
2015-12-30 08:58:21 +00:00
|
|
|
import android.util.Log;
|
|
|
|
import android.view.MenuItem;
|
|
|
|
import android.view.View;
|
2015-12-31 09:03:32 +00:00
|
|
|
import android.view.WindowManager;
|
2015-12-30 08:58:21 +00:00
|
|
|
import android.widget.Button;
|
2015-12-31 09:03:32 +00:00
|
|
|
import android.widget.EditText;
|
|
|
|
import android.widget.LinearLayout;
|
2015-12-30 08:58:21 +00:00
|
|
|
import android.widget.TextView;
|
|
|
|
|
2016-01-21 13:33:19 +00:00
|
|
|
import java.util.regex.Matcher;
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
2015-12-30 08:58:21 +00:00
|
|
|
public class ActivityPro extends AppCompatActivity {
|
|
|
|
private static final String TAG = "NetGuard.Pro";
|
|
|
|
|
|
|
|
private IAB iab;
|
|
|
|
|
|
|
|
// adb shell pm clear com.android.vending
|
2016-01-03 08:51:36 +00:00
|
|
|
// android.test.purchased
|
2016-07-17 16:49:07 +00:00
|
|
|
|
|
|
|
private static final int SKU_LOG_ID = 1;
|
|
|
|
private static final int SKU_FILTER_ID = 2;
|
|
|
|
private static final int SKU_NOTIFY_ID = 3;
|
|
|
|
private static final int SKU_SPEED_ID = 4;
|
|
|
|
private static final int SKU_THEME_ID = 5;
|
|
|
|
private static final int SKU_PRO1_ID = 6;
|
2016-07-23 08:07:39 +00:00
|
|
|
private static final int SKU_SUPPORT1_ID = 7;
|
2016-07-23 15:27:20 +00:00
|
|
|
private static final int SKU_SUPPORT2_ID = 8;
|
2016-07-17 16:49:07 +00:00
|
|
|
|
2016-01-21 16:57:55 +00:00
|
|
|
public static final String SKU_LOG = "log";
|
2016-01-31 08:30:06 +00:00
|
|
|
public static final String SKU_FILTER = "filter";
|
2016-01-03 08:51:36 +00:00
|
|
|
public static final String SKU_NOTIFY = "notify";
|
2015-12-30 08:58:21 +00:00
|
|
|
public static final String SKU_SPEED = "speed";
|
2016-01-21 16:57:55 +00:00
|
|
|
public static final String SKU_THEME = "theme";
|
2016-02-07 09:30:50 +00:00
|
|
|
public static final String SKU_PRO1 = "pro1";
|
2016-07-23 08:07:39 +00:00
|
|
|
public static final String SKU_SUPPORT1 = "support1";
|
2016-07-23 15:27:20 +00:00
|
|
|
public static final String SKU_SUPPORT2 = "support2";
|
2015-12-30 08:58:21 +00:00
|
|
|
public static final String SKU_DONATION = "donation";
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
2015-12-31 09:18:00 +00:00
|
|
|
Log.i(TAG, "Create");
|
2016-01-02 15:38:24 +00:00
|
|
|
Util.setTheme(this);
|
2015-12-30 08:58:21 +00:00
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
setContentView(R.layout.pro);
|
|
|
|
|
|
|
|
getSupportActionBar().setTitle(R.string.title_pro);
|
|
|
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
|
|
|
2015-12-31 09:03:32 +00:00
|
|
|
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
|
|
|
|
|
2015-12-31 15:55:39 +00:00
|
|
|
// Initial state
|
2015-12-30 08:58:21 +00:00
|
|
|
updateState();
|
|
|
|
|
2016-01-21 16:57:55 +00:00
|
|
|
TextView tvLogTitle = (TextView) findViewById(R.id.tvLogTitle);
|
2016-01-31 08:30:06 +00:00
|
|
|
TextView tvFilterTitle = (TextView) findViewById(R.id.tvFilterTitle);
|
2016-01-21 13:33:19 +00:00
|
|
|
TextView tvNotifyTitle = (TextView) findViewById(R.id.tvNotifyTitle);
|
|
|
|
TextView tvSpeedTitle = (TextView) findViewById(R.id.tvSpeedTitle);
|
2016-01-21 16:57:55 +00:00
|
|
|
TextView tvThemeTitle = (TextView) findViewById(R.id.tvThemeTitle);
|
2016-02-07 09:30:50 +00:00
|
|
|
TextView tvAllTitle = (TextView) findViewById(R.id.tvAllTitle);
|
2016-07-23 15:27:20 +00:00
|
|
|
TextView tvDev1Title = (TextView) findViewById(R.id.tvDev1Title);
|
|
|
|
TextView tvDev2Title = (TextView) findViewById(R.id.tvDev2Title);
|
2016-01-21 13:33:19 +00:00
|
|
|
|
|
|
|
Linkify.TransformFilter filter = new Linkify.TransformFilter() {
|
|
|
|
@Override
|
|
|
|
public String transformUrl(Matcher match, String url) {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-02-07 09:30:50 +00:00
|
|
|
Linkify.addLinks(tvLogTitle, Pattern.compile(".*"), "http://www.netguard.me/#" + SKU_LOG, null, filter);
|
|
|
|
Linkify.addLinks(tvFilterTitle, Pattern.compile(".*"), "http://www.netguard.me/#" + SKU_FILTER, null, filter);
|
|
|
|
Linkify.addLinks(tvNotifyTitle, Pattern.compile(".*"), "http://www.netguard.me/#" + SKU_NOTIFY, null, filter);
|
|
|
|
Linkify.addLinks(tvSpeedTitle, Pattern.compile(".*"), "http://www.netguard.me/#" + SKU_SPEED, null, filter);
|
|
|
|
Linkify.addLinks(tvThemeTitle, Pattern.compile(".*"), "http://www.netguard.me/#" + SKU_THEME, null, filter);
|
|
|
|
Linkify.addLinks(tvAllTitle, Pattern.compile(".*"), "http://www.netguard.me/#" + SKU_PRO1, null, filter);
|
2016-07-23 15:27:20 +00:00
|
|
|
Linkify.addLinks(tvDev1Title, Pattern.compile(".*"), "http://www.netguard.me/#" + SKU_SUPPORT1, null, filter);
|
|
|
|
Linkify.addLinks(tvDev2Title, Pattern.compile(".*"), "http://www.netguard.me/#" + SKU_SUPPORT2, null, filter);
|
2016-01-21 13:33:19 +00:00
|
|
|
|
2015-12-31 15:55:39 +00:00
|
|
|
// Challenge
|
2015-12-31 09:03:32 +00:00
|
|
|
TextView tvChallenge = (TextView) findViewById(R.id.tvChallenge);
|
|
|
|
tvChallenge.setText(Build.SERIAL);
|
2015-12-31 15:55:39 +00:00
|
|
|
|
|
|
|
// Response
|
|
|
|
try {
|
2016-08-21 12:51:35 +00:00
|
|
|
final String response = Util.md5(Build.SERIAL, "NetGuard2");
|
2015-12-31 15:55:39 +00:00
|
|
|
EditText etResponse = (EditText) findViewById(R.id.etResponse);
|
|
|
|
etResponse.addTextChangedListener(new TextWatcher() {
|
|
|
|
@Override
|
|
|
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
|
// Do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
|
|
// Do nothing
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void afterTextChanged(Editable editable) {
|
|
|
|
if (response.equals(editable.toString().toUpperCase())) {
|
2015-12-31 09:03:32 +00:00
|
|
|
IAB.setBought(SKU_DONATION, ActivityPro.this);
|
|
|
|
updateState();
|
|
|
|
}
|
|
|
|
}
|
2015-12-31 15:55:39 +00:00
|
|
|
});
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
|
|
|
}
|
2015-12-31 09:03:32 +00:00
|
|
|
|
2015-12-30 08:58:21 +00:00
|
|
|
try {
|
|
|
|
iab = new IAB(new IAB.Delegate() {
|
|
|
|
@Override
|
2016-02-18 08:16:18 +00:00
|
|
|
public void onReady(final IAB iab) {
|
2015-12-30 08:58:21 +00:00
|
|
|
Log.i(TAG, "IAB ready");
|
|
|
|
try {
|
2015-12-31 15:55:39 +00:00
|
|
|
iab.updatePurchases();
|
|
|
|
updateState();
|
2015-12-30 08:58:21 +00:00
|
|
|
|
2016-01-21 16:57:55 +00:00
|
|
|
final Button btnLog = (Button) findViewById(R.id.btnLog);
|
2016-01-31 08:30:06 +00:00
|
|
|
final Button btnFilter = (Button) findViewById(R.id.btnFilter);
|
2015-12-31 09:03:32 +00:00
|
|
|
final Button btnNotify = (Button) findViewById(R.id.btnNotify);
|
2015-12-30 08:58:21 +00:00
|
|
|
final Button btnSpeed = (Button) findViewById(R.id.btnSpeed);
|
2016-01-21 16:57:55 +00:00
|
|
|
final Button btnTheme = (Button) findViewById(R.id.btnTheme);
|
2016-02-07 09:30:50 +00:00
|
|
|
final Button btnAll = (Button) findViewById(R.id.btnAll);
|
2016-07-23 15:27:20 +00:00
|
|
|
final Button btnDev1 = (Button) findViewById(R.id.btnDev1);
|
|
|
|
final Button btnDev2 = (Button) findViewById(R.id.btnDev2);
|
2015-12-30 08:58:21 +00:00
|
|
|
|
|
|
|
View.OnClickListener listener = new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
public void onClick(View view) {
|
|
|
|
try {
|
2016-07-17 16:49:07 +00:00
|
|
|
int id = 0;
|
2016-02-18 08:16:18 +00:00
|
|
|
PendingIntent pi = null;
|
2016-07-17 16:49:07 +00:00
|
|
|
if (view == btnLog) {
|
|
|
|
id = SKU_LOG_ID;
|
2016-07-23 08:09:09 +00:00
|
|
|
pi = iab.getBuyIntent(SKU_LOG, false);
|
2016-07-17 16:49:07 +00:00
|
|
|
} else if (view == btnFilter) {
|
|
|
|
id = SKU_FILTER_ID;
|
2016-07-23 08:09:09 +00:00
|
|
|
pi = iab.getBuyIntent(SKU_FILTER, false);
|
2016-07-17 16:49:07 +00:00
|
|
|
} else if (view == btnNotify) {
|
|
|
|
id = SKU_NOTIFY_ID;
|
2016-07-23 08:09:09 +00:00
|
|
|
pi = iab.getBuyIntent(SKU_NOTIFY, false);
|
2016-07-17 16:49:07 +00:00
|
|
|
} else if (view == btnSpeed) {
|
|
|
|
id = SKU_SPEED_ID;
|
2016-07-23 08:09:09 +00:00
|
|
|
pi = iab.getBuyIntent(SKU_SPEED, false);
|
2016-07-17 16:49:07 +00:00
|
|
|
} else if (view == btnTheme) {
|
|
|
|
id = SKU_THEME_ID;
|
2016-07-23 08:09:09 +00:00
|
|
|
pi = iab.getBuyIntent(SKU_THEME, false);
|
2016-07-17 16:49:07 +00:00
|
|
|
} else if (view == btnAll) {
|
|
|
|
id = SKU_PRO1_ID;
|
2016-07-23 08:09:09 +00:00
|
|
|
pi = iab.getBuyIntent(SKU_PRO1, false);
|
2016-07-23 15:27:20 +00:00
|
|
|
} else if (view == btnDev1) {
|
2016-07-23 08:07:39 +00:00
|
|
|
id = SKU_SUPPORT1_ID;
|
2016-07-23 08:09:09 +00:00
|
|
|
pi = iab.getBuyIntent(SKU_SUPPORT1, true);
|
2016-07-23 15:27:20 +00:00
|
|
|
} else if (view == btnDev2) {
|
|
|
|
id = SKU_SUPPORT2_ID;
|
|
|
|
pi = iab.getBuyIntent(SKU_SUPPORT2, true);
|
2016-07-17 16:49:07 +00:00
|
|
|
}
|
2016-02-18 08:16:18 +00:00
|
|
|
|
2016-07-17 16:49:07 +00:00
|
|
|
if (id > 0 && pi != null)
|
|
|
|
startIntentSenderForResult(pi.getIntentSender(), id, new Intent(), 0, 0, 0);
|
2015-12-30 08:58:21 +00:00
|
|
|
} catch (Throwable ex) {
|
|
|
|
Log.i(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-01-21 16:57:55 +00:00
|
|
|
btnLog.setOnClickListener(listener);
|
2016-01-31 08:30:06 +00:00
|
|
|
btnFilter.setOnClickListener(listener);
|
2015-12-31 09:03:32 +00:00
|
|
|
btnNotify.setOnClickListener(listener);
|
2015-12-30 08:58:21 +00:00
|
|
|
btnSpeed.setOnClickListener(listener);
|
2016-01-21 16:57:55 +00:00
|
|
|
btnTheme.setOnClickListener(listener);
|
2016-02-07 09:30:50 +00:00
|
|
|
btnAll.setOnClickListener(listener);
|
2016-07-23 15:27:20 +00:00
|
|
|
btnDev1.setOnClickListener(listener);
|
|
|
|
btnDev2.setOnClickListener(listener);
|
2015-12-30 08:58:21 +00:00
|
|
|
|
2016-01-21 16:57:55 +00:00
|
|
|
btnLog.setEnabled(true);
|
2016-01-31 08:30:06 +00:00
|
|
|
btnFilter.setEnabled(true);
|
2015-12-31 09:03:32 +00:00
|
|
|
btnNotify.setEnabled(true);
|
2015-12-30 08:58:21 +00:00
|
|
|
btnSpeed.setEnabled(true);
|
2016-01-21 16:57:55 +00:00
|
|
|
btnTheme.setEnabled(true);
|
2016-02-07 09:30:50 +00:00
|
|
|
btnAll.setEnabled(true);
|
2016-07-23 15:27:20 +00:00
|
|
|
btnDev1.setEnabled(true);
|
|
|
|
btnDev2.setEnabled(true);
|
2015-12-30 08:58:21 +00:00
|
|
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
iab.bind();
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onDestroy() {
|
2015-12-31 09:18:00 +00:00
|
|
|
Log.i(TAG, "Destroy");
|
2015-12-30 08:58:21 +00:00
|
|
|
iab.unbind();
|
2016-11-10 07:54:32 +00:00
|
|
|
iab = null;
|
2015-12-30 08:58:21 +00:00
|
|
|
super.onDestroy();
|
|
|
|
}
|
|
|
|
|
2016-02-02 08:01:04 +00:00
|
|
|
@Override
|
2015-12-30 08:58:21 +00:00
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
|
switch (item.getItemId()) {
|
|
|
|
case android.R.id.home:
|
2016-02-02 08:01:04 +00:00
|
|
|
Log.i(TAG, "Up");
|
|
|
|
NavUtils.navigateUpFromSameTask(this);
|
2015-12-30 08:58:21 +00:00
|
|
|
return true;
|
2016-02-02 08:01:04 +00:00
|
|
|
default:
|
|
|
|
return super.onOptionsItemSelected(item);
|
2015-12-30 08:58:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
|
|
if (resultCode == RESULT_OK) {
|
|
|
|
switch (requestCode) {
|
2016-07-17 16:49:07 +00:00
|
|
|
case SKU_LOG_ID:
|
2016-01-21 16:57:55 +00:00
|
|
|
IAB.setBought(SKU_LOG, this);
|
2015-12-30 08:58:21 +00:00
|
|
|
updateState();
|
|
|
|
break;
|
2016-07-17 16:49:07 +00:00
|
|
|
case SKU_FILTER_ID:
|
2016-01-31 08:30:06 +00:00
|
|
|
IAB.setBought(SKU_FILTER, this);
|
|
|
|
updateState();
|
|
|
|
break;
|
2016-07-17 16:49:07 +00:00
|
|
|
case SKU_NOTIFY_ID:
|
2016-01-21 16:57:55 +00:00
|
|
|
IAB.setBought(SKU_NOTIFY, this);
|
2015-12-30 08:58:21 +00:00
|
|
|
updateState();
|
|
|
|
break;
|
2016-07-17 16:49:07 +00:00
|
|
|
case SKU_SPEED_ID:
|
2015-12-30 08:58:21 +00:00
|
|
|
IAB.setBought(SKU_SPEED, this);
|
|
|
|
updateState();
|
|
|
|
break;
|
2016-07-17 16:49:07 +00:00
|
|
|
case SKU_THEME_ID:
|
2016-01-21 16:57:55 +00:00
|
|
|
IAB.setBought(SKU_THEME, this);
|
2016-01-05 12:40:02 +00:00
|
|
|
updateState();
|
|
|
|
break;
|
2016-07-17 16:49:07 +00:00
|
|
|
case SKU_PRO1_ID:
|
2016-02-07 09:30:50 +00:00
|
|
|
IAB.setBought(SKU_PRO1, this);
|
|
|
|
updateState();
|
|
|
|
break;
|
2016-07-23 08:07:39 +00:00
|
|
|
case SKU_SUPPORT1_ID:
|
|
|
|
IAB.setBought(SKU_SUPPORT1, this);
|
|
|
|
updateState();
|
|
|
|
break;
|
2016-07-23 15:27:20 +00:00
|
|
|
case SKU_SUPPORT2_ID:
|
|
|
|
IAB.setBought(SKU_SUPPORT2, this);
|
|
|
|
updateState();
|
|
|
|
break;
|
2015-12-30 08:58:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void updateState() {
|
2016-01-21 16:57:55 +00:00
|
|
|
Button btnLog = (Button) findViewById(R.id.btnLog);
|
2016-01-31 08:30:06 +00:00
|
|
|
Button btnFilter = (Button) findViewById(R.id.btnFilter);
|
2015-12-31 09:03:32 +00:00
|
|
|
Button btnNotify = (Button) findViewById(R.id.btnNotify);
|
2015-12-30 08:58:21 +00:00
|
|
|
Button btnSpeed = (Button) findViewById(R.id.btnSpeed);
|
2016-01-21 16:57:55 +00:00
|
|
|
Button btnTheme = (Button) findViewById(R.id.btnTheme);
|
2016-02-07 09:30:50 +00:00
|
|
|
Button btnAll = (Button) findViewById(R.id.btnAll);
|
2016-07-23 15:27:20 +00:00
|
|
|
Button btnDev1 = (Button) findViewById(R.id.btnDev1);
|
|
|
|
Button btnDev2 = (Button) findViewById(R.id.btnDev2);
|
2016-01-21 16:57:55 +00:00
|
|
|
TextView tvLog = (TextView) findViewById(R.id.tvLog);
|
2016-01-31 08:30:06 +00:00
|
|
|
TextView tvFilter = (TextView) findViewById(R.id.tvFilter);
|
2015-12-31 09:03:32 +00:00
|
|
|
TextView tvNotify = (TextView) findViewById(R.id.tvNotify);
|
2015-12-30 08:58:21 +00:00
|
|
|
TextView tvSpeed = (TextView) findViewById(R.id.tvSpeed);
|
2016-01-21 16:57:55 +00:00
|
|
|
TextView tvTheme = (TextView) findViewById(R.id.tvTheme);
|
2016-02-07 09:30:50 +00:00
|
|
|
TextView tvAll = (TextView) findViewById(R.id.tvAll);
|
2016-07-23 15:27:20 +00:00
|
|
|
TextView tvDev1 = (TextView) findViewById(R.id.tvDev1);
|
|
|
|
TextView tvDev2 = (TextView) findViewById(R.id.tvDev2);
|
2015-12-31 09:03:32 +00:00
|
|
|
LinearLayout llChallenge = (LinearLayout) findViewById(R.id.llChallenge);
|
2015-12-30 08:58:21 +00:00
|
|
|
|
2016-01-21 16:57:55 +00:00
|
|
|
btnLog.setVisibility(IAB.isPurchased(SKU_LOG, this) ? View.GONE : View.VISIBLE);
|
2016-01-31 08:30:06 +00:00
|
|
|
btnFilter.setVisibility(IAB.isPurchased(SKU_FILTER, this) ? View.GONE : View.VISIBLE);
|
2016-01-01 18:03:41 +00:00
|
|
|
btnNotify.setVisibility(IAB.isPurchased(SKU_NOTIFY, this) ? View.GONE : View.VISIBLE);
|
|
|
|
btnSpeed.setVisibility(IAB.isPurchased(SKU_SPEED, this) ? View.GONE : View.VISIBLE);
|
2016-01-21 16:57:55 +00:00
|
|
|
btnTheme.setVisibility(IAB.isPurchased(SKU_THEME, this) ? View.GONE : View.VISIBLE);
|
2016-02-07 09:30:50 +00:00
|
|
|
btnAll.setVisibility(IAB.isPurchased(SKU_PRO1, this) ? View.GONE : View.VISIBLE);
|
2016-07-23 15:27:20 +00:00
|
|
|
btnDev1.setVisibility(IAB.isPurchased(SKU_SUPPORT1, this) ? View.GONE : View.VISIBLE);
|
|
|
|
btnDev2.setVisibility(IAB.isPurchased(SKU_SUPPORT2, this) ? View.GONE : View.VISIBLE);
|
2015-12-30 17:57:00 +00:00
|
|
|
|
2016-01-21 16:57:55 +00:00
|
|
|
tvLog.setVisibility(IAB.isPurchased(SKU_LOG, this) ? View.VISIBLE : View.GONE);
|
2016-01-31 08:30:06 +00:00
|
|
|
tvFilter.setVisibility(IAB.isPurchased(SKU_FILTER, this) ? View.VISIBLE : View.GONE);
|
2016-01-01 18:03:41 +00:00
|
|
|
tvNotify.setVisibility(IAB.isPurchased(SKU_NOTIFY, this) ? View.VISIBLE : View.GONE);
|
|
|
|
tvSpeed.setVisibility(IAB.isPurchased(SKU_SPEED, this) ? View.VISIBLE : View.GONE);
|
2016-01-21 16:57:55 +00:00
|
|
|
tvTheme.setVisibility(IAB.isPurchased(SKU_THEME, this) ? View.VISIBLE : View.GONE);
|
2016-02-07 09:30:50 +00:00
|
|
|
tvAll.setVisibility(IAB.isPurchased(SKU_PRO1, this) ? View.VISIBLE : View.GONE);
|
2016-07-23 15:27:20 +00:00
|
|
|
tvDev1.setVisibility(IAB.isPurchased(SKU_SUPPORT1, this) ? View.VISIBLE : View.GONE);
|
|
|
|
tvDev2.setVisibility(IAB.isPurchased(SKU_SUPPORT2, this) ? View.VISIBLE : View.GONE);
|
2015-12-31 09:03:32 +00:00
|
|
|
|
2016-02-07 09:37:28 +00:00
|
|
|
llChallenge.setVisibility(
|
2016-02-25 11:36:04 +00:00
|
|
|
IAB.isPurchased(SKU_DONATION, this) || Util.isPlayStoreInstall(this)
|
2016-02-07 09:37:28 +00:00
|
|
|
? View.GONE : View.VISIBLE);
|
2015-12-30 08:58:21 +00:00
|
|
|
}
|
|
|
|
}
|