mirror of
https://github.com/PurpleI2P/i2pd-android.git
synced 2024-12-06 19:27:28 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 06b567d910 | |||
| dd17608af9 | |||
| 2e10678278 | |||
| 8132dbde08 | |||
| f2ee4e5ea0 | |||
| 57fef00c48 |
@@ -21,15 +21,15 @@ jobs:
|
||||
uses: maxim-lobanov/setup-android-tools@v1
|
||||
with:
|
||||
packages: |
|
||||
build-tools;31.0.0
|
||||
platforms;android-31
|
||||
ndk;21.4.7075529
|
||||
cmake;3.18.1
|
||||
build-tools;32.0.0
|
||||
platforms;android-32
|
||||
ndk;23.2.8568313
|
||||
cmake;3.22.1
|
||||
cache: true
|
||||
- name: Build required modules
|
||||
run: |
|
||||
export ANDROID_SDK_ROOT=$ANDROID_HOME
|
||||
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/21.4.7075529
|
||||
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313
|
||||
pushd app/jni
|
||||
./build_boost.sh
|
||||
./build_openssl.sh
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: android-apks.zip
|
||||
name: android-apks
|
||||
path: app/build/outputs/apk/debug/*.apk
|
||||
|
||||
build-binary:
|
||||
@@ -61,13 +61,13 @@ jobs:
|
||||
uses: maxim-lobanov/setup-android-tools@v1
|
||||
with:
|
||||
packages: |
|
||||
ndk;21.4.7075529
|
||||
cmake;3.18.1
|
||||
ndk;23.2.8568313
|
||||
cmake;3.22.1
|
||||
cache: true
|
||||
- name: Build required modules
|
||||
run: |
|
||||
export ANDROID_SDK_ROOT=$ANDROID_HOME
|
||||
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/21.4.7075529
|
||||
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313
|
||||
pushd binary/jni
|
||||
./build_boost.sh
|
||||
./build_openssl.sh
|
||||
@@ -86,10 +86,10 @@ jobs:
|
||||
- name: Upload binaries archive
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: android-binaries.zip
|
||||
name: android-binaries
|
||||
path: binary/libs/*
|
||||
- name: Upload binaries package
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: android-binaries-pack.zip
|
||||
name: android-binaries-pack
|
||||
path: contrib/binary_pack/i2pd_*_android_binary.zip
|
||||
|
||||
+5
-5
@@ -8,16 +8,16 @@ dependencies {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
compileSdkVersion 32
|
||||
|
||||
defaultConfig {
|
||||
applicationId "org.purplei2p.i2pd"
|
||||
targetSdkVersion 29
|
||||
targetSdkVersion 32
|
||||
minSdkVersion 16
|
||||
versionCode 2440000
|
||||
versionName "2.44.0"
|
||||
versionCode 2450001
|
||||
versionName "2.45.0.1"
|
||||
archivesBaseName += "-$versionName"
|
||||
ndkVersion "21.4.7075529"
|
||||
ndkVersion "23.2.8568313"
|
||||
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a"
|
||||
|
||||
+1
-1
Submodule app/jni/boost updated: 0e12fbd30c...53e6c16ea8
@@ -2,12 +2,10 @@
|
||||
|
||||
set -e
|
||||
|
||||
BOOST_VERSION=1.74.0
|
||||
BOOST_VERSION=1.78.0
|
||||
BOOST_LIBS=date_time,filesystem,program_options,system
|
||||
|
||||
function build_one {
|
||||
mkdir out
|
||||
|
||||
echo "Configuring and building..."
|
||||
CXXFLAGS="-std=c++14" \
|
||||
NCPU=$(nproc) \
|
||||
@@ -70,10 +68,10 @@ function build {
|
||||
checkPreRequisites
|
||||
|
||||
cd boost
|
||||
rm -rf out
|
||||
|
||||
# disable verbose output
|
||||
sed -i -e 's/d+2/d+0/' build-android.sh
|
||||
sed -i -e 's/\"23\.1\"\|\"25\.0\"/\"23\.1\"\|\"23\.2\"\|\"25\.0\"/' build-android.sh
|
||||
|
||||
if (( $# == 0 )); then
|
||||
build all
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
CMAKE_VERSION=3.18.1
|
||||
CMAKE_VERSION=3.22.1
|
||||
|
||||
function build_one {
|
||||
mkdir -p build out/$CPU
|
||||
|
||||
+1
-1
Submodule app/jni/i2pd updated: ba3cee1cf1...e59ca8420e
@@ -3,10 +3,11 @@
|
||||
package="org.purplei2p.i2pd"
|
||||
android:installLocation="auto">
|
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="29" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
@@ -38,14 +39,16 @@
|
||||
|
||||
<receiver
|
||||
android:name=".NetworkStateChangeReceiver"
|
||||
android:label="NetworkChangeReceiver" >
|
||||
android:label="NetworkChangeReceiver"
|
||||
android:exported="true" >
|
||||
<intent-filter>
|
||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<activity
|
||||
android:name=".I2PDPermsAskerActivity">
|
||||
android:name=".I2PDPermsAskerActivity"
|
||||
android:exported="false" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.net.ConnectivityManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.os.IBinder;
|
||||
import android.os.PowerManager;
|
||||
import android.preference.PreferenceManager;
|
||||
@@ -126,11 +127,17 @@ public class I2PDActivity extends Activity {
|
||||
|
||||
daemon.addStateChangeListener(daemonStateUpdatedListener);
|
||||
daemonStateUpdatedListener.daemonStateUpdate(DaemonWrapper.State.uninitialized, daemon.getState());
|
||||
|
||||
// request permissions
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
if(!Environment.isExternalStorageManager()) {
|
||||
Log.e(TAG, "MANAGE_EXTERNAL_STORAGE perm declined, stopping i2pd");
|
||||
i2pdStop();
|
||||
}
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(this,
|
||||
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
||||
new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE },
|
||||
MY_PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,11 @@ import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.provider.Settings;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
@@ -16,6 +20,7 @@ import java.lang.reflect.Method;
|
||||
public class I2PDPermsAskerActivity extends Activity {
|
||||
|
||||
private static final int PERMISSION_WRITE_EXTERNAL_STORAGE = 0;
|
||||
private static final int PERMISSION_MANAGE_EXTERNAL_STORAGE = 0;
|
||||
|
||||
private Button button_request_write_ext_storage_perms;
|
||||
private TextView textview_retry;
|
||||
@@ -24,7 +29,7 @@ public class I2PDPermsAskerActivity extends Activity {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
//if less than Android 6, no runtime perms req system present
|
||||
if (android.os.Build.VERSION.SDK_INT < 23) {
|
||||
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
||||
startMainActivity();
|
||||
return;
|
||||
}
|
||||
@@ -48,57 +53,66 @@ public class I2PDPermsAskerActivity extends Activity {
|
||||
textview_retry.setVisibility(TextView.GONE);
|
||||
button_request_write_ext_storage_perms.setVisibility(Button.GONE);
|
||||
|
||||
Method methodCheckPermission;
|
||||
Method method_shouldShowRequestPermissionRationale;
|
||||
Method method_requestPermissions;
|
||||
try {
|
||||
methodCheckPermission = getClass().getMethod("checkSelfPermission", String.class);
|
||||
method_shouldShowRequestPermissionRationale =
|
||||
getClass().getMethod("shouldShowRequestPermissionRationale", String.class);
|
||||
method_requestPermissions =
|
||||
getClass().getMethod("requestPermissions", String[].class, int.class);
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Integer resultObj;
|
||||
try {
|
||||
resultObj = (Integer) methodCheckPermission.invoke(
|
||||
this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
} catch (Throwable e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
if(!Environment.isExternalStorageManager()) {
|
||||
showExplanation();
|
||||
} else {
|
||||
startMainActivity();
|
||||
}
|
||||
} else {
|
||||
Method methodCheckPermission;
|
||||
Method method_shouldShowRequestPermissionRationale;
|
||||
Method method_requestPermissions;
|
||||
|
||||
if (resultObj != PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
// Should we show an explanation?
|
||||
Boolean aBoolean;
|
||||
try {
|
||||
aBoolean = (Boolean) method_shouldShowRequestPermissionRationale.invoke(this,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
} catch (Exception e) {
|
||||
methodCheckPermission = getClass().getMethod("checkSelfPermission", String.class);
|
||||
method_shouldShowRequestPermissionRationale =
|
||||
getClass().getMethod("shouldShowRequestPermissionRationale", String.class);
|
||||
method_requestPermissions =
|
||||
getClass().getMethod("requestPermissions", String[].class, int.class);
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (aBoolean) {
|
||||
|
||||
// Show an explanation to the user *asynchronously* -- don't block
|
||||
// this thread waiting for the user's response! After the user
|
||||
// sees the explanation, try again to request the permission.
|
||||
Integer resultObj;
|
||||
|
||||
showExplanation();
|
||||
|
||||
} else {
|
||||
|
||||
// No explanation needed, we can request the permission.
|
||||
try {
|
||||
resultObj = (Integer) methodCheckPermission.invoke(
|
||||
this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
} catch (Throwable e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
if (resultObj != PackageManager.PERMISSION_GRANTED) {
|
||||
// Should we show an explanation?
|
||||
Boolean aBoolean;
|
||||
try {
|
||||
method_requestPermissions.invoke(this,
|
||||
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
||||
PERMISSION_WRITE_EXTERNAL_STORAGE);
|
||||
aBoolean = (Boolean) method_shouldShowRequestPermissionRationale.invoke(this,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
} else startMainActivity();
|
||||
|
||||
if (aBoolean) {
|
||||
|
||||
// Show an explanation to the user *asynchronously* -- don't block
|
||||
// this thread waiting for the user's response! After the user
|
||||
// sees the explanation, try again to request the permission.
|
||||
|
||||
showExplanation();
|
||||
|
||||
} else {
|
||||
// No explanation needed, we can request the permission.
|
||||
try {
|
||||
method_requestPermissions.invoke(this,
|
||||
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
||||
PERMISSION_WRITE_EXTERNAL_STORAGE);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
} else startMainActivity();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -136,6 +150,7 @@ public class I2PDPermsAskerActivity extends Activity {
|
||||
}
|
||||
|
||||
private static final int SHOW_EXPLANATION_REQUEST = 1; // The request code
|
||||
private static final int APP_STORAGE_ACCESS_REQUEST_CODE = 2;
|
||||
|
||||
private void showExplanation() {
|
||||
Intent intent = new Intent(this, I2PDPermsExplanationActivity.class);
|
||||
@@ -144,11 +159,14 @@ public class I2PDPermsAskerActivity extends Activity {
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
// Check which request we're responding to
|
||||
if (requestCode == SHOW_EXPLANATION_REQUEST) {
|
||||
// Make sure the request was successful
|
||||
if (resultCode == RESULT_OK) {
|
||||
// Request the permission
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
// Check which request we're responding to and make sure the request was successful
|
||||
if (requestCode == SHOW_EXPLANATION_REQUEST && resultCode == RESULT_OK) {
|
||||
// Request the permission
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
Intent intentManageAccess = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, Uri.parse("package:" + BuildConfig.APPLICATION_ID));
|
||||
startActivityForResult(intentManageAccess, APP_STORAGE_ACCESS_REQUEST_CODE);
|
||||
} else {
|
||||
Method method_requestPermissions;
|
||||
try {
|
||||
method_requestPermissions =
|
||||
@@ -163,9 +181,19 @@ public class I2PDPermsAskerActivity extends Activity {
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else {
|
||||
finish(); //close the app
|
||||
}
|
||||
} else if (requestCode == APP_STORAGE_ACCESS_REQUEST_CODE && resultCode == RESULT_OK) {
|
||||
if (Environment.isExternalStorageManager()) {
|
||||
startMainActivity();
|
||||
} else {
|
||||
textview_retry.setText(R.string.permDenied);
|
||||
textview_retry.setVisibility(TextView.VISIBLE);
|
||||
button_request_write_ext_storage_perms.setVisibility(Button.VISIBLE);
|
||||
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
finish(); // close the app
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
|
||||
<string name="app_description2">Síť bez hranic</string>
|
||||
<string name="action_start">Začít</string>
|
||||
<string name="action_stop">Zastavit</string>
|
||||
<string name="action_exit">Odejít</string>
|
||||
<string name="action_graceful_stop">Hladké vypnutí</string>
|
||||
<string name="action_cancel_graceful_stop">Zrušit hladké vypnutí</string>
|
||||
<string name="action_reload_tunnels_config">Znovu načíst tunely</string>
|
||||
<string name="action_start_webview">Otevřít webovou konzoli</string>
|
||||
<string name="action_settings">Nastavení</string>
|
||||
<string name="graceful_stop_is_already_in_progress">Hladké vypnutí již probíhá</string>
|
||||
<string name="graceful_stop_is_in_progress">Hladké vypnutí právě probíhá</string>
|
||||
<string name="gracefulShutdownInProgress">Hladké vypnutí právě probíhá</string>
|
||||
<string name="already_stopped">Již zastaveno</string>
|
||||
<string name="uninitialized">Aplikace se inicializuje...</string>
|
||||
<string name="starting">Aplikace se zapíná...</string>
|
||||
<string name="jniLibraryLoaded">JNI knihovny načteny</string>
|
||||
<string name="startedOkay">Aplikace spuštěna</string>
|
||||
<string name="startFailed">Spuštění se nezdrařilo</string>
|
||||
<string name="stopped">Aplikace zastavena</string>
|
||||
<string name="stopping">Aplikace se vypíná...</string>
|
||||
<string name="remaining">zbývá</string>
|
||||
<string name="services">Vnitřní služby</string>
|
||||
<string name="services_http_proxy">HTTP Proxy</string>
|
||||
<string name="services_socks_proxy">SOCKS5 Proxy</string>
|
||||
<string name="title_activity_i2_pdperms_asker_prompt">Výzva</string>
|
||||
<string name="permDenied">Oprávnění k zápisu na SD kartu bylo zamítnuto. Abyste mohli pokračovat, je třeba toto oprávnění povolit</string>
|
||||
<string name="permRequired">Pro zápis klíčů a dalších souborů do I2PD složky na SD kartu je vyžadován přístup k SD kartě.</string>
|
||||
<string name="retryPermRequest">Opakovat žádost o oprávnění k zápisu na SD kartu</string>
|
||||
<string name="menu_item_battery_optimizations_str">Optimalizace baterie</string>
|
||||
<string name="battery_optimizations_enabled">Optimalizace baterie je zapnutá</string>
|
||||
<string name="battery_optimizations_enabled_explained">Váš Android dělá na I2PD náročné optimalizace baterie, což by mohlo vést k uzavření I2PD služby bez jediného důvodu.\nDoporučuje se povolit vypnutí optimalizace baterie.</string>
|
||||
<string name="battery_optimizations_enabled_dialog">Váš Android dělá na I2PD náročné optimalizace baterie, což by mohlo vést k uzavření I2PD služby bez jediného důvodu.\n\nNyní budete požádáni o zakázání této optimalizace.</string>
|
||||
<string name="continue_str">Pokračovat</string>
|
||||
<string name="device_does_not_support_disabling_battery_optimizations">Vaše verze Androidu nepodporuje vypnutí optimalizace baterie</string>
|
||||
<string name="os_version_does_not_support_battery_optimizations_show_os_dialog_api">Vaše verze Android OS nepodporuje zobrazování dialogových oken pro optimalizaci baterie pro aplikace.</string>
|
||||
<string name="shutdown_canceled">Plánované vypnutí zrušeno</string>
|
||||
<string name="tunnels_reloading">Obnovuji konfiguraci tunelů...</string>
|
||||
<string name="settings_section0">Základní nastavení</string>
|
||||
<string name="settings_section_tunnels">Tunely</string>
|
||||
<string name="autostart_enabled">Spustit při spuštění systému</string>
|
||||
<string name="add_tunnel_button">Přidat tunel</string>
|
||||
<string name="add_tunnel">Správa tunelů</string>
|
||||
<string name="del_tunnel_button">Smazat tunel</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,9 @@
|
||||
<b>I2P</b> (Invisible Internet Protocol) je univerzální anonymní síťová vrstva.
|
||||
Veškerá komunikace přes I2P je anonymní a end-to-end šifrována, účastníci neodhalí své skutečné IP adresy.
|
||||
|
||||
<b>I2P klient</b> je software používaný pro vytváření a používání anonymních I2P sítí.
|
||||
Tyto sítě se běžně používají pro anonymní aplikace typu peer-to-peer (sdílení souborů, kryptoměny) a anonymní aplikace typu klient-server (webové stránky, instantní messengery, chat-servery).
|
||||
|
||||
<b>I2P</b> umožňuje lidem z celého světa komunikovat a sdílet informace bez omezení.
|
||||
|
||||
Pro více informací o <b>I2P</b> si můžete přečíst <a href="https://en.m.wikipedia.org/wiki/I2P">článek na Wikipedii</a>.
|
||||
@@ -0,0 +1 @@
|
||||
Kompletní C++ implementace I2P klienta
|
||||
@@ -0,0 +1,4 @@
|
||||
* Updated codebase to 2.45.0
|
||||
* Buildtools 32, target SDK 32, NDK 23c
|
||||
* Switch to Boost 1.78.0
|
||||
* Added Czech translation
|
||||
@@ -0,0 +1 @@
|
||||
* Fix storage access issue on Android 11+
|
||||
Reference in New Issue
Block a user