Commit Graph

177 Commits

Author SHA1 Message Date
dependabot[bot]
ad7bd7eed6
Bump com.android.tools.build:gradle from 7.4.0 to 7.4.1 (#208)
Bumps com.android.tools.build:gradle from 7.4.0 to 7.4.1.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-02 02:19:20 +02:00
Twaik Yont
9174992b5d Fixed appearing of additional keyboard when no software keyboard is shown. Fixes #188
Stub screen when no client is connected...
Fixing linter warnings about `onPictureInPictureModeChanged`
2023-02-02 02:09:23 +02:00
Twaik Yont
92605729cc Setting the touchpad mode as default due to the fact that in most cases it is not usable. 2023-02-01 18:59:54 +02:00
Twaik Yont
3e9e9a2cb9 From now we can capture Alt+Tab, Alt+F4, Meta+smth key combinations on Dex-compatible devices... 2023-02-01 18:51:03 +02:00
Twaik Yont
cc9553524a Disabling annoying toast message and disabling annoying PIP mode... 2023-02-01 17:28:22 +02:00
Twaik Yont
09a0fca185 Fixes #40 2023-02-01 17:17:53 +02:00
Twaik Yont
13718d94cf Still preparing renderer to work with GLSurfaceView...
Fixes #98
2023-02-01 17:07:10 +02:00
Twaik Yont
336077033e Basic code for GettingStarted screen from @agnostic-apollo . 2023-02-01 02:50:11 +02:00
Twaik Yont
caa1edc690 Making everything snake case... 2023-02-01 01:17:06 +02:00
Twaik Yont
4a37640b5c Cleaning up and preparing renderer to work with GLSurfaceView 2023-01-31 23:52:03 +02:00
polkaulfield
9de5f2f0de
Added a fullscreen toggle. (#206)
* Added a setting to enable immersive fullscreen on the device display.
Co-authored-by: Twaik Yont <twaikyont@gmail.com>
2023-01-31 23:30:17 +02:00
Twaik Yont
56fdbe2cde Updating API of native part. Part 4. Cleaning up. 2023-01-31 20:39:18 +02:00
Twaik Yont
34ebec1476 Updating API of native part. Part 4. Cleaning up. 2023-01-31 20:32:26 +02:00
Twaik Yont
f9e6a8d2ab Updating API of native part. Part 3. Wayland compositor and surface APIs. 2023-01-31 20:01:43 +02:00
Twaik Yont
be07eab2a4 Updating API of native part. Part 2. Wayland shell and output APIs. 2023-01-31 17:19:35 +02:00
Twaik Yont
bae01ab655 Updating API of native part. Part 1. Makefiles and wayland seat api. 2023-01-31 15:46:12 +02:00
Twaik Yont
1a9146a3f7 Updating API of native part. Part 1. Wayland C++ API and it's generator. 2023-01-31 08:56:29 +02:00
Twaik Yont
5b73f8f497 Getting rid of xkbcommon and xkb-config. In current form they are useless. Preparing to replace them with xcb client tracking current layout. 2023-01-30 06:04:34 +02:00
dependabot[bot]
f36c19da8e
Bump gradle from 7.3.1 to 7.4.0 (#194)
Bumps gradle from 7.3.1 to 7.4.0.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 15:03:45 +02:00
dependabot[bot]
fc9cb2b8b6
Bump runner from 1.5.1 to 1.5.2 (#192)
Bumps runner from 1.5.1 to 1.5.2.

---
updated-dependencies:
- dependency-name: androidx.test:runner
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 15:03:32 +02:00
dependabot[bot]
e51d88d488
Bump espresso-core from 3.5.0 to 3.5.1 (#191)
Bumps espresso-core from 3.5.0 to 3.5.1.

---
updated-dependencies:
- dependency-name: androidx.test.espresso:espresso-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 15:01:53 +02:00
github-actions[bot]
626bf01e95
Update Gradle Wrapper from 7.5.1 to 7.6. (#184)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>

Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2022-12-03 11:10:13 +02:00
dependabot[bot]
b928ab75d7
Bump runner from 1.5.0 to 1.5.1 (#174)
Bumps runner from 1.5.0 to 1.5.1.

---
updated-dependencies:
- dependency-name: androidx.test:runner
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-10 15:39:07 +02:00
dependabot[bot]
5d1881d05b
Bump espresso-core from 3.4.0 to 3.5.0 (#172)
Bumps espresso-core from 3.4.0 to 3.5.0.

---
updated-dependencies:
- dependency-name: androidx.test.espresso:espresso-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-09 13:04:24 +02:00
dependabot[bot]
e9a931c548
Bump runner from 1.4.0 to 1.5.0 (#173)
Bumps runner from 1.4.0 to 1.5.0.

---
updated-dependencies:
- dependency-name: androidx.test:runner
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-09 13:00:49 +02:00
dependabot[bot]
761d4bbc60
Bump ReactiveCircus/android-emulator-runner from 2.19.0 to 2.27.0 (#169)
Bumps [ReactiveCircus/android-emulator-runner](https://github.com/ReactiveCircus/android-emulator-runner) from 2.19.0 to 2.27.0.
- [Release notes](https://github.com/ReactiveCircus/android-emulator-runner/releases)
- [Changelog](https://github.com/ReactiveCircus/android-emulator-runner/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ReactiveCircus/android-emulator-runner/compare/v2.19.0...v2.27.0)

---
updated-dependencies:
- dependency-name: ReactiveCircus/android-emulator-runner
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-07 01:42:16 +00:00
dependabot[bot]
e78369068f
Bump actions/upload-artifact from 2 to 3 (#170)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-07 01:42:04 +00:00
dependabot[bot]
d7ba8b429c
Bump actions/checkout from 2 to 3 (#168)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-07 01:41:46 +00:00
dependabot[bot]
78ed039ba4
Bump gradle from 7.3.0 to 7.3.1 (#165)
Bumps gradle from 7.3.0 to 7.3.1.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-07 01:41:33 +00:00
Lucy Phipps
07f1917652
add github-actions to dependabot.yml 2022-11-07 01:40:21 +00:00
dependabot[bot]
0b2e056fa6
Bump annotation from 1.4.0 to 1.5.0 (#161)
Bumps annotation from 1.4.0 to 1.5.0.

---
updated-dependencies:
- dependency-name: androidx.annotation:annotation
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-22 18:17:57 +03:00
Leonid Pliushch
45f7a1ab9c
rename dev_keystore.jks to testkey_untrusted.jks
Hopefully the new name of keystore file would provide to potential user
more info about what it actually is.
2022-09-21 10:45:47 +03:00
David Kramer
b3969fe410
Added: Launch fullscreen on external HDMI display (#158) 2022-09-16 08:35:55 +03:00
dependabot[bot]
5074df99e8
Bump gradle from 7.2.2 to 7.3.0 (#159)
Bumps gradle from 7.2.2 to 7.3.0.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 08:29:53 +03:00
Twaik Yont
8d7d7c5a09 Fix for starting intent on Android Q 2022-08-22 15:44:37 +03:00
github-actions[bot]
a2970f6957
Update Gradle Wrapper from 7.5 to 7.5.1. (#145)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>

Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2022-08-06 09:49:04 +03:00
Twaik Yont
fe991d8230
Update README.md
Remove advice about downloading `termux-x11` package from official repos. It is always outdated and does not work.
2022-08-04 17:30:19 +03:00
dependabot[bot]
51bd443c8a
Bump gradle from 7.2.1 to 7.2.2 (#144)
Bumps gradle from 7.2.1 to 7.2.2.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-04 16:57:18 +03:00
Twaik Yont
c9ac9957ff Do not increase targetSdkVersion or socket sharing will stop working. 2022-07-26 13:22:48 +03:00
Twaik Yont
30ea104036 Removing x11 backend which is unusable. It was needed only for developing basic code and now it is unneeded. 2022-07-26 12:56:53 +03:00
Twaik Yont
c42defbc3c Stripping unneeded dependencies of project :common. 2022-07-26 12:51:17 +03:00
Twaik Yont
b5c6389d46 Let starter check SYSTEM_ALERT_WINDOW permission during startup 2022-07-26 09:58:50 +03:00
Twaik Yont
f1bade02da Changing x11-starter to use JNI as it was intended to be used... For some reason JNIenv* arg in regular functions and JavaVM* in JNI_OnLoad always were NULL... Now it is fixed. 2022-07-26 08:50:53 +03:00
Twaik Yont
3afcae5cec Various changes:
1. Fix for https://github.com/termux/termux-packages/issues/10940 working inside shell_loader
2. Getting rid of using `Reflection` API and `CrossVersionReflectedMethod` in the project
3. Unhiding some non-SDK API's to the project using gradle's `compileOnly` dependency
4. Getting rid of library unpacking and making loader open it directly from apk ( 6cdfb75c44 (commitcomment-77856313) ). @agnostic-apollo is the best!!!

Some cleanup...
Bumping versionCode
2022-07-25 16:17:56 +03:00
gradle-update-robot
d3485b2f69 Update Gradle Wrapper from 7.4.2 to 7.5.
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2022-07-16 13:05:04 +05:30
dependabot[bot]
16924683b4 Bump annotation from 1.3.0 to 1.4.0
Bumps annotation from 1.3.0 to 1.4.0.

---
updated-dependencies:
- dependency-name: androidx.annotation:annotation
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-06 00:46:07 -04:00
agnostic-apollo
757c3e34ae Fixed: Fix ClassCastException for LAUNCHED_BY_COMPATION extra passed to MainActivity
com.termux.x11 W/Bundle: Key com.termux.x11.launched_by_companion expected String but value was a java.lang.Integer.  The default value <null> was returned.
com.termux.x11 W/Bundle: Attempt to cast generated internal exception:
    java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
        at android.os.BaseBundle.getString(BaseBundle.java:1199)
        at android.content.Intent.getStringExtra(Intent.java:8248)
        at com.termux.x11.MainActivity.onCreate(MainActivity.java:62)
2022-07-06 02:38:47 +05:00
agnostic-apollo
6cdfb75c44 Fixed: Fix UnsatisfiedLinkError exception while calling native methods on Android < 10
```
~ $ termux-x11 :0
java.lang.UnsatisfiedLinkError: No implementation found for void com.termux.x11.starter.Starter.checkXdgRuntimeDir() (tried Java_com_termux_x11_starter_Starter_checkXdgRuntimeDir and Java_com_termux_x11_starter_Starter_checkXdgRuntimeDir__)
        at com.termux.x11.starter.Starter.checkXdgRuntimeDir(Native Method)
        at com.termux.x11.starter.Starter.onRun(Starter.java:84)
        at com.termux.x11.starter.Starter.lambda$main$0(Starter.java:61)
        at com.termux.x11.starter.Starter$$ExternalSyntheticLambda1.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:762)

```

The issue was fixed by calling `System.load()` instead of `Runtime.getRuntime().load()`.

Before 2018-07/f0346c9f/android 10, android was not using `Reflection.getCallerClass()` to get caller class of methods and was using either `VMStack.getCallerClass1()` or `VMStack.getCallerClass2()`. The `VMStack.getCallerClass2()` is a native method and returns class of the caller's caller. It is "normally not supposed" to be called directly and instead `VMStack.getCallerClass1()` should be called instead, which calls `VMStack.getCallerClass2()` itself, effectively returning caller's class, due to an additional stack frame for the `VMStack.getCallerClass1()` wrapper.

```
public static Class<?> getStackClass1() {
    return getStackClass2();
}

native public static Class<?> getStackClass2();
```

caller2() -> caller1() -> `VMStack.getCallerClass1()` -> `VMStack.getCallerClass2()` = Returns caller2's class

caller2() -> caller1() -> `VMStack.getCallerClass2()` = Returns caller2's caller class (caller3)

Now for issue at hand, let's check implementation of `System.load()` and `Runtime.load()`.

Before f0346c9f

```
System.load(String filename) {
    Runtime.getRuntime().load0(VMStack.getStackClass1(), filename);
}

Runtime.load(String filename) {
    load0(VMStack.getStackClass2(), filename);
}
```

After f0346c9f

```
System.load(String filename) {
    Runtime.getRuntime().load0(Reflection.getCallerClass(), filename);
}

Runtime.load(String filename) {
    load0(Reflection.getCallerClass(), filename);
}
```

The javadocs for `System.load()` say that `The call System.load(name) is effectively equivalent to the call: Runtime.getRuntime().load(name)`, but that is technically not true, before f0346c9f, they were not the same. As you can see, `Runtime.load()` will use caller's caller class instead of caller's class and so will use the wrong `ClassLoader` when calling `fromClass.getClassLoader()` later in `Runtime.load0()`. After f0346c9f, ClassLoader used will actually be same for both calls.

Now normally, this shouldn't be an issue if called in an app with nested method calls. But if you are using `/system/bin/app_process` to start a process from an apk, with its `main()` function as entry point, then both the `main()` function and the main class's static block, will have a different `caller3` class while loading, i.e `RuntimeInit`. So if `Runtime.getRuntime().load()` is used in either of them, the load call will fail and so `System.load()` must be used to make loading work on all android versions. However, you can use either inside any methods called from `main()`.

```
export CLASSPATH=/data/data/com.termux/files/usr/libexec/termux-x11/starter.apk
unset LD_LIBRARY_PATH LD_PRELOAD
exec /system/bin/app_process / com.termux.x11.starter.Starter "$@"
```

```
Log.i("starter", "caller=" + Thread.currentThread().getStackTrace()[2].getClassName());
Log.i("starter", "caller=" + Thread.currentThread().getStackTrace()[3].getClassName());

I/starter: caller2=com.termux.x11.starter.Starter
I/starter: caller3=com.android.internal.os.RuntimeInit
```

https://cs.android.com/android/_/android/platform/libcore/+/f0346c9f

https://cs.android.com/android/platform/superproject/+/android-7.0.0_r1:libcore/ojluni/src/main/java/java/lang/System.java;l=1505
https://cs.android.com/android/platform/superproject/+/android-12.0.0_r34:libcore/ojluni/src/main/java/java/lang/System.java;l=1620

https://cs.android.com/android/platform/superproject/+/android-7.0.0_r1:libcore/ojluni/src/main/java/java/lang/Runtime.java;l=871
https://cs.android.com/android/platform/superproject/+/android-12.0.0_r34:libcore/ojluni/src/main/java/java/lang/Runtime.java;l=892

https://cs.android.com/android/platform/superproject/+/android-7.0.0_r1:libcore/libart/src/main/java/dalvik/system/VMStack.java;l=40
https://cs.android.com/android/platform/superproject/+/android-12.0.0_r34:libcore/libart/src/main/java/dalvik/system/VMStack.java;l=67

https://cs.android.com/android/platform/superproject/+/android-12.0.0_r34:libcore/ojluni/src/main/java/sun/reflect/Reflection.java;l=75

https://github.com/termux/termux-x11/blob/f9a9ce31/termux-x11

Also changing native lib name since `libstarter` is too generic a name which may conflict with potential system libs causing similar issues. Related https://stackoverflow.com/a/27760201

Closes #56
2022-07-05 10:08:53 +05:00
agnostic-apollo
333de111dd Changed: Use compileSdkVersion 30 and do not use buildToolsVersion 2022-07-05 08:19:02 +05:00
agnostic-apollo
cd395e7c98 Fixed: Fix device doesn't support picture-in-picture mode on Android < 8 2022-07-05 08:17:36 +05:00