Browse Source

Fix #50

pull/62/head
nonlin-lin-chaos-order-etc-etal 8 months ago
parent
commit
c875709a81
  1. 1
      .gitignore
  2. 8
      README.md
  3. 18
      app/build.gradle
  4. 76
      app/src/main/java/org/purplei2p/i2pd/DaemonWrapper.java
  5. 41
      app/src/main/java/org/purplei2p/i2pd/I2PDActivity.java
  6. 35
      app/src/main/java/org/purplei2p/i2pd/I2PD_JNI.java
  7. 99
      app/src/main/java/org/purplei2p/i2pd/I2pdApi.java
  8. 2
      app/src/main/java/org/purplei2p/i2pd/NetworkStateChangeReceiver.java
  9. 8
      app/src/main/java/org/purplei2p/i2pd/SettingsActivity.java
  10. 2
      app/src/main/java/org/purplei2p/i2pd/WebConsoleActivity.java
  11. 1182
      app/src/main/java/org/purplei2p/i2pd/iniedotr/IniEditor.java
  12. 4
      app/src/main/res/layout/activity_main.xml
  13. 9
      app/src/main/res/values/strings.xml
  14. 20
      binary/jni/README.md
  15. 9
      binary/jni/build_all.sh
  16. 10
      binary/jni/ndkbuild-wrapper.sh
  17. 6
      gradle/wrapper/gradle-wrapper.properties

1
.gitignore vendored

@ -17,3 +17,4 @@ build @@ -17,3 +17,4 @@ build
*.local
*.jks
.vscode
**/tmp*

8
README.md

