Skip to content

Commit

Permalink
fix compilation of releases apks
Browse files Browse the repository at this point in the history
  • Loading branch information
wipedlifepotato committed Mar 18, 2024
1 parent 0e00636 commit a979427
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
14 changes: 10 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,26 @@ dependencies {
// implementation 'org.ini4j:ini4j:0.5.4'
implementation 'org.apache.commons:commons-configuration2:2.9.0'
}

configurations {
all {
configurations {
all{
//exclude group: 'commons-logging', module: 'commons-logging'
//exclude group: 'org.apache.httpcomponents'
exclude module: 'httpclient'
exclude module: 'commons-logging'
}
}

android {
lintOptions {
// Not so a good way
disable 'DuplicatePlatformClasses'
}

compileSdkVersion 33

defaultConfig {
applicationId "org.purplei2p.i2pd"
targetSdkVersion 33
// TODO: 24?
minSdkVersion 16
versionCode 2500200
versionName "2.50.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
}
}
} else if (requestCode == APP_STORAGE_ACCESS_REQUEST_CODE && resultCode == RESULT_OK) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
if (Environment.isExternalStorageManager()) {
startMainActivity();
} else {
Expand All @@ -195,5 +196,6 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
} else {
finish(); // close the app
}
}
}
}
5 changes: 4 additions & 1 deletion app/src/main/java/org/purplei2p/i2pd/I2PdQSTileService.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
import android.service.quicksettings.TileService;
import android.util.Log;

import android.annotation.TargetApi;
import android.os.Build;

@TargetApi(Build.VERSION_CODES.N)
public class I2PdQSTileService extends TileService {

private static final String TAG = "MyQSTileService";

@Override
public void onClick() {
super.onClick();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package org.purplei2p.i2pd;
import android.os.Build;

import android.os.Bundle;
import android.preference.CheckBoxPreference;
Expand Down Expand Up @@ -39,12 +40,15 @@ protected void onCreate(Bundle savedInstanceState) {
if (!isOldConfigExists)
{
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (Files.exists(Paths.get(CONFIG_FILE_PATH))) {
Files.copy(Paths.get(CONFIG_FILE_PATH), Paths.get(CONFIG_FILE_PATH + OLD_FILE_PREFIX));
}
} // if build ...
} catch (IOException e) {
e.printStackTrace();
}

}
// delete empty sections
{
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textAppearance="@android:style/TextAppearance.Material.Large"
android:textAppearance="@android:style/TextAppearance.Large"
android:textColor="#DFDFDF" />

<Space
Expand All @@ -65,7 +65,7 @@
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/services"
android:textAppearance="@android:style/TextAppearance.Material.Medium"
android:textAppearance="@android:style/TextAppearance.Medium"
android:textColor="#DFDFDF" />

<TableLayout
Expand All @@ -84,7 +84,7 @@
android:layout_height="wrap_content"
android:clickable="false"
android:text="@string/services_http_proxy"
android:textAppearance="@android:style/TextAppearance.Material.Small"
android:textAppearance="@android:style/TextAppearance.Small"
android:textColor="#DFDFDF" />

</TableRow>
Expand All @@ -100,7 +100,7 @@
android:layout_height="wrap_content"
android:clickable="false"
android:text="@string/services_socks_proxy"
android:textAppearance="@android:style/TextAppearance.Material.Small"
android:textAppearance="@android:style/TextAppearance.Small"
android:textColor="#DFDFDF" />
</TableRow>

Expand All @@ -115,7 +115,7 @@
android:layout_height="wrap_content"
android:clickable="false"
android:text="@string/services_bob"
android:textAppearance="@android:style/TextAppearance.Material.Small"
android:textAppearance="@android:style/TextAppearance.Small"
android:textColor="#DFDFDF" />
</TableRow>

Expand All @@ -130,7 +130,7 @@
android:layout_height="wrap_content"
android:clickable="false"
android:text="@string/services_sam"
android:textAppearance="@android:style/TextAppearance.Material.Small"
android:textAppearance="@android:style/TextAppearance.Small"
android:textColor="#DFDFDF" />
</TableRow>

Expand All @@ -145,11 +145,11 @@
android:layout_height="wrap_content"
android:clickable="false"
android:text="@string/services_i2cp"
android:textAppearance="@android:style/TextAppearance.Material.Small"
android:textAppearance="@android:style/TextAppearance.Small"
android:textColor="#DFDFDF" />
</TableRow>
</TableLayout>

</LinearLayout>

</ScrollView>
</ScrollView>

0 comments on commit a979427

Please sign in to comment.