Giter Club home page Giter Club logo

Comments (27)

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024 1

finally, its worked! thanks

from powertunnel-android.

krlvm avatar krlvm commented on May 23, 2024

I still have not released the plugin converter, which uses D8 to translate Java bytecode to bytecode compatible with Android Runtime and build classes.dex file.

I created a very dirty prototype two years ago with which I convert my own plugins, you can use it by executing

$ androidify filename.jar filename-Android.jar

I have plans to create a Gradle plugin which will do that in clean & automatic way, but I haven't found time to do it yet.

androidify.zip

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

I still have not released the plugin converter, which uses D8 to translate Java bytecode to bytecode compatible with Android Runtime and build classes.dex file.

I created a very dirty prototype two years ago with which I convert my own plugins, you can use it by executing

$ androidify filename.jar filename-Android.jar

I have plans to create a Gradle plugin which will do that in clean & automatic way, but I haven't found time to do it yet.

androidify.zip

when i run androidify filename.jar filename-Android.jar command, i didnt get output file, and i got message like this
5 was unexpected at this time.
i forgot to add JAVA_HOME sorry 😆

but, i got error like this

Compilation failed with an internal error.
java.lang.IllegalArgumentException: Unsupported class file major version 63
        at Version.fakeStackEntry(Version_2.1.7-r1.java:0)
        at com.android.tools.r8.A.a.a.f.<init>(:10)
        at com.android.tools.r8.A.a.a.f.<init>(:2)
        at com.android.tools.r8.A.a.a.f.<init>(:1)
        at com.android.tools.r8.A.a.a.f.<init>(:107)
        at com.android.tools.r8.graph.x0.a(:24)
        at com.android.tools.r8.utils.J.a(:9)
        at com.android.tools.r8.utils.G.a(:8)
        at com.android.tools.r8.utils.G.get(:1)
        at com.android.tools.r8.utils.H.a(:28)
        at com.android.tools.r8.graph.E0.definitionFor(:19)
        at com.android.tools.r8.graph.c.definitionFor(:16)
        at com.android.tools.r8.graph.c.a(:3)
        at com.android.tools.r8.graph.c.b(:6)
        at com.android.tools.r8.graph.c.definitionFor(:19)
        at com.android.tools.r8.ir.optimize.s0.d.a(:3)
        at com.android.tools.r8.ir.optimize.s0.d.b(:2)
        at com.android.tools.r8.ir.optimize.s0.c.<init>(:19)
        at com.android.tools.r8.graph.g.<init>(:54)
        at com.android.tools.r8.graph.g.a(:5)
        at com.android.tools.r8.D8.d(:29)
        at com.android.tools.r8.D8.c(:1)
        at com.android.tools.r8.utils.W.a(:30)
        at com.android.tools.r8.D8.a(:18)
        at com.android.tools.r8.D8.a(:15)
        at com.android.tools.r8.utils.W.a(:88)
        at com.android.tools.r8.D8.main(:5)

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

and then, i get error message box like this
(PowerTunnel-Hosts-1.1.jar build using computer)

image

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

is it problem in my JDK or not? my JDK version is = 19 (newest)

from powertunnel-android.

krlvm avatar krlvm commented on May 23, 2024

You should target JRE 1.8 in your plugin

Also keep in mind that new features from Java 8+ won't work on Android < 8

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

You should target JRE 1.8 in your plugin

Also keep in mind that new features from Java 8+ won't work on Android < 8

how do i set target jre 1.8?

and then, i should use jdk 8 or older?

from powertunnel-android.

krlvm avatar krlvm commented on May 23, 2024

This is a trivial thing: https://github.com/krlvm/PowerTunnel/blob/7dff06e74ea65befe618adc845c8a4cfb3d9985a/build.gradle#L31

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

This is a trivial thing: https://github.com/krlvm/PowerTunnel/blob/7dff06e74ea65befe618adc845c8a4cfb3d9985a/build.gradle#L31

oh okay okay, and then, should i use jdk (openjdk) 8 or older?

from powertunnel-android.

krlvm avatar krlvm commented on May 23, 2024

You just need to add these lines to your build.gradle or decrease SDK level in IntelliJ if you use its build system

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

You just need to add these lines to your build.gradle or decrease SDK level in IntelliJ if you use its build system

oh okay thanks, ill try it later

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

i want to try build the plugin using android phone, but i get this error

Screenshot_2023-02-14-00-31-33-44_568ed85dd9b4e5f606052ed6d65243e4

do you know how to fix

sorry if i bothering you
and thanks for the fast respond

from powertunnel-android.

krlvm avatar krlvm commented on May 23, 2024

Weird, it can't resolve gitRepositories method I used to add the upstream PowerTunnel repository as library.

Could be a problem related to the environment you are trying to build on, are you sure the Gradle version >= 6.8?
If it still fails, I'd suggest to build on Windows/Linux, I've downloaded the Hosts plugin sources and built it within a minute without problems.

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

oh, my gradle version is 4.4.1

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

i just updated to gradle versio 6.4, the gitRepository() it working, but i got this error again

Screenshot_2023-02-14-00-54-50-93_568ed85dd9b4e5f606052ed6d65243e4

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

and i just update to 6.8.2, and still i got that same error could not populate working directory

from powertunnel-android.

krlvm avatar krlvm commented on May 23, 2024

Do you have git installed?
I think it would be easier to build on PC.

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

Do you have git installed? I think it would be easier to build on PC.

already

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

but i got that error idk why

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

Screenshot_2023-02-14-06-36-55-41_568ed85dd9b4e5f606052ed6d65243e4
finally, it worked!

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

hmmmm... still same, maybe i need to target jre 1.8?

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

still doesnt work, even i set target jre 1.8
Screenshot_2023-02-14-07-04-59-61_568ed85dd9b4e5f606052ed6d65243e4

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