@ -18,7 +18,7 @@ This repository contains Android application sources of i2pd @@ -18,7 +18,7 @@ This repository contains Android application sources of i2pd
sudo apt-get install g++ openjdk-11-jdk gradle
```
If your system provides gradle with version < 5.1, download it from gradle homepage:
If your system provides gradle with version &lt; 5.1, download it from gradle homepage:
https://gradle.org/install/
@ -54,10 +54,8 @@ export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 @@ -54,10 +54,8 @@ export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export ANDROID_HOME=/opt/android-sdk
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313
pushd app/jni
./build_boost.sh
./build_openssl.sh
./build_miniupnpc.sh
pushd binary/jni
./build_all.sh
popd
gradle clean assembleDebug

18
app/build.gradle

@ -28,8 +28,15 @@ android { @@ -28,8 +28,15 @@ android {
externalNativeBuild {
ndkBuild {
arguments "NDK_MODULE_PATH:=${rootProject.projectDir}/app/jni"
arguments "NDK_MODULE_PATH:=${rootProject.projectDir}/binary/jni"
arguments "-j${Runtime.getRuntime().availableProcessors()}"
arguments 'V=1'
//targets
// You need to configure this executable and its sources in your
// Android.mk file like you would any other library, except you must
// specify "include $(BUILD_EXECUTABLE)". Building executables from
// your native sources is optional, and building native libraries to
// package into your APK satisfies most project requirements.
}
}
}
@ -59,16 +66,19 @@ android { @@ -59,16 +66,19 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
debug {
jniDebuggable = true
}
}
externalNativeBuild {
ndkBuild {
path "${rootProject.projectDir}/app/jni/Android.mk"
path "${rootProject.projectDir}/binary/jni/Android.mk"
}
}
sourceSets {
main {
jniLibs.srcDir file("${rootProject.projectDir}/binary/libs")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

76
app/src/main/java/org/purplei2p/i2pd/DaemonWrapper.java

@ -13,6 +13,7 @@ import java.util.Set; @@ -13,6 +13,7 @@ import java.util.Set;
import java.util.Locale;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.AssetManager;
import android.net.ConnectivityManager;
import android.net.Network;
@ -32,7 +33,9 @@ public class DaemonWrapper { @@ -32,7 +33,9 @@ public class DaemonWrapper {
private String i2pdpath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/i2pd";
private boolean assetsCopied;
private static final String appLocale = Locale.getDefault().getDisplayLanguage(Locale.ENGLISH).toLowerCase(); // lower-case system language (like "english")
private String getAppLocale() {
return Locale.getDefault().getDisplayLanguage(Locale.ENGLISH).toLowerCase(); // lower-case system language (like "english")
}
public interface StateUpdateListener {
void daemonStateUpdate(State oldValue, State newValue);
@ -67,25 +70,25 @@ public class DaemonWrapper { @@ -67,25 +70,25 @@ public class DaemonWrapper {
public synchronized void stopAcceptingTunnels() {
if (isStartedOkay()) {
setState(State.gracefulShutdownInProgress);
I2PD_JNI.stopAcceptingTunnels();
I2pdApi.stopAcceptingTunnels();
}
}
public synchronized void startAcceptingTunnels() {
if (isStartedOkay()) {
setState(State.startedOkay);
I2PD_JNI.startAcceptingTunnels();
I2pdApi.startAcceptingTunnels();
}
}
public synchronized void reloadTunnelsConfigs() {
if (isStartedOkay()) {
I2PD_JNI.reloadTunnelsConfigs();
I2pdApi.reloadTunnelsConfigs();
}
}
public int getTransitTunnelsCount() {
return I2PD_JNI.getTransitTunnelsCount();
return I2pdApi.getTransitTunnelsCount();
}
public enum State {
@ -117,11 +120,11 @@ public class DaemonWrapper { @@ -117,11 +120,11 @@ public class DaemonWrapper {
return state;
}
public DaemonWrapper(AssetManager assetManager, ConnectivityManager connectivityManager){
public DaemonWrapper(Context ctx, AssetManager assetManager, ConnectivityManager connectivityManager){
this.assetManager = assetManager;
this.connectivityManager = connectivityManager;
setState(State.starting);
startDaemon();
startDaemon(ctx);
}
private Throwable lastThrowable;
@ -146,16 +149,6 @@ public class DaemonWrapper { @@ -146,16 +149,6 @@ public class DaemonWrapper {
return daemonStartResult;
}
public static String getDataDir() { // for settings iniEditor
return I2PD_JNI.getDataDir();
}
public void changeDataDir(String dataDir, Boolean updateAssets) {
I2PD_JNI.setDataDir(dataDir);
if (updateAssets) processAssets();
//ToDo: move old dir to new dir?
}
public boolean isStartedOkay() {
return getState().isStartedOkay();
}
@ -163,19 +156,18 @@ public class DaemonWrapper { @@ -163,19 +156,18 @@ public class DaemonWrapper {
public synchronized void stopDaemon() {
if (isStartedOkay()) {
try {
I2PD_JNI.stopDaemon();
I2pdApi.stopDaemon();
} catch (Throwable tr) {
Log.e(TAG, "", tr);
}
setState(State.stopped);
}
}
public synchronized void startDaemon() {
public synchronized void startDaemon(Context ctx) {
if( getState() != State.stopped && getState() != State.starting ) return;
new Thread(() -> {
try {
processAssets();
I2PD_JNI.loadLibraries();
//registerNetworkCallback();
} catch (Throwable tr) {
lastThrowable = tr;
@ -184,12 +176,10 @@ public class DaemonWrapper { @@ -184,12 +176,10 @@ public class DaemonWrapper {
}
try {
synchronized (DaemonWrapper.this) {
I2PD_JNI.setDataDir(i2pdpath); // (Environment.getExternalStorageDirectory().getAbsolutePath() + "/i2pd");
Log.i(TAG, "setting webconsole language to " + appLocale);
I2PD_JNI.setLanguage(appLocale);
String locale = getAppLocale();
Log.i(TAG, "setting webconsole language to " + locale);
daemonStartResult = I2PD_JNI.startDaemon();
daemonStartResult = I2pdApi.startDaemon(ctx, i2pdpath, locale);
if ("ok".equals(daemonStartResult)) {
setState(State.startedOkay);
} else
@ -209,31 +199,13 @@ public class DaemonWrapper { @@ -209,31 +199,13 @@ public class DaemonWrapper {
Log.d(TAG, "checking assets");
if (holderFile.exists()) {
try { // if holder file exists, read assets version string
FileReader fileReader = new FileReader(holderFile);
try {
BufferedReader br = new BufferedReader(fileReader);
try {
try (FileReader fileReader = new FileReader(holderFile)) { // if holder file exists, read assets version string
try (BufferedReader br = new BufferedReader(fileReader)) {
String line;
while ((line = br.readLine()) != null) {
text.append(line);
}
}finally {
try {
br.close();
} catch (IOException e) {
Log.e(TAG, "", e);
}
}
} finally {
try {
fileReader.close();
} catch (IOException e) {
Log.e(TAG, "", e);
}
}
} catch (IOException e) {
Log.e(TAG, "", e);
@ -258,15 +230,9 @@ public class DaemonWrapper { @@ -258,15 +230,9 @@ public class DaemonWrapper {
copyAsset("tunnels.conf");
// update holder file about successful copying
FileWriter writer = new FileWriter(holderFile);
try {
;
try (FileWriter writer = new FileWriter(holderFile)) {
writer.append(versionName);
} finally {
try {
writer.close();
} catch (IOException e) {
Log.e(TAG,"on writer close", e);
}
}
}
catch (Throwable tr)
@ -372,14 +338,14 @@ public class DaemonWrapper { @@ -372,14 +338,14 @@ public class DaemonWrapper {
@Override
public void onAvailable(Network network) {
super.onAvailable(network);
I2PD_JNI.onNetworkStateChanged(true);
I2pdApi.onNetworkStateChanged(true);
Log.d(TAG, "NetworkCallback.onAvailable");
}
@Override
public void onLost(Network network) {
super.onLost(network);
I2PD_JNI.onNetworkStateChanged(false);
I2pdApi.onNetworkStateChanged(false);
Log.d(TAG, " NetworkCallback.onLost");
}
}

41
app/src/main/java/org/purplei2p/i2pd/I2PDActivity.java

@ -45,11 +45,11 @@ public class I2PDActivity extends Activity { @@ -45,11 +45,11 @@ public class I2PDActivity extends Activity {
public static final String PACKAGE_URI_SCHEME = "package:";
private TextView textView;
private CheckBox HTTPProxyState;
private CheckBox SOCKSProxyState;
private CheckBox BOBState;
private CheckBox SAMState;
private CheckBox I2CPState;
// private CheckBox HTTPProxyState;
// private CheckBox SOCKSProxyState;
// private CheckBox BOBState;
// private CheckBox SAMState;
// private CheckBox I2CPState;
private static volatile DaemonWrapper daemon;
@ -75,13 +75,13 @@ public class I2PDActivity extends Activity { @@ -75,13 +75,13 @@ public class I2PDActivity extends Activity {
DaemonWrapper.State state = daemon.getState();
if (daemon.isStartedOkay()) {
HTTPProxyState.setChecked(I2PD_JNI.getHTTPProxyState());
SOCKSProxyState.setChecked(I2PD_JNI.getSOCKSProxyState());
BOBState.setChecked(I2PD_JNI.getBOBState());
SAMState.setChecked(I2PD_JNI.getSAMState());
I2CPState.setChecked(I2PD_JNI.getI2CPState());
}
// if (daemon.isStartedOkay()) {
// HTTPProxyState.setChecked(I2pdApi.getHTTPProxyState());
// SOCKSProxyState.setChecked(I2pdApi.getSOCKSProxyState());
// BOBState.setChecked(I2pdApi.getBOBState());
// SAMState.setChecked(I2pdApi.getSAMState());
// I2CPState.setChecked(I2pdApi.getI2CPState());
// }
String startResultStr = DaemonWrapper.State.startFailed.equals(state) ? String.format(": %s", daemon.getDaemonStartResult()) : "";
String graceStr = DaemonWrapper.State.gracefulShutdownInProgress.equals(state) ? String.format(": %s %s", formatGraceTimeRemaining(), getText(R.string.remaining)) : "";
@ -113,15 +113,15 @@ public class I2PDActivity extends Activity { @@ -113,15 +113,15 @@ public class I2PDActivity extends Activity {
setContentView(R.layout.activity_main);
textView = (TextView) findViewById(R.id.appStatusText);
HTTPProxyState = (CheckBox) findViewById(R.id.service_httpproxy_box);
SOCKSProxyState = (CheckBox) findViewById(R.id.service_socksproxy_box);
BOBState = (CheckBox) findViewById(R.id.service_bob_box);
SAMState = (CheckBox) findViewById(R.id.service_sam_box);
I2CPState = (CheckBox) findViewById(R.id.service_i2cp_box);
// HTTPProxyState = (CheckBox) findViewById(R.id.service_httpproxy_box);
// SOCKSProxyState = (CheckBox) findViewById(R.id.service_socksproxy_box);
// BOBState = (CheckBox) findViewById(R.id.service_bob_box);
// SAMState = (CheckBox) findViewById(R.id.service_sam_box);
// I2CPState = (CheckBox) findViewById(R.id.service_i2cp_box);
if (daemon == null) {
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
daemon = new DaemonWrapper(getAssets(), connectivityManager);
daemon = new DaemonWrapper(getApplicationContext(), getAssets(), connectivityManager);
}
ForegroundService.init(daemon);
@ -261,6 +261,8 @@ public class I2PDActivity extends Activity { @@ -261,6 +261,8 @@ public class I2PDActivity extends Activity {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.options_main, menu);
menu.findItem(R.id.action_battery_otimizations).setVisible(isBatteryOptimizationsOpenOsDialogApiAvailable());
//TODO
menu.findItem(R.id.action_reload_tunnels_config).setVisible(false);
this.optionsMenu = menu;
return true;
}
@ -295,6 +297,7 @@ public class I2PDActivity extends Activity { @@ -295,6 +297,7 @@ public class I2PDActivity extends Activity {
return true;
case R.id.action_reload_tunnels_config:
//TODO
onReloadTunnelsConfig();
return true;
@ -302,7 +305,7 @@ public class I2PDActivity extends Activity { @@ -302,7 +305,7 @@ public class I2PDActivity extends Activity {
if(daemon.isStartedOkay())
startActivity(new Intent(getApplicationContext(), WebConsoleActivity.class));
else
Toast.makeText(this,"I2Pd not was started!", Toast.LENGTH_SHORT).show();
Toast.makeText(this, R.string.error_i2pd_not_running, Toast.LENGTH_SHORT).show();
return true;
case R.id.action_settings:
startActivity(new Intent(getApplicationContext(), SettingsActivity.class));

35
app/src/main/java/org/purplei2p/i2pd/I2PD_JNI.java

@ -1,35 +0,0 @@ @@ -1,35 +0,0 @@
package org.purplei2p.i2pd;
public class I2PD_JNI {
public static native String getABICompiledWith();
public static void loadLibraries() {
System.loadLibrary("i2pd");
}
/**
* returns error info if failed
* returns "ok" if daemon initialized and started okay
*/
public static native String startDaemon();
public static native void stopDaemon();
public static native void startAcceptingTunnels();
public static native void stopAcceptingTunnels();
public static native void reloadTunnelsConfigs();
public static native void setDataDir(String jdataDir);
public static native void setLanguage(String jlanguage);
public static native int getTransitTunnelsCount();
public static native String getWebConsAddr();
public static native String getDataDir();
public static native boolean getHTTPProxyState();
public static native boolean getSOCKSProxyState();
public static native boolean getBOBState();
public static native boolean getSAMState();
public static native boolean getI2CPState();
public static native void onNetworkStateChanged(boolean isConnected);
}

99
app/src/main/java/org/purplei2p/i2pd/I2pdApi.java

@ -0,0 +1,99 @@ @@ -0,0 +1,99 @@
package org.purplei2p.i2pd;
import android.content.Context;
import android.util.Log;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/** i2pd process API calls via TCP between the Android Java app and i2pd C++-only process.
* TODO
*/
public class I2pdApi {
private static String dataDir;
private static Process i2pdProcess;
private static final String TAG = "I2pdApi";
/**
* returns error info if failed
* returns "ok" if daemon initialized and started okay
*/
public static String startDaemon(Context ctx, String dataDir, String language){
try {
I2pdApi.dataDir = dataDir;
Process p = I2pdApi.i2pdProcess = Runtime.getRuntime().exec(new String[] {
ctx.getApplicationInfo().nativeLibraryDir+"/libi2pd.so",
"--datadir="+dataDir
});
new Thread(() -> {
try {
try (BufferedInputStream bis = new BufferedInputStream(p.getInputStream())) {
try (InputStreamReader sr = new InputStreamReader(bis)) {
try (BufferedReader r = new BufferedReader(sr)) {
while(true){
String s = r.readLine();
if (s == null) break;
Log.i(TAG, s);
}
}
}
}
}catch(Throwable tr){
Log.e(TAG, "", tr);
}
}, "i2pd-stdout");
new Thread(() -> {
try {
try (BufferedInputStream bis = new BufferedInputStream(p.getErrorStream())) {
try (InputStreamReader sr = new InputStreamReader(bis)) {
try (BufferedReader r = new BufferedReader(sr)) {
while(true){
String s = r.readLine();
if (s == null) break;
Log.i(TAG, s);
}
}
}
}
}catch(Throwable tr){
Log.e(TAG, "", tr);
}
}, "i2pd-stderr");
return "ok";
} catch (Throwable tr) {
Log.e(TAG, "", tr);
return "Error in exec(): " + tr;
}
}
public static void stopDaemon(){
Process p = i2pdProcess;
if (p != null) {
try {
p.destroy();
} catch (Throwable tr) {
Log.e(TAG, "", tr);
}
i2pdProcess = null;
}
}
public static void startAcceptingTunnels(){}
public static void stopAcceptingTunnels(){}
public static void reloadTunnelsConfigs(){}
public static int getTransitTunnelsCount(){return -1;}
public static String getWebConsAddr(){return "";}
public static String getDataDir() {
return dataDir;
}
public static boolean getHTTPProxyState(){return false;}
public static boolean getSOCKSProxyState(){return false;}
public static boolean getBOBState(){return false;}
public static boolean getSAMState(){return false;}
public static boolean getI2CPState(){return false;}
public static void onNetworkStateChanged(boolean isConnected){}
}

2
app/src/main/java/org/purplei2p/i2pd/NetworkStateChangeReceiver.java

@ -19,7 +19,7 @@ public class NetworkStateChangeReceiver extends BroadcastReceiver { @@ -19,7 +19,7 @@ public class NetworkStateChangeReceiver extends BroadcastReceiver {
NetworkInfo activeNetworkInfo = cm.getActiveNetworkInfo();
boolean isConnected = activeNetworkInfo != null && activeNetworkInfo.isConnected();
I2PD_JNI.onNetworkStateChanged(isConnected);
I2pdApi.onNetworkStateChanged(isConnected);
} catch (Throwable tr) {
Log.e(TAG, "", tr);
}

8
app/src/main/java/org/purplei2p/i2pd/SettingsActivity.java

@ -18,11 +18,9 @@ import java.util.List; @@ -18,11 +18,9 @@ import java.util.List;
import java.util.Objects;
//import org.purplei2p.i2pd.iniedotr.IniEditor;
public class SettingsActivity extends Activity {
//protected IniEditor iniedit = new IniEditor();
private String TAG = "i2pdSrvcSettings";
private static final String TAG = "i2pdSttngs";
private File cacheDir;
public static String onBootFileName = "/onBoot"; // just file, empty, if exist the do autostart, if not then no.
@ -59,7 +57,7 @@ public class SettingsActivity extends Activity { @@ -59,7 +57,7 @@ public class SettingsActivity extends Activity {
startActivity(intent);
}
} catch (Exception e) {
Log.e("exceptionAutostarti2pd" , String.valueOf(e));
Log.e("Autostarti2pd" , "", e);
}
}
@ -99,7 +97,7 @@ public class SettingsActivity extends Activity { @@ -99,7 +97,7 @@ public class SettingsActivity extends Activity {
if (!onBoot.createNewFile())
Log.d(TAG, "Cant create new wile on: "+onBoot.getAbsolutePath());
} catch (Exception e) {
Log.e(TAG, "error: " + e.toString());
Log.e(TAG, "", e);
}
}
} else {

2
app/src/main/java/org/purplei2p/i2pd/WebConsoleActivity.java

@ -27,7 +27,7 @@ public class WebConsoleActivity extends Activity { @@ -27,7 +27,7 @@ public class WebConsoleActivity extends Activity {
final WebSettings webSettings = webView.getSettings();
webSettings.setBuiltInZoomControls(true);
webSettings.setJavaScriptEnabled(false);
webView.loadUrl(I2PD_JNI.getWebConsAddr());
webView.loadUrl(I2pdApi.getWebConsAddr());
swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {

1182
app/src/main/java/org/purplei2p/i2pd/iniedotr/IniEditor.java

File diff suppressed because it is too large Load Diff

4
app/src/main/res/layout/activity_main.xml

@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
<Space
android:layout_width="match_parent"
android:layout_height="@dimen/margin_medium" />
<!--
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
@ -149,7 +149,7 @@ @@ -149,7 +149,7 @@
android:textColor="#DFDFDF" />
</TableRow>
</TableLayout>
-->
</LinearLayout>
</ScrollView>

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

@ -18,13 +18,13 @@ @@ -18,13 +18,13 @@
<string name="gracefulShutdownInProgress">Graceful shutdown in progress</string>
<string name="already_stopped">Already stopped</string>
<string name="uninitialized">Application initializing...</string>
<string name="starting">Application starting...</string>
<string name="uninitialized">Application initializing</string>
<string name="starting">Application starting</string>
<string name="jniLibraryLoaded">Loaded JNI libraries</string>
<string name="startedOkay">Application started</string>
<string name="startFailed">Start failed</string>
<string name="stopped">Application stopped</string>
<string name="stopping">Application stopping...</string>
<string name="stopping">Application stopping</string>
<string name="remaining">remaining</string>
<string name="ok" translatable="false">OK</string>
@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
<string name="shutdown_canceled">Planned shutdown canceled</string>
<string name="tunnels_reloading">Reloading tunnels config...</string>
<string name="tunnels_reloading">Reloading tunnels config</string>
<string name="settings_section0">Common settings</string>
<string name="settings_section_tunnels">Tunnels</string>
@ -60,5 +60,6 @@ @@ -60,5 +60,6 @@
<string name="add_tunnel">Tunnels management</string>
<string name="del_tunnel_button">Delete tunnel</string>
<string name="error_i2pd_not_running">Error: i2pd not running</string>
</resources>

20
binary/jni/README.md

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
# Android command line executable build instructions
1. Install ndk 23.2.8568313 into some directory, usually `ANDROID_SDK/ndk/23.2.8568313`.
2. Install cmake 3.19 or newer, e.g. for Unix:
```sh
wget -t0 https://github.com/Kitware/CMake/releases/download/v3.28.0/cmake-3.28.0.tar.gz && tar xzvf cmake-3.28.0.tar.gz && cd cmake-3.28.0 && ./configure && make -j$(nproc) && sudo make install
```
3. In the current working directory (the one with Android.mk and Application.mk), run:
```bash
# E.g, export ANDROID_NDK_HOME=/opt/android-sdk/ndk/23.2.8568313
export ANDROID_NDK_HOME=your_ndk_directory
./build_all.sh
```
Then, `../libs` will be populated with build executable files
(that are renamed to `*.so` for Gradle to put them into the APK).

9
binary/jni/build_all.sh

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
if [ -z "$ANDROID_NDK_HOME" -a "$ANDROID_NDK_HOME" == "" ]; then
echo -e "\033[31mFailed! ANDROID_NDK_HOME is empty. Run 'export ANDROID_NDK_HOME=[PATH_TO_NDK]'\033[0m"
exit 1
fi
./build_boost.sh
./build_miniupnpc.sh
./build_openssl.sh
export NDK_MODULE_PATH=`pwd` && export NDK_PROJECT_PATH=`pwd`/.. && ./ndkbuild-wrapper.sh V=1 NDK_LOG=1 -j`nproc`
echo "$0 completed."

10
binary/jni/ndkbuild-wrapper.sh

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
#!/usr/bin/env bash
cd $NDK_PROJECT_PATH/jni
$ANDROID_NDK_HOME/ndk-build $*
mkdir $NDK_PROJECT_PATH/libs
cd $NDK_PROJECT_PATH/libs
for f in $(ls .);
do
mv $f/i2pd $f/libi2pd.so
done

6
gradle/wrapper/gradle-wrapper.properties vendored

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#Tue Apr 02 16:43:23 IRKT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=8cc27038d5dbd815759851ba53e70cf62e481b87494cc97cfd97982ada5ba634
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

Loading…
Cancel
Save