Skip to content

Commit db87429

Browse files
finished up and improved small stuff
1 parent 1216c4c commit db87429

File tree

7 files changed

+27
-25
lines changed

7 files changed

+27
-25
lines changed

README.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,17 @@ Contains some easy-to-use tools to go beyond the level of control allowed by And
99

1010
⚠ SoundMaster may not work on apps with strong copyright protection, like Spotify. In case SoundMaster crashes and some apps lose sound output, use MixedAudio to unmute them.
1111

12-
- [x] **LookBack** - Allows downgrade of apps, without uninstallation.
12+
- [x] **LookBack** - Allows downgrade of apps, without uninstallation. *Not an entirely stable feature.*
13+
- [x] **UniversalPip** - Enforces Picture-in-Picture mode for all apps, even if they don't allow it.
1314
- [x] **ADB Shell** - Manually execute other raw ADB commands.
14-
- [x] **Intent Shell** - Allows other apps (Tasker,MacroDroid,etc) to run ADB commands via intent requests.
15-
16-
Intent action - `com.legendsayantan.adbtools.execute`
17-
18-
Intent package - `com.legendsayantan.adbtools`
19-
20-
Intent extras -
21-
22-
i. `command` - The adb command to execute.
23-
24-
ii. `key` - The access key generated by ShizuTools.
15+
- [x] **Intent Shell** - Allows other apps (Tasker,MacroDroid,etc) to run ADB commands via intent requests. [How to use](https://github.com/legendsayantan/ShizuTools/wiki/IntentShell)
2516

2617
#### This app is still on development phase, and not everything is always reliable. Feel free to suggest new features, report bugs or contribute to the project.
2718

2819
### Installation
29-
Download the latest apk from [here](https://github.com/legendsayantan/ShizuTools/releases/latest).
20+
Install the Latest Release Build from [here](https://github.com/legendsayantan/ShizuTools/releases/latest).
21+
22+
Install the Latest Dev Build from [here](https://github.com/legendsayantan/ShizuTools/blob/master/app/release/app-release.apk)
3023

3124
### License
3225
This project is licensed under GNU General Public License v3.0.

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ android {
1212
minSdk 27
1313
targetSdk 34
1414
versionCode 1
15-
versionName "1.4.2"
15+
versionName "1.4.3"
1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
}
1818

app/release/app-release.apk

468 Bytes
Binary file not shown.

app/release/output-metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"filters": [],
1313
"attributes": [],
1414
"versionCode": 1,
15-
"versionName": "1.4.2",
15+
"versionName": "1.4.3",
1616
"outputFile": "app-release.apk"
1717
}
1818
],

app/src/main/java/com/legendsayantan/adbtools/PipStarterActivity.kt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.legendsayantan.adbtools
22

33
import android.content.Context
44
import android.os.Bundle
5+
import android.os.Handler
56
import android.view.KeyEvent
67
import androidx.activity.enableEdgeToEdge
78
import androidx.appcompat.app.AppCompatActivity
@@ -33,12 +34,16 @@ class PipStarterActivity : AppCompatActivity() {
3334
arrayOf(KeyEvent.KEYCODE_MEDIA_FAST_FORWARD,KeyEvent.KEYCODE_DPAD_RIGHT),
3435
arrayOf(KeyEvent.KEYCODE_MEDIA_NEXT)
3536
)
36-
controls.forEachIndexed { index, materialCardView ->
37-
materialCardView.setOnClickListener {
38-
keys[index].forEach { key ->
39-
getExternalWindowId { window-> ShizukuRunner.runAdbCommand("input -d $window keyevent $key",
40-
object : ShizukuRunner.CommandResultListener {}) }
41-
interacted()
37+
getExternalDisplayId { display->
38+
Handler(mainLooper).post {
39+
controls.forEachIndexed { index, materialCardView ->
40+
materialCardView.setOnClickListener {
41+
keys[index].forEach { key ->
42+
ShizukuRunner.runAdbCommand("input -d $display keyevent $key",
43+
object : ShizukuRunner.CommandResultListener {})
44+
interacted()
45+
}
46+
}
4247
}
4348
}
4449
}
@@ -49,7 +54,7 @@ class PipStarterActivity : AppCompatActivity() {
4954
extraBtns[0].setOnClickListener {
5055
interacted()
5156
val metrics = getWindowParams()
52-
getExternalWindowId {
57+
getExternalDisplayId {
5358
ShizukuRunner.runAdbCommand("input -d $it tap ${(metrics.first * 0.95).toInt()} ${(metrics.second*0.86).toInt()}",
5459
object : ShizukuRunner.CommandResultListener {})
5560
}
@@ -95,7 +100,7 @@ class PipStarterActivity : AppCompatActivity() {
95100
val metrics = resources.displayMetrics
96101
return Pair(metrics.widthPixels,((metrics.widthPixels / (metrics.heightPixels.toFloat() / metrics.widthPixels)) + 100).toInt())
97102
}
98-
fun getExternalWindowId(callback:(Int)->Unit){
103+
fun getExternalDisplayId(callback:(Int)->Unit){
99104
ShizukuRunner.runAdbCommand("dumpsys display | grep 'Display [0-9][0-9]*'",
100105
object :
101106
ShizukuRunner.CommandResultListener {
@@ -160,7 +165,7 @@ class PipStarterActivity : AppCompatActivity() {
160165
) {
161166
if (done) {
162167
Timer().schedule(timerTask {
163-
getExternalWindowId { newDisplayId->
168+
getExternalDisplayId { newDisplayId->
164169
val command =
165170
"am start -n $packageName/${PipStarterActivity::class.java.canonicalName} --es package $pipPackage --display $newDisplayId"
166171
ShizukuRunner.runAdbCommand(

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@
429429
</LinearLayout>
430430
</com.google.android.material.card.MaterialCardView>
431431

432+
<Space
433+
android:layout_width="wrap_content"
434+
android:layout_height="100dp"/>
435+
432436
</LinearLayout>
433437
</ScrollView>
434438

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@
5959
<string name="permission_error">Permission error! Open the shizuku app to learn more.</string>
6060
<string name="shizuku_error">Shizuku Error!</string>
6161
<string name="universalpip">UniversalPip beta</string>
62-
<string name="desc_universalpip">Switch apps to picture-in-picture mode forcefully.</string>
62+
<string name="desc_universalpip">Switch apps to picture-in-picture mode even if they don\'t allow it.</string>
6363
</resources>

0 commit comments

Comments
 (0)