[ot][spam][crazy] inhibition efforts: setting up a muse for use
Yay muse! Muse is fun cause I looked into the protocol and second time and retain a little ;p The new Muse S's are also more comfortable, resulting in fewer psychoticish internal complaints. I'm connected with at least 3 projects around this: a software called brainflow, a short thing of my own, and a quick research hack to connect it to labstreaminglayer. I'm planning to engage the third. The lsl python backend for muse has classes I could call manually. I plan to do this and archive data. This will take a small amount of code. I don't know whether this current system has bluetooth.
I guess it would be nice to buy an openbci too. Something to help me use to repair my existing ones, and something to actually use, maybe the cheapest things. It would also be nice to buy an openeeg. I don't know how much savings I have to splurge. I don't understand why I have money to spend.
muse-lsl is at https://github.com/alexandrebarachant/muse-lsl it's an open source project that moves slowly when the maintainer and contributors have time. this makes it hard for me to contribute a lot during bursts of productivity, since the maintainer might be away for weeks. this is a normal human situation.
I have some sadness around using muse-lsl, because like many modern research systems i bump into, it is not designed in a general way making it laborious to add more recording modes. The muse can provide data in a greater detail than the app engages it by default, but I'm not sure whether the app can engage all the detail available. I usually try to make systems for maximum detail first if i can resist the inhibitions around it; different approaches.
this is probably not an issue for most because the system is so very small. for me refactoring is very hard, haven't fought the inhibitions, big reason for codefudge
i figured i'd use muse-lsl to see if the system had bluetooth. it's a high-end system from 2012 or so i think. so it likely has bluetooth, if there was bluetooth in 2012. the muse uses bluetooth LE ("low energy" or "gatt") which is basically completely different from the bluetooth prior and just shares the name. not sure when it happened. better check.
i'm installing anaconda since it is the distribution system that appears most supported by liblsl, and i don't see any more normative information on integrating liblsl with ubuntu. i'm hoping conda has a faint chance of automatically updating, or notifying if something is out of date :S i still don't know whether this system has ble. it's a mac, it's a tower, it's from 2012; there's likely a build string on a sticker somewhere
if there is no ble support in this system, then the plan is instead to disassemble an existing android-based application and patch in functions or avenues to robustly record, if possible.
at https://support.apple.com/kb/sp652 it looks likely the system supports bluetooth 2.1, which i'm thinking is non-ble. i managed to figure out to type "bluetoothctl" at the command line, using tab completion guessing around 'bluez' with 'blu'[tab] . i recognise this interface. i'll see if it can see my device.
well i dunno. i'm thinking i'll explore the RE a little. [bluetooth]# list Controller [gently censored mac and host] [default] [bluetooth]# power on Changing power on succeeded [bluetooth]# scan on Failed to start discovery: org.bluez.Error.NotReady
the plan is to disassemble muse monitor and add storage modes and basically make an effective fork. it's expected to not be complex because it simply links to a muse library. it's rude because the author is an accessible community member who expresses a need for income. they have small bugs in their software they haven't fixed for years, unfortunately; notably the system doesn't attend to the dropping of packets. it might be very hard to implement, i don't know. they accept communication and collaboration on their product forum (they linked me there when I sent a pull request to a library fork they made). the forum is harder for me because i haven't integrated an interface to a system i'm more familiar with using, like email. to make the approach more right, i might plan to sell the work on the play store and send any income made directly to them. there's probably a better approach that involves working alongside them. to do this, we'll want the app binary and a tool for reversing it. i plan to find the binary first, and i plan to focus on android (it also has an ios port).
since the app is for purchase, and my phone is rooted now, i guess i'll get it off my phone. i don't like connecting phones and online computers together, expecting them to exchange malware over the cable when i do, but i'll do it here.
i think last time i got the app off a bootleg play store or something, to disassemble. that time i had disassembled the official muse app, to get the latest protocol, not this recorder app.
the app is called "mind monitor" by james clutterbuck or somesuch i bought it years ago and would have been happy to pay for a more advanced version, or for access to the source to contribute bug fixes, or for the bugs to be fixed. our economy isn't really set up for such things.
when he made his app i was like 'why is this the only app' well back then it was probably because the usa was under attack, information warfare but nowadays it is because the muse company pulled all their sdk resources
my package installer for adb wants to upgrade my graphics drivers. i recall i didn't fully stabilise my gpu situation, and i'm worried the desktop where i'm writing this may not function if i upgrade them without considering it. i'd rather not consider it atm. i think gfx drivers are pretty orthogonal to adb. i'll see if i can trim them from the install.
looks like my system has a partial install it wants to resolve, and needs me to specify my dependency tree manually if i'm going to keep it unresolved. the packages for adb on ubuntu are: adb android-libadb android-libboringssl android-libcrypto-utils android-sdk-platform-tools-common
$ apt-get download adb android-libadb android-libboringssl android-libcrypto-utils android-sdk-platform-tools-common $ sudo dpkg -i *.deb I thought apt-get would install it if I specified it manually but it seems easier to just be totally manual here.
:/ $ adb ls / * daemon not running; starting now at tcp:5037 * daemon started successfully adb: error: failed to get feature set: no devices/emulators found
here they are for fun: [1449929.928040] git[2039640]: segfault at 0 ip 00007f3d1d48abea sp 00007fff3f8eee18 error 4 in libc-2.31.so[7f3d1d3fb000+178000] [1449929.928049] Code: f3 0f 1e fa 66 0f ef c0 66 0f ef c9 66 0f ef d2 66 0f ef db 48 89 f8 48 89 f9 48 81 e1 ff 0f 00 00 48 81 f9 cf 0f 00 00 77 66 <f3> 0f 6f 20 66 0f 74 e0 66 0f d7 d4 85 d2 74 04 0f bc c2 c3 48 83 [1474528.266274] git[3343569]: segfault at 0 ip 00007ff7eadd0bea sp 00007ffe1e812688 error 4 in libc-2.31.so[7ff7ead41000+178000] [1474528.266285] Code: f3 0f 1e fa 66 0f ef c0 66 0f ef c9 66 0f ef d2 66 0f ef db 48 89 f8 48 89 f9 48 81 e1 ff 0f 00 00 48 81 f9 cf 0f 00 00 77 66 <f3> 0f 6f 20 66 0f 74 e0 66 0f d7 d4 85 d2 74 04 0f bc c2 c3 48 83 [1477941.401561] rfkill: input handler enabled [1477990.891874] rfkill: input handler disabled [1480840.721035] git[3677038]: segfault at 0 ip 00007f85212a1bea sp 00007ffe1ec0cfc8 error 4 in libc-2.31.so[7f8521212000+178000] [1480840.721045] Code: f3 0f 1e fa 66 0f ef c0 66 0f ef c9 66 0f ef d2 66 0f ef db 48 89 f8 48 89 f9 48 81 e1 ff 0f 00 00 48 81 f9 cf 0f 00 00 77 66 <f3> 0f 6f 20 66 0f 74 e0 66 0f d7 d4 85 d2 74 04 0f bc c2 c3 48 83 [1491625.995945] git[50070]: segfault at 0 ip 00007f6516386bea sp 00007ffc7bde8ae8 error 4 in libc-2.31.so[7f65162f7000+178000] [1491625.995955] Code: f3 0f 1e fa 66 0f ef c0 66 0f ef c9 66 0f ef d2 66 0f ef db 48 89 f8 48 89 f9 48 81 e1 ff 0f 00 00 48 81 f9 cf 0f 00 00 77 66 <f3> 0f 6f 20 66 0f 74 e0 66 0f d7 d4 85 d2 74 04 0f bc c2 c3 48 83 [1501362.773160] audit: type=1400 audit(1659844805.405:95): apparmor="DENIED" operation="open" profile="/usr/sbin/cups-browsed" name="/usr/local/lib/libzstd.so.1.4.10" pid=568560 comm="cups-browsed" requested_mask="r" denied_mask="r" fsuid=0 ouid=0 [1502850.873425] git[647090]: segfault at 0 ip 00007f4771a92bea sp 00007ffc61127f58 error 4 in libc-2.31.so[7f4771a03000+178000] [1502850.873435] Code: f3 0f 1e fa 66 0f ef c0 66 0f ef c9 66 0f ef d2 66 0f ef db 48 89 f8 48 89 f9 48 81 e1 ff 0f 00 00 48 81 f9 cf 0f 00 00 77 66 <f3> 0f 6f 20 66 0f 74 e0 66 0f d7 d4 85 d2 74 04 0f bc c2 c3 48 83 [1515024.385190] systemd[1]: /etc/systemd/system.conf:59: Failed to parse resource value, ignoring: unlimited [1515024.385994] systemd[1]: systemd 245.4-4ubuntu3.17 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid) [1515024.407372] systemd[1]: Detected architecture x86-64. [1515028.539502] systemd[1]: Configuration file /etc/systemd/system/run_gitsync.service is marked executable. Please remove executable permission bits. Proceeding anyway. [1535677.407314] git[2394381]: segfault at 0 ip 00007f65e0230bea sp 00007ffd8e8d0758 error 4 in libc-2.31.so[7f65e01a1000+178000] [1535677.407324] Code: f3 0f 1e fa 66 0f ef c0 66 0f ef c9 66 0f ef d2 66 0f ef db 48 89 f8 48 89 f9 48 81 e1 ff 0f 00 00 48 81 f9 cf 0f 00 00 77 66 <f3> 0f 6f 20 66 0f 74 e0 66 0f d7 d4 85 d2 74 04 0f bc c2 c3 48 83 [1546269.790724] git[2952936]: segfault at 0 ip 00007fccb2020bea sp 00007fff66d8f0d8 error 4 in libc-2.31.so[7fccb1f91000+178000] [1546269.790733] Code: f3 0f 1e fa 66 0f ef c0 66 0f ef c9 66 0f ef d2 66 0f ef db 48 89 f8 48 89 f9 48 81 e1 ff 0f 00 00 48 81 f9 cf 0f 00 00 77 66 <f3> 0f 6f 20 66 0f 74 e0 66 0f d7 d4 85 d2 74 04 0f bc c2 c3 48 83
when i replug the phone i don't see anything on dmesg O_O it charges it though the system has a few usb expansion cards; i'll try them
i found another cable in my pack of misplaced confusions (a grey bag i carry around that i just named to write this; basically i never look in it, dissociation). the kernel detects the phone now.
i'm trying a "find -name '*monitor*'" to see if i can find the app but i don't really know the android app layout. it would make sense to find some disassembly software and see what format they expect.
i remember google used to include an apk decompiler _in their source tree_. i guess that's likely still the case. as time went by they required more and more dev setup in order to do its default build.
i think that was true for both google android and adobe flash, but maybe i am crossing wires for one of them
it looks like the way this is done nowadays is https://ibotpeaches.github.io/Apktool at least, that's what websearching implies quickly
https://ibotpeaches.github.io/Apktool/install/ $ apktool Apktool v2.6.1 - a tool for reengineering Android apk files with smali v2.5.2 and baksmali v2.5.2 Copyright 2010 Ryszard Wiśniewski <brut.alll@gmail.com> Copyright 2010 Connor Tumbleson <connor.tumbleson@gmail.com> usage: apktool -advance,--advanced prints advance information. -version,--version prints the version then exits usage: apktool if|install-framework [options] <framework.apk> -p,--frame-path <dir> Stores framework files into <dir>. -t,--tag <tag> Tag frameworks using <tag>. usage: apktool d[ecode] [options] <file_apk> -f,--force Force delete destination directory. -o,--output <dir> The name of folder that gets written. Default is apk.out -p,--frame-path <dir> Uses framework files located in <dir>. -r,--no-res Do not decode resources. -s,--no-src Do not decode sources. -t,--frame-tag <tag> Uses framework files tagged by <tag>. usage: apktool b[uild] [options] <app_path> -f,--force-all Skip changes detection and build all files. -o,--output <dir> The name of apk that gets written. Default is dist/name.apk -p,--frame-path <dir> Uses framework files located in <dir>. For additional info, see: https://ibotpeaches.github.io/Apktool/ For smali/baksmali info, see: https://github.com/JesusFreke/smali
ok, so it's obviously going to want an apk [i'm guessing]. i'll want an apk for the app in question. i wonder if android caches those or stores them expanded or reencoded somehow? or if i need to download it from a store or repack it?
the find on the phone's shell didn't yield any obvious hits for a in /data/app/*/*; do basename "$a"; done I'm guessing these are my installed apps, not certain. I recognise apps I recently installed in the output folder names.
ohhhh the M is capitalised in the app name. com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==
i'm basically doing this but with copypaste instead of the first pipe: adb shell find / -name '*sonicPenguins*' 2>/dev/null | dos2unix | while read folder; do adb pull "$folder"; done
it ended up making 3 trees. some same-named folders may have clobbered each other. they're at https://dweb.link/ipfs/bafybeidtsuxhndsgfluyvau3bai32xi2bpr4n43ltthzg3sle6xg... here's the folder list i pasted in: ./config/sdcardfs/com.sonicPenguins.museMonitor ./data_mirror/ref_profiles/com.sonicPenguins.museMonitor ./data_mirror/cur_profiles/0/com.sonicPenguins.museMonitor ./data_mirror/data_de/null/0/com.sonicPenguins.museMonitor ./data_mirror/data_ce/null/0/com.sonicPenguins.museMonitor ./data_mirror/data_ce/null/0/com.sonicPenguins.museMonitor/shared_prefs/com.sonicPenguins.museMonitor_preferences.xml ./data/misc/profiles/cur/0/com.sonicPenguins.museMonitor ./data/misc/profiles/ref/com.sonicPenguins.museMonitor ./data/data/com.sonicPenguins.museMonitor ./data/data/com.sonicPenguins.museMonitor/shared_prefs/com.sonicPenguins.museMonitor_preferences.xml ./data/app/~~hFsc1hfbUBCc0rQkjlGORg==/com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A== ./data/user/0/com.sonicPenguins.museMonitor ./data/user/0/com.sonicPenguins.museMonitor/shared_prefs/com.sonicPenguins.museMonitor_preferences.xml ./data/user_de/0/com.sonicPenguins.museMonitor
there are apk files in the folder with the funny characters at the end the goal is to try to decompile them, and repack them into a new app
there are 4 apks, a base apk, an armeabi_v7a split_config apk that is twice as big as base (a little more than twice), and split_config apks for en, es, and hdpi.
disconnected phone if you disconnect your devices when not using them, it pressures your government to build spy AIs that can seamlessly transfiltrate data across the connection gaps eventually this technology may trickle down to you, especially as confused hackers try to comprehend it
the expanded trees are at https://dweb.link/ipfs/bafybeifsdlgn4j2z7pt6urtg57sksfk3zqu4b4kryqu5vvvjwng5... it looks like the code is stored in a format called 'smali'. when i saw this on the site i thought it must be a language locality thing, but no it is some kind of object format i guess
smali is android assembly code. so it is a language that can be written in. the apktool help links to https://github.com/JesusFreke/smali which i have opened
i have "apktool build base" running to see if i can relink the application. this may take some learning.
split_config.armeabi_v7a appears to contain Muse's proprietary library. it's possible this could be upgraded to a newer version either from their site or extracted from their official app the separation of concerns may mean that de/recompiling the main app may be more reasonable than otherwise
$ adb install base/dist/base.apk adb: failed to install base/dist/base.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed collecting certificates for /data/app/vmdl406395370.tmp/base.apk: Failed to collect certificates from /data/app/vmdl406395370.tmp/base.apk: Attempt to get length of null array] ok umm how do i build a debug format i guess that apktool didn't automatically sign the apk
i'm looking for a name other than 'penguins' to associate with my hack i don't know whether the concept of being "very very cold" implies for certain that you are being abused by govcorp, but i might as well keep it around
i'm imagining a big slow arctic mammal, but i may have it wrong, i don't really know. loading an arctic mammal list to glance through
ok, progress. i gave it a self-signed certificate; i'll want to save that in a script, maybe in a bit. next issue: $ adb install base.apk adb: failed to install base.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.sonicPenguins.museMonitor signatures do not match previously installed version; ignoring!] gotta change the package name
i change the package name to something like com.github.xloem.knockoffMonitor i didn't change the java package names, just the manifest one gotta resign i imagine
next issue: $ adb install base.apk adb: failed to install base.apk: Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Scanning Failed.: Can't install because provider name museMonitor.provider (in package com.github.xloem.knockoffmonitor) is already used by com.sonicPenguins.museMonitor] i'd like to track my diffs, so i'll fetch the ipfs stuff and start a git repo
i'm redownloading locally the expanded sources from ipfs. i made https://github.com/xloem/knockoffmonitor using github's commandline tool. it is sad, the github problem. similar to gmail. Description A bootleg mutation of Mind Monitor with an idea around fixing bugs or adding features. no files there yet
https://github.com/xloem/knockoffmonitor/blob/main/README.md notes for starting off: - apktool disassembles and reassembles https://ibotpeaches.github.io/Apktool - assembly format https://github.com/JesusFreke/smali - some files dumped from a phone https://dweb.link/ipfs/bafybeidtsuxhndsgfluyvau3bai32xi2bpr4n43ltthzg3sle6xg... - apktool run on the files, extracted .smali sources https://dweb.link/ipfs/bafybeifsdlgn4j2z7pt6urtg57sksfk3zqu4b4kryqu5vvvjwng5...
a lot of the data is just google libraries. waiting for these to download. i guess i should keep patching my untracked sources while i wait.
i've commited a build script and am adding signing to it. i want to look up how to sign without prompting the user.
when i downloaded with wget --mirror, it left index.html files that break building. i have removed them. i am rebasing all the commits so as to put the removal prior to the changes, so that a patch can be formed easily from the git history later.
$ git rm -r base $ apktool d base.apk $ git add base # todo when the previous commands complete
i've rebased again, and i've got signing in the makefile, on git should figure out how to update that provider name
i've built a binary using the makefile, then tried updating the provider name, it's rebuilding i added an install target to the makefile and fixed an issue i saw
$ adb install com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A\=\=/base/dist/base.apk adb: failed to install com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/base/dist/base.apk: Failure [INSTALL_FAILED_CONFLICTING_PROVIDER: Scanning Failed.: Can't install because provider name com.sonicPenguins.museMonitor.firebaseinitprovider (in package com.github.xloem.knockoffmonitor) is already used by com.sonicPenguins.museMonitor] gotta update the other provider too ;p
it installs now. i don't imagine it will run since it doesn't have the dependencies from the other apks. $ cd .. user@archival:~/src/musemonitor$ make apktool build "com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/base" I: Using Apktool 2.6.1 I: Checking whether sources has changed... I: Checking whether resources has changed... I: Building resources... I: Building apk file... I: Copying unknown files/dir... I: Built apk... jarsigner -keystore keystore -storepass 123456 -keypass 123456 -signedjar "com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/base/dist/base_signed.apk" "com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/base/dist/base.apk" dev jar signed. Warning: The signer's certificate is self-signed. adb install "com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/base/dist/base_signed.apk" Success
there are two apps on the device with the same name better change it so i can tell them apart
I have an app called "Knockoff Monitor" now :) when I boot it up, it shows james' logo, then crashes.
$ adb logcat | grep onitor ... 08-07 16:03:33.907 1291 1369 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.github.xloem.knockoffmonitor cmp=com.github.xloem.knockoffmonitor/com.sonicPenguins.museMonitor.MainActivity} from uid 10143 08-07 16:03:33.923 1291 1369 V SplashScreenExceptionList: SplashScreen checking exception for package com.github.xloem.knockoffmonitor (target sdk:29) -> false 08-07 16:03:33.997 1291 1339 I ActivityManager: Start proc 13414:com.github.xloem.knockoffmonitor/u0a180 for pre-top-activity {com.github.xloem.knockoffmonitor/com.sonicPenguins.museMonitor.MainActivity} 08-07 16:03:34.098 13414 13414 V GraphicsEnvironment: ANGLE Developer option for 'com.github.xloem.knockoffmonitor' set to: 'default' 08-07 16:03:34.100 13414 13414 V GraphicsEnvironment: ANGLE GameManagerService for com.github.xloem.knockoffmonitor: false 08-07 16:03:34.297 13414 13414 E AndroidRuntime: Process: com.github.xloem.knockoffmonitor, PID: 13414 08-07 16:03:34.297 13414 13414 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.github.xloem.knockoffmonitor/com.sonicPenguins.museMonitor.MainActivity}: android.view.InflateException: Binary XML file line #6 in com.github.xloem.knockoffmonitor:layout/graph: Binary XML file line #6 in com.github.xloem.knockoffmonitor:layout/graph: Error inflating class android.widget.ImageButton 08-07 16:03:34.297 13414 13414 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #6 in com.github.xloem.knockoffmonitor:layout/graph: Binary XML file line #6 in com.github.xloem.knockoffmonitor:layout/graph: Error inflating class android.widget.ImageButton 08-07 16:03:34.297 13414 13414 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #6 in com.github.xloem.knockoffmonitor:layout/graph: Error inflating class android.widget.ImageButton 08-07 16:03:34.297 13414 13414 E AndroidRuntime: at com.sonicPenguins.museMonitor.MainActivity.setupView(MainActivity.java:923) 08-07 16:03:34.297 13414 13414 E AndroidRuntime: at com.sonicPenguins.museMonitor.MainActivity.onCreate(MainActivity.java:790) 08-07 16:03:34.298 13414 13414 E AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: Drawable com.github.xloem.knockoffmonitor:drawable/APKTOOL_DUMMY_2e with resource ID #0x7f06002e 08-07 16:03:34.298 13414 13414 E AndroidRuntime: at com.sonicPenguins.museMonitor.MainActivity.setupView(MainActivity.java:923) 08-07 16:03:34.298 13414 13414 E AndroidRuntime: at com.sonicPenguins.museMonitor.MainActivity.onCreate(MainActivity.java:790) 08-07 16:03:34.309 1291 1369 W ActivityTaskManager: Force finishing activity com.github.xloem.knockoffmonitor/com.sonicPenguins.museMonitor.MainActivity 08-07 16:03:34.314 13414 13436 I FA : adb shell setprop debug.firebase.analytics.app com.github.xloem.knockoffmonitor 08-07 16:03:34.383 1291 1369 I ActivityManager: Process com.github.xloem.knockoffmonitor (pid 13414) has died: prcp TOP 08-07 16:03:34.443 1291 1332 W InputManager-JNI: Input channel object '238be20 Splash Screen com.github.xloem.knockoffmonitor (client)' was disposed without first being removed with the input manager! 08-07 16:03:34.811 1291 1331 W ActivityTaskManager: Activity top resumed state loss timeout for ActivityRecord{80b6dd u0 com.github.xloem.knockoffmonitor/com.sonicPenguins.museMonitor.MainActivity t-1 f}}
08-07 16:03:34.297 13414 13414 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #6 in com.github.xloem.knockoffmonitor:layout/graph: Error inflating class android.widget.ImageButton looks like it's actually for now just having trouble working with its UI resources
08-07 16:03:34.297 13414 13414 E AndroidRuntime: at com.sonicPenguins.museMonitor.MainActivity.onCreate(MainActivity.java:790) 08-07 16:03:34.298 13414 13414 E AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: Drawable com.github.xloem.knockoffmonitor:drawable/APKTOOL_DUMMY_2e with resource ID #0x7f06002e seems apktool provided some dummy names
com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/base$ grep -r APKTOOL_DUMMY | wc -l 223 a lot of them
this ticket looks helpful. https://github.com/iBotPeaches/Apktool/issues/2344 - do a diff of the apk contents after unzipping them - install the other apks, they can contain missing resources
split apks can be installed with split apk installer at https://github.com/iBotPeaches/Apktool/issues/2283 somebody said they made a tool to automate the needed steps to make a monolithic apk. the link was redacted. apktool can take a -r parameter to not decompile resources
I'm at https://nickbloor.co.uk/2020/03/29/patching-android-split-apks/ with helpful resources. $ adb shell pm path com.sonicPenguins.museMonitor package:/data/app/~~hFsc1hfbUBCc0rQkjlGORg==/com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/base.apk package:/data/app/~~hFsc1hfbUBCc0rQkjlGORg==/com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/split_config.armeabi_v7a.apk package:/data/app/~~hFsc1hfbUBCc0rQkjlGORg==/com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/split_config.en.apk package:/data/app/~~hFsc1hfbUBCc0rQkjlGORg==/com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/split_config.es.apk package:/data/app/~~hFsc1hfbUBCc0rQkjlGORg==/com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/split_config.hdpi.apk
i went to find food. i took a coldish shower too. i haven't been logging them as much, which is only okay if it doesn't reduce doing them. $ ../patch-apk/patch-apk.py com.sonicPenguins.museMonitor Getting APK path(s) for package: com.sonicPenguins.museMonitor [+] APK path: /data/app/~~hFsc1hfbUBCc0rQkjlGORg==/com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/base.apk [+] APK path: /data/app/~~hFsc1hfbUBCc0rQkjlGORg==/com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/split_config.armeabi_v7a.apk [+] APK path: /data/app/~~hFsc1hfbUBCc0rQkjlGORg==/com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/split_config.en.apk [+] APK path: /data/app/~~hFsc1hfbUBCc0rQkjlGORg==/com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/split_config.es.apk [+] APK path: /data/app/~~hFsc1hfbUBCc0rQkjlGORg==/com.sonicPenguins.museMonitor-TQIijxE__-nBT-63RHC63A==/split_config.hdpi.apk Pulling APK file(s) from device. [+] Pulling: com.sonicPenguins.museMonitor-base.apk [+] Pulling: com.sonicPenguins.museMonitor-split_config.armeabi_v7a.apk [+] Pulling: com.sonicPenguins.museMonitor-split_config.en.apk [+] Pulling: com.sonicPenguins.museMonitor-split_config.es.apk [+] Pulling: com.sonicPenguins.museMonitor-split_config.hdpi.apk App bundle/split APK detected, rebuilding as a single APK. Extracting individual APKs with apktool. [+] Extracting: /tmp/tmpfqe42zzp/com.sonicPenguins.museMonitor-base.apk [+] Extracting: /tmp/tmpfqe42zzp/com.sonicPenguins.museMonitor-split_config.armeabi_v7a.apk
it crashed during its objection patching. objection looks pretty cool, but i'm working on a different task than spying on my own phone atm. i've made a script that uses nickbloor's script to just download and merge the apks, and i'm running it
due to an error in my script, i am rerunning the whole process i had not set the output name, and it crashed and cleaned up its temporary folder
i've applied the changes to the merged apk folder and am trying out building them with the same makefile
it totally runs :D boots up just like the original uhhhhhhh i guess maybe i should turn off firebase
ehh maybe i don't know what firebase is maybe i'll just leave it for now focus on decompiling to try to make it easy to add features etc
$ git show-ref refs/heads/main 4d59c6fe50c18d5c474449e09b36b1ef2452d0db refs/heads/main $ git remote -v origin https://github.com/xloem/knockoffmonitor (fetch) origin https://github.com/xloem/knockoffmonitor (push)
i'm thinking maybe a good build flow, if it works, could be: - reassemble split apks into single apk - decompile single apk - patch decompilation - recompile this isn't what i'd planned for, as using decompilation for the whole apk means there can be more issues. we'll see maybe. but the .smali and .java tools don't appear to interoperate yet; they don't process each other's output.
i'll spend time getting to know the sources a little while i wait for jadx to download. i looked a little at jadx's usage but it was hard for me to attend to it
blurgh it looks like most of the functionality is wrapped into a huge MainActivity class
goals: - run all the time as a service - notify the user when there is a disconnection. subgoal: delayed log if user does not respond - provide for additional storage modes, such as: external storage, lab streaming layer
my immediate goal is to simply use it. network storage of the data would make this easier.
apparently with flatpak jadx is run with: flatpak run com.github.skylot.jadx and it then runs the gui rather than the cli. more investigation could yield results. in the gui, jadx does indeed load .smali files, which opens options
the decompiler finds 3 errors in decompilation so it makes sense to frankenstein it which is a little frustrating but is likely better than nothing. i guess the reason to do this avenue is because it's psychologically easier O_O . i've tried to build mobile apps on my own so many times, i never get anywhere anymore. this way it starts from something that already runs.
maybe I could put the .java next to the .smali and use a makefile rule to convert them with something like https://github.com/izgzhen/java2smali
basic decompilation: $ jadx/build/jadx/bin/jadx --export-gradle --output-dir com.sonicPenguins.museMonitor-jadx com.sonicPenguins.museMonitor.apk it makes a gradle project. haven't gotten to the point of testing it quite, but it's expected to fail. however: - jadx supports reducing the intelligence of its decompilation; it has different output formats. there may be one that basically recompiles identically because it is so simple, uncertain. - jadx supports decompiling only one class from the apk so, it may be possible to make some kind of recompilable environment for classes that aren't being mutated, and then do a higher level decompilation for the mutated classes. not certain. lots of testing i guess uncertain. using javac and java2smali, i've run into the issue of not being sure how to construct the classpath to include the android sdk. a basic thing that i'm simply unfamiliar with. so i'm gravitating toward jadx's gradle export atm because there's a chance it will handle that already,
well i'm getting a little too tired to reach completion with this approach my state of mind will change when i sleep. i have something else to do tomorrow. i'll just run the app on my phone at this point ! there are possible permissions to add https://mind-monitor.com/forums/viewtopic.php?t=1759 not sure why the author's experience differed from mine . these wouldn't be hard to add. ohhh it would have differed because other people had the permissions enabled that i had disabled. my device is at 5% battery. unfortunate.
participants (1)
-
Undiscussed Groomed for Male Slavery, One Victim of Many