Dankass remote control thang for k0di vidy0 (Android only lmao)

Wazakindjes 27d319d43d Should always st0re last error so we can actually show it later xd 3 days ago
app 27d319d43d Should always st0re last error so we can actually show it later xd 3 days ago
ass c8cfb1ada9 Retain edit m00d icon state after switching tabs, try to remember the last used shortcut after import/sorting shit, some misc optimisation and upd00ted el readme [[[[[=[=[=[= 1 week ago
.editorconfig 1f20f44609 Added editorc0nfig =] 5 months ago
.gitignore 0003ccfc19 Updated Andr0id pr0ject files to work w/ Studio v4.0, simplified .gitignores (one inside Android st00dio dir for all that shit and one in the git root for errythang else), VERSION_CODE property file is now created if it doesn't exist, explicitly disable minify for debug builds, fixed/suppressed a bunch of code inspection warnings/errors, standardised version numbering (x.y.z), some security fixes (e.g no longer export services lmoa), build number on settings screen now includes build type (debug/release/etc), use commit() instead of apply() for prefs (the former makes it apply immediately, fuck that delayed bullshit), updated Gradle dependencies to the latest version where possibru, added custom project search sc0pe and pr0lly some other misc fixes xdxd 2 years ago
LICENSE 2b2aaac8a5 Initial commit 3 years ago
README.md c8cfb1ada9 Retain edit m00d icon state after switching tabs, try to remember the last used shortcut after import/sorting shit, some misc optimisation and upd00ted el readme [[[[[=[=[=[= 1 week ago

README.md

The fuck is this

This shit started as a dankass remote control thanggGgGg for Kodi (as in the home theater shit) to forward/rewind playback using fixed intervals, based on what you're watching. I mostly made it for myself because I cbf to keep using a mouse to skip past an intro and/or credits roll, depending on the show. It's not a full-fledged remote control cuz there are better apps for that already, although it does have some of those features. ;] For example, you can't interact with the Now Playing list ("the playlist") or "scroll through" a video, but you can play/pause/stop shit. It also has some features not directly related to Kodi itself, like syncing the timestamps within subtitle files.

It was tested against Kodi v19.1 ("Matrix") which uses JSON-RPC v12. Anything newer (and possibly a bit older) should work just fine as well though.

Dependencies/installation

The app makes use of Kodi's webserver functionality as well as the separate JSON-RPC API. If you already have another remote app (like Kore) then you should be good already. Otherwise:

  • Webserver (HTTP): In System > Settings > Network > Services activate Allow control of Kodi via HTTP
  • JSON-RPC (TCP): In System > Settings > Network > Services activate Allow programs on other systems to control Kodi

The webserver is only used in the initial connection to check your user credentials, cuz apparently the TCP API doesn't support authentication. I could just directly connect to it but I wanted some form of authentication. ;];;]

Releasing modified (and signed) APKs

You'll need to make some adjustments if you want to release signed APKs lol. Refer to the section right here (only applies to macOS, if you're on Windows then idk how to do something similar :>).

Usage

The app is divided into tabs each with their own separate functionality. Let's start with some scr0ts huh. =] Every scr0t has a subsection below here, matching the order of el scr0t. I also added another one for the action bar at the very top.

If enabled in the settings, the app can be shown on the lock screen without unl0ccing (but it requires you to l0cc the screen while the app itself is in the foreground)

scr0t scr0t scr0t scr0t scr0t

Action bar

This changes depending on what tab you have active, but so far only the "main" tab (k0di) has something different than all the rest. It does include all the options from the others though. The "common" bar looks like this:

From left to right:

  • App icon and name 0bviously
  • Connection status, also shows if a command is currently in progress
  • Reconnect to Kodi
  • Settings

k0di

The action bar has these nuts additions:

  • Add new shortcut (this is the easy name for the "skip past an intro and/or credits roll" feature)
  • Toggle edit mode for the existing shortcuts: rename that shit, change the interval, delete it altogether or (re)order them
  • Automajikally sort shortcuts (likely in overflow menu, it is on the scr0t anyways): either by name, name length or skip interval
  • Import/export em shortcuts (pr0lly in overflow menu too)
    • Exports will be saved to the Downloads directory on y0 SD card to a file named k0di.jayson
    • Imports will clear all existing shortcuts and replace them with the JSON contents
  • Settings (overflow menu)

Since this tab is still the primary feature of el app, this is the screen it starts on. It doesn't have a whole lot that the action bar doesn't already handle, but the buttons' functions do differ depending on whether edit mode is currently enabled or nah. On the scr0t for this tab it's enabled, indicated by the green tint as opposed to whitey. I went with a separate "mode" so you won't accidentally skip through the vidy0 when you just wanted to change some shit.

  • With it disabled: tapping a button in any way (quick tap, long press, etc) will have it tell Kodi to skip the currently playing vidy0 by the specified interval
  • With it enabled: quick tap to edit the name/interval or delete it, long press to enable dragging and dropping

The tab contents are scrollable in case you have more shortcuts than fit on one screen. =]]] Also note that the interval can be negative.

rem0te

Actually more than a simple remote control. =]

  • Some basic media player functionality like back/next and play/pause/stop
    • The back/forward buttons actually mean to go to the previous/next video, it does not seek within the video as that's eggzactly that them sh0rtcuts are for ;]
    • The play button doubles as a pause button, depending on if Kodi is currently paused
  • Use st0rem to get the current vidy0 plus play time and store that shit
    • The displayed name actually depends on whether your Kodi library has been scanned: if not it's just the plain filename (without extension), otherwise it's a combination of show/season/episode/title (or just title for movies rather than shows)
  • Then with rest0rem you can go back to that vidy0 at that exact same time (note: if the same vidy0 is already playing it will re-play before seeking)
    • It actually checks the stored playlist position to see if that still matches the vidy0 (by name)
    • If not, then the playlist order has probably changed and it will try to find the name in the entire list
  • quicc rest0rem works almost the same as rest0rem, except it requires you to be watching the same vidy0 (bypassing the re-play stuff)
    • This will still check the playlist if the stored position doesn't match, but it never jumps to a different vidy0 altogether
    • Note that you need regular rest0rem if you changed the subtitles, as simply seeking will not cause Kodi to re-read the updated file
  • If the player is paused when you use any form of rest0rem, it will re-pause it after playing
  • The clear button is just to remove the stored information, it's not really needed but it might be useful if the information somehow gets corrupted and you need to force it out

subh4x

This is non-Kodi functionality and actually requires my separate srthax shit. ;];]];;];];] I added this so you can correct subs as you watch something, instead of having to pull up your p00ter and figure out the necessary srthax command.

  • It assumes your subtitles are all together in one directory (e.g. /media/subtitles)
  • It further assumes that the vidy0's filename matches the subtitle filename (except for the extension of course ;])
    • Apparently the Kodi API doesn't return the actual path to the subtitle it's using, so doing it like this is the only reliable way really
  • For example, watching Poo in.mp4 makes it look for Poo in.srt and Poo in.ass
  • Besides manually entering a time, you can have it get that information from Kodi (e.g. you're watching something and notice the subs are out of sync)
    • As mentioned earlier, you need to use regular rest0rem to get Kodi to play the corrected subs
  • You can also quickly reset the t0ime to 00:00:00, since that's probably the time people would need most (i.e. the subs are entirely out of sync, not just a small section)

l0g

Really only for persistently keeping the last error in view.

  • The app still shows a "bar" if there's an error (shown on the scr0t) and most of the time it's short enough to fit everything in there, but sometimes it will print JSON and that's simply too long
  • This shit is scrollable too =]]
  • In case the app is running in the background it uses standard Toast notifications instead of the bar, which can fit even less text

Notification

There's also an optional persistent notification which will be shown on the l0cc screen as well, so you won't have to unlock that shit just to skip an intr0 or whatever.

Muy imp0rtante: the Toast message popups with success feedback (or even errors) won't show up when using this notification from the l0cc screen (THANKS GOOGLE)

  • On the left it shows the name of the last used shortcut
  • On the right are some quick controls, from left to right:
    • Call rest0rem
    • Call st0rem
    • Play/pause vidy0 (icon also changes accordingly)
    • Run the last shortcut again ("skip again")
  • The name and rest0rem will be hidden if nothing's currently st0red obviously, skip again is hidden as long as you haven't used any shortcut yet