Skip to content

Commit

Permalink
finished up and improved small stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
legendsayantan committed Jun 27, 2024
1 parent 1216c4c commit db87429
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 25 deletions.
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,17 @@ Contains some easy-to-use tools to go beyond the level of control allowed by And

⚠ 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.

- [x] **LookBack** - Allows downgrade of apps, without uninstallation.
- [x] **LookBack** - Allows downgrade of apps, without uninstallation. *Not an entirely stable feature.*
- [x] **UniversalPip** - Enforces Picture-in-Picture mode for all apps, even if they don't allow it.
- [x] **ADB Shell** - Manually execute other raw ADB commands.
- [x] **Intent Shell** - Allows other apps (Tasker,MacroDroid,etc) to run ADB commands via intent requests.

Intent action - `com.legendsayantan.adbtools.execute`

Intent package - `com.legendsayantan.adbtools`

Intent extras -

i. `command` - The adb command to execute.

ii. `key` - The access key generated by ShizuTools.
- [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)

#### 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.

### Installation
Download the latest apk from [here](https://github.com/legendsayantan/ShizuTools/releases/latest).
Install the Latest Release Build from [here](https://github.com/legendsayantan/ShizuTools/releases/latest).

Install the Latest Dev Build from [here](https://github.com/legendsayantan/ShizuTools/blob/master/app/release/app-release.apk)

### License
This project is licensed under GNU General Public License v3.0.
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ android {
minSdk 27
targetSdk 34
versionCode 1
versionName "1.4.2"
versionName "1.4.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.4.2",
"versionName": "1.4.3",
"outputFile": "app-release.apk"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.legendsayantan.adbtools

import android.content.Context
import android.os.Bundle
import android.os.Handler
import android.view.KeyEvent
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
Expand Down Expand Up @@ -33,12 +34,16 @@ class PipStarterActivity : AppCompatActivity() {
arrayOf(KeyEvent.KEYCODE_MEDIA_FAST_FORWARD,KeyEvent.KEYCODE_DPAD_RIGHT),
arrayOf(KeyEvent.KEYCODE_MEDIA_NEXT)
)
controls.forEachIndexed { index, materialCardView ->
materialCardView.setOnClickListener {
keys[index].forEach { key ->
getExternalWindowId { window-> ShizukuRunner.runAdbCommand("input -d $window keyevent $key",
object : ShizukuRunner.CommandResultListener {}) }
interacted()
getExternalDisplayId { display->
Handler(mainLooper).post {
controls.forEachIndexed { index, materialCardView ->
materialCardView.setOnClickListener {
keys[index].forEach { key ->
ShizukuRunner.runAdbCommand("input -d $display keyevent $key",
object : ShizukuRunner.CommandResultListener {})
interacted()
}
}
}
}
}
Expand All @@ -49,7 +54,7 @@ class PipStarterActivity : AppCompatActivity() {
extraBtns[0].setOnClickListener {
interacted()
val metrics = getWindowParams()
getExternalWindowId {
getExternalDisplayId {
ShizukuRunner.runAdbCommand("input -d $it tap ${(metrics.first * 0.95).toInt()} ${(metrics.second*0.86).toInt()}",
object : ShizukuRunner.CommandResultListener {})
}
Expand Down Expand Up @@ -95,7 +100,7 @@ class PipStarterActivity : AppCompatActivity() {
val metrics = resources.displayMetrics
return Pair(metrics.widthPixels,((metrics.widthPixels / (metrics.heightPixels.toFloat() / metrics.widthPixels)) + 100).toInt())
}
fun getExternalWindowId(callback:(Int)->Unit){
fun getExternalDisplayId(callback:(Int)->Unit){
ShizukuRunner.runAdbCommand("dumpsys display | grep 'Display [0-9][0-9]*'",
object :
ShizukuRunner.CommandResultListener {
Expand Down Expand Up @@ -160,7 +165,7 @@ class PipStarterActivity : AppCompatActivity() {
) {
if (done) {
Timer().schedule(timerTask {
getExternalWindowId { newDisplayId->
getExternalDisplayId { newDisplayId->
val command =
"am start -n $packageName/${PipStarterActivity::class.java.canonicalName} --es package $pipPackage --display $newDisplayId"
ShizukuRunner.runAdbCommand(
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@
</LinearLayout>
</com.google.android.material.card.MaterialCardView>

<Space
android:layout_width="wrap_content"
android:layout_height="100dp"/>

</LinearLayout>
</ScrollView>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@
<string name="permission_error">Permission error! Open the shizuku app to learn more.</string>
<string name="shizuku_error">Shizuku Error!</string>
<string name="universalpip">UniversalPip beta</string>
<string name="desc_universalpip">Switch apps to picture-in-picture mode forcefully.</string>
<string name="desc_universalpip">Switch apps to picture-in-picture mode even if they don\'t allow it.</string>
</resources>

0 comments on commit db87429

Please sign in to comment.