Skip to content

Commit 98f7afb

Browse files
committed
Update Header Generator: Add save symbols
1 parent 027cc08 commit 98f7afb

24 files changed

+95
-938
lines changed

app/build.gradle

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
apply plugin: 'com.android.application'
2-
apply plugin: 'kotlin-android'
1+
plugins {
2+
id 'com.android.application'
3+
id 'kotlin-android'
4+
}
5+
36

47
android {
5-
compileSdkVersion 30
6-
buildToolsVersion = '30.0.3'
7-
ndkVersion '21.0.6113669'
8+
compileSdk 32
9+
ndkVersion '24.0.8215888'
810

911
defaultConfig {
1012
applicationId "com.mcal.disassembler"
11-
minSdkVersion 21
13+
minSdk 21
1214
//noinspection OldTargetApi
13-
targetSdkVersion 29
15+
targetSdk 29
1416
versionCode 31
1517
versionName "3.1"
1618
ndk {
@@ -41,24 +43,20 @@ android {
4143
dependencies {
4244
implementation fileTree(dir: 'libs', include: ['*.jar'])
4345
implementation project(':filepicker')
44-
implementation project(':hexviewer')
46+
//implementation project(':hexviewer')
4547
implementation project(':translator')
4648
implementation project(':materialdesign')
4749
implementation 'androidx.cardview:cardview:1.0.0'
48-
implementation 'androidx.annotation:annotation:1.2.0'
49-
implementation 'androidx.preference:preference-ktx:1.1.1'
50-
implementation "androidx.core:core-ktx:1.6.0"
50+
implementation 'androidx.annotation:annotation:1.4.0'
51+
implementation 'androidx.preference:preference-ktx:1.2.0'
52+
implementation "androidx.core:core-ktx:1.8.0"
5153
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
5254

53-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.20"
54-
implementation 'org.jetbrains:annotations:21.0.1'
55-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0"
56-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0"
55+
implementation 'org.jetbrains:annotations:23.0.0'
56+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1"
5757

58-
implementation "com.android.billingclient:billing-ktx:4.0.0"
5958

60-
implementation 'com.google.android.material:material:1.4.0'
61-
implementation 'com.google.android.gms:play-services-ads:20.2.0'
59+
implementation 'com.google.android.material:material:1.6.1'
6260

6361
implementation 'com.jakewharton:butterknife:10.2.3'
6462
implementation 'com.nineoldandroids:library:2.4.0'

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828

2929
<activity
3030
android:name=".activities.Main"
31-
android:label="@string/app_name">
31+
android:label="@string/app_name"
32+
android:exported="true">
3233

3334
<intent-filter>
3435

app/src/main/java/com/mcal/disassembler/App.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ import androidx.appcompat.app.AppCompatDelegate
88
import androidx.preference.PreferenceManager
99
import com.mcal.disassembler.data.Database
1010
import com.mcal.disassembler.data.Preferences
11-
import fr.ralala.hexviewer.ApplicationCtx
1211
import org.jetbrains.annotations.Nullable
1312

14-
class App : ApplicationCtx() {
13+
class App : Application() {
1514
override fun onCreate() {
1615
super.onCreate()
1716
context = this
@@ -49,7 +48,7 @@ class App : ApplicationCtx() {
4948
@Nullable
5049
fun getPreferences(): SharedPreferences {
5150
if (preferences == null) {
52-
preferences = PreferenceManager.getDefaultSharedPreferences(this.getContext())
51+
preferences = PreferenceManager.getDefaultSharedPreferences(this.getContext()!!)
5352
}
5453
return preferences!!
5554
}

app/src/main/java/com/mcal/disassembler/activities/Main.java

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,8 @@
2222
import com.mcal.disassembler.R;
2323
import com.mcal.disassembler.data.Constants;
2424
import 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;
3025
import 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

3928
import kotlin.Unit;
4029
import 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) {

app/src/main/java/com/mcal/disassembler/activities/MainActivity.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.mcal.disassembler.interfaces.MainView;
2424
import com.mcal.disassembler.nativeapi.DisassemblerDumper;
2525
import com.mcal.disassembler.nativeapi.Dumper;
26-
import com.mcal.disassembler.util.AdsAdmob;
2726
import com.mcal.materialdesign.view.CenteredToolBar;
2827
import com.mcal.materialdesign.widgets.SnackBar;
2928

@@ -44,7 +43,6 @@ public void onCreate(Bundle savedInstanceState) {
4443
super.onCreate(savedInstanceState);
4544
setContentView(R.layout.main_activity);
4645
setupToolbar(getString(R.string.app_name));
47-
AdsAdmob.loadInterestialAd(this);
4846
new Database(this);
4947
welcomeLayout = findViewById(R.id.welcome_layout);
5048
recentOpened = findViewById(R.id.items);
@@ -105,7 +103,6 @@ void updateRecents() {
105103
}
106104

107105
public void chooseSdcard(View view) {
108-
AdsAdmob.showInterestialAd(this, null);
109106
showFileChooser();
110107
}
111108

0 commit comments

Comments
 (0)