Remote control shit for OS X (w/ Android app)

Wazakindjes 441137baf3 Und new APK based on the upd00ted pr0jeckt ;]];];] 2 months ago
app 441137baf3 Und new APK based on the upd00ted pr0jeckt ;]];];] 2 months ago
c0pyem 8c507c7291 For c0pyem: let us copy the selection to the clipboard so it's a bit more intuitive =] 2 months ago
serbur 8c507c7291 For c0pyem: let us copy the selection to the clipboard so it's a bit more intuitive =] 2 months ago
.editorconfig f351aea43e Added editorc0nfig =] 5 months ago
.gitignore d4045e1b8c Andr0id: also added supp0t for c0pyem obv phambly, also refactored that shit a bunch [=[=[=[= 3 months ago
LICENSE 85aca91e8d Initial commit lol 3 years ago
README.md d4045e1b8c Andr0id: also added supp0t for c0pyem obv phambly, also refactored that shit a bunch [=[=[=[= 3 months ago

README.md

The fuck is this

This shit is a dankass remote control thanggGgGg for macOS. I mostly started it as a proof of concept for keks, but it's easily expanded to include actually useful features. xd Right now it's mostly for enabling laziness. [=[=[==[[=[

The server side is a Perl skrip which can/should be controlled by launchctl to properly make it run as a daemon. The commands it receives are turned into AppleScript cuz that shit has APIs all throughout the macOS system. ;] Also, since the server only runs in SSL/TLS mode you'll need a certificate trusted by the clients used.

The client side can be anything supporting a streaming (TCP) socket with TLS, but I'm using an Android app meinself (incl00ded in the app directory lol). This app has a target SDK of 25 which corresponds to Android 7.1 (I'm using 25 cuz that gives me full-size app icons w/o that adaptive cancer). If you're using a self-signed cert, you should be able to import it into Settings > Security > Credentials > Trusted CAs or smt similar and it'll be accepted. Alternatively you can just disable the cert check inside the app's settings. =]

c0pyem

This is an extra thingy for sharing y0 clipb0ard between Andr0id and your Mac. =]]]
For more deets, checkem the separate readme. You should probably read it anyways even if you're not going to use it, since it contains some information on some new permissions it requires. ;];;];]

Supported commands

Many also support shorthand versions, some of which aren't even shown here due to it becoming fucky to read. xd You could also just check the regexes in em Perl if you really wanna kn0.

  • !a[uth] <$key> => Required before doing anything else lol
  • !q[uit], !e[xit] => Attempt clean disconnect
  • !prev => Previous music track
  • !next => Next tracc
  • !play[pause] => Toggle play/pause
  • !vol[ume] <$volume | +$volume | +$volume> => Change/set volume (e.g. !vol -5, !vol +9, !vol 20);
  • !cur[rent]vol[ume] => Return current v0lume level obv m9
  • !m[ute] => Toggle mute
  • !lock[screen] => Locks the screen (i.e. go back to login/user selection screen), keeps all current applications running
  • !bright[ness] <$brightness | up | down | min | max> => Change/set brightness in a similar fashion as !volume
  • !cur[rent]bright[ness] => Return current brightness (hacky af but works, see sauce for that shit lmao)
  • !c[affeinate] <$timestring> => Prevent system/display sleep and screensaver yfo (e.g. !c 1h 5m 10s, !c 1h5m10s, !c 30m), should be a built-in utility
  • !decaf[feinate] => Undo all caffeinates (i.e. kill that shit)
  • !firebase <sync [$firebase_token]|c0pyem|pastem [bitch64:][$text]> => not really meant to be used directly but whatevs =]

Dependencies

Just some good ol' Perl modules:

  • Config::IniFiles
  • Data::Dumper (cuz I cbf continually (un)commenting that shit, deal w/ it ;];])
  • Encode
  • File::Basename
  • Mac::Pasteboard
  • MIME::Base64
  • IO::Handle
  • IO::Select
  • IO::Socket::INET
  • IO::Socket::SSL

Installation

Copy muhconf.ini.example to muhconf.ini and fire up een editor. All the options are explained in there so git to reading fam. The config file must be kept in the same dir as the skrip.

After that copy the com.jemoeder.lief.meqqy.plist.example file to com.jemoeder.lief.meqqy.plist and change the contents, namely the line that says <string>/Users/[user]/[dir]/serbur/meqqy.pl</string>. Then just copy it to ~/Library/LaunchAgents and run ./load. This makes sure it gets restarted after you reboot or log out and in again. Also it has a keepalive flag so if it died it'll be restarted. ;3

Muy importante: The !curbright is hacky as shit and it requires permission for "assistive" bullshit, in order to open windows in the background and still access their contents. So:

  • Go to System Preferences > Security & Privacy
  • Unlock that shit
  • Click Accessibility on the left side
  • See if meqqy.pl is already in the list on the right, if it is then just check the box next to it and cl0se em sysprefs
  • If not: apparently macOS won't let you add non-.app files manually, so just run the serbur skrip and try to get the current brightness through it
  • You'll get a popup saying it needs assistive aids enabled, simply click the button that'll take you to sysprefs (which is already open so no biggie) and check the fucking box =]

Android specific shit

So since I included muh Android st00dio projeckt in this repo as well, you'll need to make some adjustments if you want to release signed APKs lol. Also, I left the example testing classes in there just in case lel.

In the build.gradle file there are these 4 lines:

storeFile file(getPassword(currentUser, "ANDROID_KEY_STORE"))
storePassword getPassword(currentUser, "ANDROID_STORE_PASSWORD")
keyAlias getPassword(currentUser, "ANDROID_KEY_ALIAS")
keyPassword getPassword(currentUser, "ANDROID_KEY_PASSWORD")

These mean that all signing information (key store file, its password, your key alias and the key password) is st0red in the dankass macOS Keychain. So simply fire up the Keychain Access br0gram from Utilities and unlock the login keychain. Then on the bottom-left pick Passwords for categ0ry. Finally click on the small plus button at the very bottom and specify the fields as follows:

  • Keychain Item Name => one of the four above mentioned names (the ANDROID_* ones etc)
  • Account Name => your username (not display name), use Terminal > whoami to see this or just look at the name of your home directory
  • Password => the value

Example:

  • Keychain Item Name => ANDROID_KEY_STORE
  • Account Name => ayylmao
  • Password => /Users/ayylmao/pki/android_keystore.jks

Then repeat that shit for the others. ;] By doing it this way, your priv8 shit is never stored in the build.gradle file and it's safe to put it under version contr0l. Now, in order to build you won't be using Build > Generate Signed Bundle / APK. Use the Build > Build Bundle(s) / APK(s) option instead (don't forget to set the proper build variant first). ;] Otherwise it'll prompt you for keystore info bullshit anyways and fuck that.

Hurrrr pls halp it's br0ke

Simply ./unload that shit and do ./meqqy.pl in a terminal, you will most likely get some output that will give you an idea of wats goin on. =]