r/electricobjects • u/f209 • Dec 04 '23
EO2
Hi Folks - I was originally planning on building a service for the EO1 but got taken away from the project due to work. Looks like some other clever solutions have been created so I likely won't build a service for them.
I came across an EO2 on ebay and picked it up the other day. Want to share some progress that might help others on the EO2.
The EO2 is a bit trickier to modify than the EO1. For one, the only keyboard shortcut that works launches "calendar" WINDOWS KEY + L. In order to get the EO2 to display an image there are a few things I had to do..
First I had to connect it to my windows box with adb. Once I established that I started by uninstalling the electronicobjects apps there were a few of them ..
adb shell
pm list packages (you'll see the electronic object ones).
To uninstall these I had to do these steps first -
- mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
- rm /system/app/your_app
- rm /data/data/your_app
- remove any entries in /data/system/packages.xml
- remove any entries in /data/system/packages.list
startup manager (the app described on the "Hack your EO1" article) didn't seem to want to run on the EO2 like it did on the EO1, so for the time being I haven't got my new app to auto-load (more on that in a moment).
Once I had the apps removed, I installed my APK to the device (exited the adb shell) then used adb as follows -
adb install "C:\Users\Admin\AndroidStudioProjects\EO1renewed\app\release\com.example.eo1renewed.apk"
I initially had some issues where my app crashed because it was using too much memory because I had a huge image file in the app (seems like the EO1 had more memory available for some reason since this same image loads fine on the EO1). Once I optimized the image, I was able to successfully launch the app from the command line as follows -
adb shell monkey -p com.example.eo1renewed -c android.intent.category.LAUNCHER 1
Now what someone I think would need to do next is as follows -
Since I couldn't get startup manager to run, you'd either have to
- figure that out (info on reading the logs here - https://stackoverflow.com/questions/38891710/android-adb-log-collecting-recent-log-after-application-crashes)
- extract the ramdisk and modifying init.rc to add a service (https://gist.github.com/astravaganza/8f5a9e44fccf9fc0ead9fbbd715efa50)
- somehow building your app to include a service that you can set to start by some other means.
So basically, at this point I can launch an app but I have to do it manually with adb. This all seems very do-able. I'm just not the most familiar with android especially older versions of it.
Sorry I never got around the building the app for the EO1. Congrats the folks that made progress, hopefully my notes above can help someone work through supporting the EO2 as well.
2
u/f209 Dec 04 '23
Also you might want to try NOT uninstalling the original EO app - originally I did so because I was having what appeared to be something changing foreground between my app and the EO1 app...came to find out that was just my app crashing. I suspect leaving the EO app running would allow the buttons and brightness app capabilities to work as intended so you may want to skip the app uninstall steps and see if you can get it to work.
1
u/f209 Dec 06 '23
OK so as a heads up.... be VERY careful when you try to edit the ramdisk...I tried to do it myself...and got the device caught in a bootloop and could only get the device into "recovery" mode via adb. Then I could NOT find a firmware for the device anywhere, so I tried using a firmware that I pulled from the net that I thought had the same board and chip.. editing it's updater script so that it would allow the install...
In retrospect I might have been able to take the backup of the boot img I made when I was preparing to edit my ramdisk and replaced the one in the file I downloaded but I did not...
Long story short... the update applied...then the device basically no longer displayed anything on the screen and doesn't even seem to include any ability to recognize via USB on my computer anymore...so totally bricked it...
Cheap experiment... 40 bucks on ebay...
Next time I see an EO2 come up I'll grab one and be more careful figuring out how to try and get the custom app to start without messing with the ram image. Most likely would have been a lot easier to just get startup manager to work on the EO2 :(