Remote control shit for OS X (w/ Android app)
|
10 months ago | |
---|---|---|
app | 10 months ago | |
c0pyem | 10 months ago | |
serbur | 10 months ago | |
.editorconfig | 1 year ago | |
.gitignore | 11 months ago | |
LICENSE | 4 years ago | |
README.md | 11 months ago |
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. =]
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. ;];;];]
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 caffeinate
s (i.e. kill that shit)!firebase <sync [$firebase_token]|c0pyem|pastem [bitch64:][$text]>
=> not really meant to be used directly but whatevs =]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
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:
System Preferences
> Security & Privacy
Accessibility
on the left sidemeqqy.pl
is already in the list on the right, if it is then just check the box next to it and cl0se em sysprefs.app
files manually, so just run the serbur skrip and try to get the current brightness through itSo 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 directoryPassword
=> the valueExample:
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.
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. =]