Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Now Application-centric #102

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ build
*.iml
*.local
*.jks
*.tmp
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ This repository contains Android application sources of i2pd

### Install g++, OpenJDK 11+, gradle 5.1+

* <i>Note:</i> openjdk 17 has also been tested okay.

```bash
sudo apt-get install g++ openjdk-11-jdk gradle
```
Expand Down Expand Up @@ -58,7 +60,7 @@ pushd binary/jni
./build.sh -d
popd

gradle clean assembleDebug
./gradlew clean assembleDebug
```

You will find APKs in `app/build/outputs/apk`
Expand Down
16 changes: 9 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@ dependencies {
}

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

compileSdkVersion 33
// do not remove, it is deprecated & nevertheless required
compileSdkVersion 35

defaultConfig {
applicationId "org.purplei2p.i2pd"
targetSdkVersion 33
targetSdkVersion 35
// TODO: 24?
minSdkVersion 16
versionCode 2550000
Expand Down Expand Up @@ -89,6 +85,12 @@ android {
targetCompatibility = JavaVersion.VERSION_1_8
}
namespace 'org.purplei2p.i2pd'
lint {
disable 'DuplicatePlatformClasses'
}
buildFeatures {
buildConfig = true
}
}

ext.abiCodes = ['armeabi-v7a': 1, 'x86': 2, 'arm64-v8a': 3, 'x86_64': 4]
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
android:usesCleartextTraffic="true">

<service
android:name=".I2PdQSTileService"
android:name=".I2PDQuickSettingsTileService"
android:exported="true"
android:label="I2Pd"
android:icon="@drawable/ic_logo"
Expand All @@ -36,7 +36,7 @@

<receiver
android:enabled="true"
android:name="org.purplei2p.i2pd.receivers.BootUpReceiver"
android:name="org.purplei2p.i2pd.BootUpReceiver"
android:exported="true"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
<intent-filter>
Expand All @@ -62,7 +62,7 @@
</receiver>

<activity
android:name=".I2PDPermsAskerActivity"
android:name=".I2PDPermissionsAskerActivity"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -80,12 +80,12 @@
android:enabled="true" />

<activity
android:name=".I2PDPermsExplanationActivity"
android:name=".I2PDPermissionsExplanationActivity"
android:label="@string/title_activity_i2_pdperms_asker_prompt"
android:parentActivityName=".I2PDPermsAskerActivity">
android:parentActivityName=".I2PDPermissionsAskerActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.purplei2p.i2pd.I2PDPermsAskerActivity" />
android:value="org.purplei2p.i2pd.I2PDPermissionsAskerActivity" />
</activity>
<activity
android:name=".MainPreferenceActivity"
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/java/org/purplei2p/i2pd/BootUpReceiver.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.purplei2p.i2pd;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class BootUpReceiver extends BroadcastReceiver {

public static final String AUTOSTART_ON_BOOT = "autostart_on_boot";
public static final String SHARED_PREF_FILE_KEY =
BootUpReceiver.class.getName();

@Override
public void onReceive(Context context, Intent intent) {
if (I2PDApplication.isAutostartOnBoot(context)) I2PDApplication.setStartDaemon(true);
I2PDApplication.maybeAutostartForegroundServiceOnBoot(context);
}
}
Loading
Loading