Skip to content

Commit

Permalink
refactor: add info about appops command to adb setup
Browse files Browse the repository at this point in the history
  • Loading branch information
timschneeb committed Mar 8, 2023
1 parent e3bdf0e commit 4f72e53
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ class OnboardingFragment : Fragment() {

page.step4.isVisible = selectedSetupMethod == SetupMethods.Adb
page.step5.isVisible = selectedSetupMethod == SetupMethods.Adb
page.step5bOptional.isVisible = selectedSetupMethod == SetupMethods.Adb && BuildConfig.ROOTLESS

if(selectedSetupMethod == SetupMethods.Shizuku) {
val installed = requireContext().isPackageInstalled(SHIZUKU_PKG)
Expand Down Expand Up @@ -569,6 +570,7 @@ class OnboardingFragment : Fragment() {
page.step3.bodyText = getString(R.string.onboarding_adb_manual_step3)
page.step4.bodyText = getString(R.string.onboarding_adb_manual_step4, requireContext().packageName)
page.step5.bodyText = getString(R.string.onboarding_adb_manual_step5)
page.step5bOptional.bodyText = getString(R.string.onboarding_adb_manual_step5b, requireContext().packageName)

page.title.text = getString(R.string.onboarding_adb_adb_title)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import me.timschneeberger.rootlessjamesdsp.activity.EngineLauncherActivity
import me.timschneeberger.rootlessjamesdsp.utils.Constants
import me.timschneeberger.rootlessjamesdsp.utils.ContextExtensions.registerLocalReceiver
import me.timschneeberger.rootlessjamesdsp.utils.ContextExtensions.unregisterLocalReceiver
import me.timschneeberger.rootlessjamesdsp.utils.PermissionExtensions.hasProjectMediaAppOp
import me.timschneeberger.rootlessjamesdsp.utils.Preferences
import org.koin.android.ext.android.inject
import org.koin.core.component.KoinComponent
Expand Down Expand Up @@ -80,7 +81,7 @@ class QuickTileService : TileService(),
}
.let {
// If projection permission request needs to be shown, collapse status bar
if(BuildConfig.ROOTLESS && app.mediaProjectionStartIntent == null)
if(BuildConfig.ROOTLESS && app.mediaProjectionStartIntent == null && !hasProjectMediaAppOp())
startActivityAndCollapse(it)
else
startActivity(it)
Expand Down
10 changes: 9 additions & 1 deletion app/src/main/res/layout/onboarding_page4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@
app:iconSrc="@drawable/ic_numeric_4_circle_outline"
app:iconTint="?attr/colorOnSurface" />

<me.timschneeberger.rootlessjamesdsp.view.Card
android:id="@+id/step5b_optional"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:cardMargin="8dp"
app:iconSrc="@drawable/ic_twotone_info_24dp"
app:iconTint="?attr/colorOnSurface" />

<me.timschneeberger.rootlessjamesdsp.view.Card
android:id="@+id/step5"
android:layout_width="match_parent"
Expand All @@ -95,7 +104,6 @@
app:cardMargin="8dp"
app:iconSrc="@drawable/ic_numeric_5_circle_outline"
app:iconTint="?attr/colorOnSurface" />

</LinearLayout>

</ScrollView>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
<string name="onboarding_adb_manual_step3">Add and connect the USB device in WebADB.</string>
<string name="onboarding_adb_manual_step4">Navigate to \'Interactive Shell\' and execute the following command in the shell: \'pm grant %s android.permission.DUMP\'</string>
<string name="onboarding_adb_manual_step5">Tap \'Next\' in this app to continue.</string>
<string name="onboarding_adb_manual_step5b">(Optional) You can permanently skip the audio capture permission prompts by executing this command: \'appops set %s PROJECT_MEDIA allow\'</string>
<string name="onboarding_adb_manual_step1_button">Open development settings</string>

<string name="onboarding_perm_title">Other permissions</string>
Expand Down

0 comments on commit 4f72e53

Please sign in to comment.