NetGuard v2.328版本的 MD5 值为:4adaa6f0accf8a6a5ab62c36e5a5d3f8
以下内容为反编译后的 ActivityPro.java 源代码,内容仅作参考
package eu.faircode.netguard;
import K0.r;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.ActivityC0095q;
import androidx.appcompat.app.C0091m;
import androidx.appcompat.app.DialogInterfaceC0092n;
import androidx.core.app.C0127j;
import eu.faircode.netguard.IAB;
public class ActivityPro extends ActivityC0095q {
private IAB iab;
class AnonymousClass2 implements IAB.Delegate {
final TextView val$tvError;
final View val$view;
AnonymousClass2(View view, TextView textView) {
this.val$view = view;
this.val$tvError = textView;
}
@Override
public void onError(final String str) {
this.val$view.post(new Runnable() {
@Override
public void run() {
AnonymousClass2.this.val$tvError.setText(str);
AnonymousClass2.this.val$tvError.setVisibility(0);
}
});
}
@Override
public void onReady(final IAB iab) {
Log.i("NetGuard.Pro", "IAB ready");
this.val$view.post(new Runnable() {
@Override
public void run() {
try {
ActivityPro.this.updateState();
final Button button = (Button) ActivityPro.this.findViewById(R.id.btnLog);
final Button button2 = (Button) ActivityPro.this.findViewById(R.id.btnFilter);
final Button button3 = (Button) ActivityPro.this.findViewById(R.id.btnNotify);
final Button button4 = (Button) ActivityPro.this.findViewById(R.id.btnSpeed);
final Button button5 = (Button) ActivityPro.this.findViewById(R.id.btnTheme);
final Button button6 = (Button) ActivityPro.this.findViewById(R.id.btnAll);
final Button button7 = (Button) ActivityPro.this.findViewById(R.id.btnDev1);
final Button button8 = (Button) ActivityPro.this.findViewById(R.id.btnDev2);
View.OnClickListener onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
try {
if (view == button) {
AnonymousClass1 anonymousClass1 = AnonymousClass1.this;
iab.startPurchase(ActivityPro.this, "log", false);
} else if (view == button2) {
AnonymousClass1 anonymousClass12 = AnonymousClass1.this;
iab.startPurchase(ActivityPro.this, "filter", false);
} else if (view == button3) {
AnonymousClass1 anonymousClass13 = AnonymousClass1.this;
iab.startPurchase(ActivityPro.this, "notify", false);
} else if (view == button4) {
AnonymousClass1 anonymousClass14 = AnonymousClass1.this;
iab.startPurchase(ActivityPro.this, "speed", false);
} else if (view == button5) {
AnonymousClass1 anonymousClass15 = AnonymousClass1.this;
iab.startPurchase(ActivityPro.this, "theme", false);
} else if (view == button6) {
AnonymousClass1 anonymousClass16 = AnonymousClass1.this;
iab.startPurchase(ActivityPro.this, "pro1", false);
} else if (view == button7) {
AnonymousClass1 anonymousClass17 = AnonymousClass1.this;
iab.startPurchase(ActivityPro.this, "support1", true);
} else if (view == button8) {
AnonymousClass1 anonymousClass18 = AnonymousClass1.this;
iab.startPurchase(ActivityPro.this, "support2", true);
}
} catch (Throwable th) {
Log.i("NetGuard.Pro", th.toString() + "\n" + Log.getStackTraceString(th));
}
}
};
button.setOnClickListener(onClickListener);
button2.setOnClickListener(onClickListener);
button3.setOnClickListener(onClickListener);
button4.setOnClickListener(onClickListener);
button5.setOnClickListener(onClickListener);
button6.setOnClickListener(onClickListener);
button7.setOnClickListener(onClickListener);
button8.setOnClickListener(onClickListener);
button.setEnabled(true);
button2.setEnabled(true);
button3.setEnabled(true);
button4.setEnabled(true);
button5.setEnabled(true);
button6.setEnabled(true);
button7.setEnabled(true);
button8.setEnabled(true);
} catch (Throwable th) {
r.h(th, new StringBuilder(), "\n", th, "NetGuard.Pro");
}
}
});
}
}
private void menu_challenge() {
final String str;
if (IAB.isPurchased("donation", this)) {
Toast.makeText(this, getString(R.string.title_pro_already), 1).show();
return;
}
View inflate = LayoutInflater.from(this).inflate(R.layout.challenge, (ViewGroup) null, false);
C0091m c0091m = new C0091m(this);
c0091m.m(inflate);
c0091m.d(true);
final DialogInterfaceC0092n a2 = c0091m.a();
String string = Settings.Secure.getString(getContentResolver(), "android_id");
int i2 = Build.VERSION.SDK_INT;
if (i2 < 26) {
str = Build.SERIAL;
} else {
str = "O3" + string;
}
String str2 = i2 < 26 ? "NetGuard2" : "NetGuard3";
((TextView) inflate.findViewById(R.id.tvChallenge)).setText(str);
((ImageButton) inflate.findViewById(R.id.ibCopy)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
((ClipboardManager) ActivityPro.this.getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText(ActivityPro.this.getString(R.string.title_pro_challenge), str));
Toast.makeText(ActivityPro.this, 17039361, 1).show();
}
});
final EditText editText = (EditText) inflate.findViewById(R.id.etResponse);
try {
final String md5 = Util.md5(str, str2);
editText.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable editable) {
if (md5.equals(editable.toString().toUpperCase())) {
IAB.setBought("donation", true, ActivityPro.this);
a2.dismiss();
ActivityPro.this.invalidateOptionsMenu();
ActivityPro.this.updateState();
}
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i3, int i4, int i5) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i3, int i4, int i5) {
}
});
} catch (Throwable th) {
r.h(th, new StringBuilder(), "\n", th, "NetGuard.Pro");
}
((ImageButton) inflate.findViewById(R.id.ibPaste)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ClipboardManager clipboardManager = (ClipboardManager) ActivityPro.this.getSystemService("clipboard");
if (clipboardManager != null && clipboardManager.hasPrimaryClip() && clipboardManager.getPrimaryClipDescription().hasMimeType("text/plain")) {
editText.setText(clipboardManager.getPrimaryClip().getItemAt(0).getText().toString());
}
}
});
a2.show();
}
public void updateState() {
TextView textView;
int i2;
Button button = (Button) findViewById(R.id.btnLog);
Button button2 = (Button) findViewById(R.id.btnFilter);
Button button3 = (Button) findViewById(R.id.btnNotify);
Button button4 = (Button) findViewById(R.id.btnSpeed);
Button button5 = (Button) findViewById(R.id.btnTheme);
Button button6 = (Button) findViewById(R.id.btnAll);
Button button7 = (Button) findViewById(R.id.btnDev1);
Button button8 = (Button) findViewById(R.id.btnDev2);
TextView textView2 = (TextView) findViewById(R.id.tvLog);
TextView textView3 = (TextView) findViewById(R.id.tvFilter);
TextView textView4 = (TextView) findViewById(R.id.tvNotify);
TextView textView5 = (TextView) findViewById(R.id.tvSpeed);
TextView textView6 = (TextView) findViewById(R.id.tvTheme);
TextView textView7 = (TextView) findViewById(R.id.tvAll);
TextView textView8 = (TextView) findViewById(R.id.tvDev1);
TextView textView9 = (TextView) findViewById(R.id.tvDev2);
TextView textView10 = (TextView) findViewById(R.id.tvLogUnavailable);
TextView textView11 = (TextView) findViewById(R.id.tvFilterUnavailable);
boolean canFilter = Util.canFilter(this);
if (IAB.isPurchased("log", this) || !canFilter) {
textView = textView7;
i2 = 8;
} else {
textView = textView7;
i2 = 0;
}
button.setVisibility(i2);
button2.setVisibility((IAB.isPurchased("filter", this) || !canFilter) ? 8 : 0);
button3.setVisibility(IAB.isPurchased("notify", this) ? 8 : 0);
button4.setVisibility(IAB.isPurchased("speed", this) ? 8 : 0);
button5.setVisibility(IAB.isPurchased("theme", this) ? 8 : 0);
button6.setVisibility(IAB.isPurchased("pro1", this) ? 8 : 0);
button7.setVisibility(IAB.isPurchased("support1", this) ? 8 : 0);
button8.setVisibility(IAB.isPurchased("support2", this) ? 8 : 0);
textView2.setVisibility((IAB.isPurchased("log", this) && canFilter) ? 0 : 8);
textView3.setVisibility((IAB.isPurchased("filter", this) && canFilter) ? 0 : 8);
textView4.setVisibility(IAB.isPurchased("notify", this) ? 0 : 8);
textView5.setVisibility(IAB.isPurchased("speed", this) ? 0 : 8);
textView6.setVisibility(IAB.isPurchased("theme", this) ? 0 : 8);
textView.setVisibility(IAB.isPurchased("pro1", this) ? 0 : 8);
textView8.setVisibility(IAB.isPurchased("support1", this) ? 0 : 8);
textView9.setVisibility(IAB.isPurchased("support2", this) ? 0 : 8);
textView10.setVisibility(canFilter ? 8 : 0);
textView11.setVisibility(canFilter ? 8 : 0);
}
@Override
public void onCreate(Bundle bundle) {
Log.i("NetGuard.Pro", "Create");
Util.setTheme(this);
super.onCreate(bundle);
setContentView(R.layout.pro);
getSupportActionBar().e(R.string.title_pro);
getSupportActionBar().c(true);
getWindow().setSoftInputMode(2);
updateState();
View findViewById = findViewById(16908290);
TextView textView = (TextView) findViewById(R.id.tvError);
TextView textView2 = (TextView) findViewById(R.id.tvLogTitle);
TextView textView3 = (TextView) findViewById(R.id.tvFilterTitle);
TextView textView4 = (TextView) findViewById(R.id.tvNotifyTitle);
TextView textView5 = (TextView) findViewById(R.id.tvSpeedTitle);
TextView textView6 = (TextView) findViewById(R.id.tvThemeTitle);
TextView textView7 = (TextView) findViewById(R.id.tvAllTitle);
TextView textView8 = (TextView) findViewById(R.id.tvDev1Title);
TextView textView9 = (TextView) findViewById(R.id.tvDev2Title);
textView.setVisibility(8);
textView2.setPaintFlags(textView2.getPaintFlags() | 8);
textView3.setPaintFlags(textView2.getPaintFlags() | 8);
textView4.setPaintFlags(textView2.getPaintFlags() | 8);
textView5.setPaintFlags(textView2.getPaintFlags() | 8);
textView6.setPaintFlags(textView2.getPaintFlags() | 8);
textView7.setPaintFlags(textView2.getPaintFlags() | 8);
textView8.setPaintFlags(textView2.getPaintFlags() | 8);
textView9.setPaintFlags(8 | textView2.getPaintFlags());
View.OnClickListener onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
String str = "pro1";
switch (view.getId()) {
case R.id.tvDev1Title:
str = "support1";
break;
case R.id.tvDev2Title:
str = "support2";
break;
case R.id.tvFilterTitle:
str = "filter";
break;
case R.id.tvLogTitle:
str = "log";
break;
case R.id.tvNotifyTitle:
str = "notify";
break;
case R.id.tvSpeedTitle:
str = "speed";
break;
case R.id.tvThemeTitle:
str = "theme";
break;
}
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse("http://www.netguard.me/#".concat(str)));
if (intent.resolveActivity(ActivityPro.this.getPackageManager()) != null) {
ActivityPro.this.startActivity(intent);
}
}
};
textView2.setOnClickListener(onClickListener);
textView3.setOnClickListener(onClickListener);
textView4.setOnClickListener(onClickListener);
textView5.setOnClickListener(onClickListener);
textView6.setOnClickListener(onClickListener);
textView7.setOnClickListener(onClickListener);
textView8.setOnClickListener(onClickListener);
textView9.setOnClickListener(onClickListener);
try {
IAB iab = new IAB(new AnonymousClass2(findViewById, textView), this);
this.iab = iab;
iab.bind();
} catch (Throwable th) {
r.h(th, new StringBuilder(), "\n", th, "NetGuard.Pro");
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.pro, menu);
return true;
}
@Override
public void onDestroy() {
Log.i("NetGuard.Pro", "Destroy");
this.iab.unbind();
this.iab = null;
super.onDestroy();
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
int itemId = menuItem.getItemId();
if (itemId == 16908332) {
Log.i("NetGuard.Pro", "Up");
C0127j.e(this);
return true;
} else if (itemId != R.id.menu_challenge) {
return super.onOptionsItemSelected(menuItem);
} else {
menu_challenge();
return true;
}
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
if (Util.isPlayStoreInstall(this)) {
menu.removeItem(R.id.menu_challenge);
}
return super.onPrepareOptionsMenu(menu);
}
}