mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-05 18:25:31 +08:00
Fixed: Fix proguard removing JNI used methods for release builds
``` Exception in createServerSocketNative(): java.lang.NoSuchMethodError: no non-static method "Lcom/termux/shared/jni/models/JniResult;.<init>(IILjava/lang/String;I)V" at com.termux.shared.net.socket.local.LocalSocketManager.createServerSocketNative(Native Method) at com.termux.shared.net.socket.local.LocalSocketManager.createServerSocket(LocalSocketManager.java:125) at com.termux.shared.net.socket.local.LocalServerSocket.start(LocalServerSocket.java:100) at com.termux.shared.net.socket.local.LocalSocketManager.start(LocalSocketManager.java:84) at com.termux.shared.shell.am.AmSocketServer.start(AmSocketServer.java:68) at com.termux.shared.termux.shell.am.TermuxAmSocketServer.start(TermuxAmSocketServer.java:101) at com.termux.shared.termux.shell.am.TermuxAmSocketServer.setupTermuxAmSocketServer(TermuxAmSocketServer.java:77) at com.termux.app.TermuxApplication.onCreate(TermuxApplication.java:53) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6719) at android.app.ActivityThread.access$1300(ActivityThread.java:237) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7664) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) ```
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.termux.shared.jni.models;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.termux.shared.logger.Logger;
|
||||
@@ -11,6 +12,7 @@ import com.termux.shared.logger.Logger;
|
||||
* https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html
|
||||
* https://developer.android.com/training/articles/perf-jni
|
||||
*/
|
||||
@Keep
|
||||
public class JniResult {
|
||||
|
||||
/**
|
||||
|
@@ -2,6 +2,7 @@ package com.termux.shared.net.socket.local;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.termux.shared.android.ProcessUtils;
|
||||
@@ -10,6 +11,7 @@ import com.termux.shared.logger.Logger;
|
||||
import com.termux.shared.markdown.MarkdownUtils;
|
||||
|
||||
/** The {@link PeerCred} of the {@link LocalClientSocket} containing info of client/peer. */
|
||||
@Keep
|
||||
public class PeerCred {
|
||||
|
||||
public static final String LOG_TAG = "PeerCred";
|
||||
|
Reference in New Issue
Block a user