i try to check the app log using adb logcat
and i get this

02-14 09:14:06.519 26489 26450 D ProxyManager: Starting server...
02-14 09:14:06.521 26489 26450 W ziparchive: Unable to open '/data/user/0/io.github.krlvm.powertunnel.android/files/plugins/PowerTunnel-Hosts-1.1 (3).dm': No such file or directory
02-14 09:14:06.521 26489 26450 W rtunnel.androi: Entry not found
02-14 09:14:06.521 26489 26450 E ProxyManager: Failed to start server: Can't load plugin main class (PowerTunnel-Hosts-1.1 (3).jar)
02-14 09:14:06.521 26489 26450 E ProxyManager: io.github.krlvm.powertunnel.sdk.exceptions.PluginLoadException: Can't load plugin main class (PowerTunnel-Hosts-1.1 (3).jar) (PowerTunnel-Hosts-1.1 (3).jar)
02-14 09:14:06.521 26489 26450 E ProxyManager: 	at io.github.krlvm.powertunnel.plugin.PluginLoader.loadPlugin(PluginLoader.java:142)
02-14 09:14:06.521 26489 26450 E ProxyManager: 	at io.github.krlvm.powertunnel.plugin.PluginLoader.loadPlugins(PluginLoader.java:78)
02-14 09:14:06.521 26489 26450 E ProxyManager: 	at io.github.krlvm.powertunnel.android.managers.ProxyManager.lambda$start$0$io-github-krlvm-powertunnel-android-managers-ProxyManager(ProxyManager.java:122)
02-14 09:14:06.521 26489 26450 E ProxyManager: 	at io.github.krlvm.powertunnel.android.managers.ProxyManager$$ExternalSyntheticLambda0.run(Unknown Source:2)
02-14 09:14:06.521 26489 26450 E ProxyManager: 	at java.lang.Thread.run(Thread.java:1012)
02-14 09:14:06.521 26489 26450 E ProxyManager: Caused by: java.lang.ClassNotFoundException: Didn't find class "io.github.krlvm.powertunnel.plugins.hosts.HostsPlugin" on path: DexPathList[[zip file "/data/user/0/io.github.krlvm.powertunnel.android/files/plugins/PowerTunnel-Hosts-1.1 (3).jar"],nativeLibraryDirectories=[/system/lib64, /system_ext/lib64]]
02-14 09:14:06.521 26489 26450 E ProxyManager: 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
02-14 09:14:06.521 26489 26450 E ProxyManager: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
02-14 09:14:06.521 26489 26450 E ProxyManager: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
02-14 09:14:06.521 26489 26450 E ProxyManager: 	at io.github.krlvm.powertunnel.android.plugin.AndroidPluginLoader.inject(AndroidPluginLoader.java:49)
02-14 09:14:06.521 26489 26450 E ProxyManager: 	at io.github.krlvm.powertunnel.plugin.PluginLoader.loadPlugin(PluginLoader.java:138)
02-14 09:14:06.521 26489 26450 E ProxyManager: 	... 4 more
02-14 09:14:06.521 26489 26450 E ProxyManager: 	Suppressed: java.io.IOException: Failed to open dex files from /data/user/0/io.github.krlvm.powertunnel.android/files/plugins/PowerTunnel-Hosts-1.1 (3).jar because: Entry not found
02-14 09:14:06.521 26489 26450 E ProxyManager: 		at dalvik.system.DexFile.openDexFileNative(Native Method)
02-14 09:14:06.521 26489 26450 E ProxyManager: 		at dalvik.system.DexFile.openDexFile(DexFile.java:371)
02-14 09:14:06.521 26489 26450 E ProxyManager: 		at dalvik.system.DexFile.<init>(DexFile.java:113)
02-14 09:14:06.521 26489 26450 E ProxyManager: 		at dalvik.system.DexFile.<init>(DexFile.java:86)
02-14 09:14:06.521 26489 26450 E ProxyManager: 		at dalvik.system.DexPathList.loadDexFile(DexPathList.java:438)
02-14 09:14:06.521 26489 26450 E ProxyManager: 		at dalvik.system.DexPathList.makeDexElements(DexPathList.java:397)
02-14 09:14:06.521 26489 26450 E ProxyManager: 		at dalvik.system.DexPathList.<init>(DexPathList.java:166)
02-14 09:14:06.521 26489 26450 E ProxyManager: 		at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:160)
02-14 09:14:06.521 26489 26450 E ProxyManager: 		at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:105)
02-14 09:14:06.521 26489 26450 E ProxyManager: 		at dalvik.system.DexClassLoader.<init>(DexClassLoader.java:55)
02-14 09:14:06.521 26489 26450 E ProxyManager: 		at io.github.krlvm.powertunnel.android.plugin.AndroidPluginLoader.inject(AndroidPluginLoader.java:47)
02-14 09:14:06.521 26489 26450 E ProxyManager: 		... 5 more
02-14 09:14:06.521 26489 26450 W ProxyService: Proxy Server could not start, stopping...
0

from powertunnel-android.

krlvm avatar krlvm commented on May 23, 2024

You forgot to convert it to Android format

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

You forgot to convert it to Android format

oohhhh, so, i need convert all class to classes.dex?

from powertunnel-android.

krlvm avatar krlvm commented on May 23, 2024

Yes, you just need to call D8 like androidify.cmd does in the my previous reply -#141 (comment) - the shell script I attached requires Windows, but techicially you can rewrite its commands to execute in your environment.

from powertunnel-android.

GuckTubeYT avatar GuckTubeYT commented on May 23, 2024

script I attached requires Windows, but techicially you can rewrite its commands to execute

Oh okay okay, thanks

from powertunnel-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.