Skip to content

Commit b321fa2

Browse files
committed
Show a notification on devices running lower than Android N for unavailable decompilers
1 parent 4e7fed4 commit b321fa2

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

app/src/main/kotlin/com/njlabs/showjava/activities/decompiler/DecompilerActivity.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ class DecompilerActivity : BaseActivity() {
118118
systemAppWarning.text = sb
119119
}
120120

121+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
122+
decompilersUnavailableNotification.visibility = View.VISIBLE
123+
}
124+
121125
disposables.add(
122126
Observable.fromCallable {
123127
packageInfo.loadIcon(context)

app/src/main/res/layout/activity_decompiler.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,21 @@
156156
</LinearLayout>
157157

158158
<TextView
159-
android:id="@+id/systemAppWarning"
159+
android:id="@+id/decompilersUnavailableNotification"
160160
android:layout_below="@id/primaryLayout"
161161
android:layout_width="match_parent"
162162
android:padding="8dp"
163163
android:layout_height="wrap_content"
164164
android:visibility="gone"
165+
android:text="@string/decompilersUnavailable" />
166+
167+
<TextView
168+
android:id="@+id/systemAppWarning"
169+
android:layout_below="@id/decompilersUnavailableNotification"
170+
android:layout_width="match_parent"
171+
android:padding="8dp"
172+
android:layout_height="wrap_content"
173+
android:visibility="gone"
165174
android:text="@string/systemAppWarning" />
166175

167176
<include

app/src/main/res/layout/activity_decompiler_process.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,14 @@
138138
android:id="@+id/cancelButton"
139139
android:layout_width="wrap_content"
140140
android:layout_height="wrap_content"
141-
android:layout_alignParentBottom="true"
141+
android:layout_above="@+id/adView"
142142
android:layout_centerHorizontal="true"
143143
android:layout_marginBottom="14dp"
144144
android:text="@string/cancel"
145145
android:textColor="@color/grey_400" />
146146

147+
<include
148+
android:id="@+id/adView"
149+
layout="@layout/layout_admob" />
147150

148151
</RelativeLayout>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,5 @@
176176
<string name="errorLoadingInputFile">Error loading input file</string>
177177
<string name="genericError">An unexpected error occurred</string>
178178
<string name="errorLoadingFiles">An error occurred while loading files</string>
179+
<string name="decompilersUnavailable">JaDX and Fernflower decompilers are available only on android devices running Android 7.0 and above.</string>
179180
</resources>

0 commit comments

Comments
 (0)