2222import com .mcal .disassembler .R ;
2323import com .mcal .disassembler .data .Constants ;
2424import com .mcal .disassembler .data .Preferences ;
25- import com .mcal .disassembler .iap .DataWrappers ;
26- import com .mcal .disassembler .iap .IapConnector ;
27- import com .mcal .disassembler .iap .PurchaseServiceListener ;
28- import com .mcal .disassembler .iap .SubscriptionServiceListener ;
29- import com .mcal .disassembler .util .AdsAdmob ;
3025import com .mcal .materialdesign .view .CenteredToolBar ;
3126
32- import org .jetbrains .annotations .NotNull ;
33-
34- import java .util .Arrays ;
35- import java .util .Collections ;
36- import java .util .List ;
37- import java .util .Map ;
3827
3928import kotlin .Unit ;
4029import kotlin .jvm .functions .Function0 ;
@@ -48,8 +37,6 @@ public class Main extends AppCompatActivity {
4837 System .loadLibrary ("disassembler" );
4938 }
5039
51- private IapConnector iapConnector ;
52-
5340 @ Override
5441 public void onCreate (Bundle savedInstanceState ) {
5542 super .onCreate (savedInstanceState );
@@ -60,52 +47,7 @@ public void onCreate(Bundle savedInstanceState) {
6047 requestPermissions (new String []{Manifest .permission .READ_EXTERNAL_STORAGE , Manifest .permission .WRITE_EXTERNAL_STORAGE , Settings .ACTION_MANAGE_OVERLAY_PERMISSION }, 1 );
6148 }
6249 }
63- AdsAdmob .loadInterestialAd (this );
64- adLayout = findViewById (R .id .ad_view );
65- adLayout .addView (AdsAdmob .getBanner (this ));
6650 checkPermission ();
67- List <String > nonConsumablesList = Collections .singletonList ("premium" );
68- List <String > consumablesList = Arrays .asList ("donate_disassembler" , "moderate" , "quite" , "plenty" , "yearly" );
69- List <String > subsList = Collections .singletonList ("subscription" );
70-
71- iapConnector = new IapConnector (
72- this ,
73- nonConsumablesList ,
74- consumablesList ,
75- subsList ,
76- Constants .LK ,
77- BuildConfig .DEBUG
78- );
79-
80- iapConnector .addPurchaseListener (new PurchaseServiceListener () {
81- public void onPricesUpdated (@ NotNull Map <String , String > iapKeyPrices ) {
82-
83- }
84-
85- public void onProductPurchased (DataWrappers .@ NotNull PurchaseInfo purchaseInfo ) {
86- if (purchaseInfo .getSku ().equals ("donate_disassembler" )) {
87-
88- }
89- }
90-
91- public void onProductRestored (DataWrappers .@ NotNull PurchaseInfo purchaseInfo ) {
92-
93- }
94- });
95- iapConnector .addSubscriptionListener (new SubscriptionServiceListener () {
96- public void onSubscriptionRestored (DataWrappers .@ NotNull PurchaseInfo purchaseInfo ) {
97- }
98-
99- public void onSubscriptionPurchased (DataWrappers .@ NotNull PurchaseInfo purchaseInfo ) {
100- if (purchaseInfo .getSku ().equals ("subscription" )) {
101-
102- }
103- }
104-
105- public void onPricesUpdated (@ NotNull Map <String , String > iapKeyPrices ) {
106-
107- }
108- });
10951 }
11052
11153 @ Override
@@ -141,50 +83,31 @@ private void setupToolbar(String title) {
14183 }
14284
14385 public void github (View view ) {
144- AdsAdmob .showInterestialAd (this , null );
14586 this .startActivity (new Intent (Intent .ACTION_VIEW , Uri .parse ("https://github.com/TimScriptov/Disassembler.git" )));
14687 }
14788
14889 public void telegram (View view ) {
149- AdsAdmob .showInterestialAd (this , null );
15090 this .startActivity (new Intent (Intent .ACTION_VIEW , Uri .parse ("https://t.me/dexprotect" )));
15191 }
15292
15393 public void toNameDemangler (View view ) {
154- AdsAdmob .showInterestialAd (this , null );
15594 startActivity (new Intent (this , NameDemanglerActivity .class ));
15695 }
15796
15897 public void translator (View view ) {
159- AdsAdmob .showInterestialAd (this , null );
16098 startActivity (new Intent (this , com .mcal .elfeditor .MainActivity .class ));
16199 }
162100
163101 public void symbols (View view ) {
164- AdsAdmob . showInterestialAd ( this , runSymbols () );
102+ runSymbols ();
165103 }
166104
167105 public Function0 <Unit > runSymbols () {
168- AdsAdmob .showInterestialAd (this , null );
169106 Intent intent = new Intent (this , MainActivity .class );
170107 startActivity (intent );
171108 return null ;
172109 }
173110
174- public void hexViewer (View view ) {
175- AdsAdmob .showInterestialAd (this , runHexViewer ());
176- }
177-
178- public Function0 <Unit > runHexViewer () {
179- Intent intent = new Intent (this , fr .ralala .hexviewer .ui .activities .MainActivity .class );
180- startActivity (intent );
181- return null ;
182- }
183-
184- public void donate (View v ) {
185- iapConnector .purchase (this , "donate_disassembler" );
186- }
187-
188111 @ TargetApi (Build .VERSION_CODES .M )
189112 @ Override
190113 protected void onActivityResult (int requestCode , int resultCode , Intent data ) {
0 commit comments