DoESLiverpool / somebody-should

A place to document practices on the wiki and collect issues/suggestions/to-do items for the physical space at DoES Liverpool
31 stars 11 forks source link

Admin mobile phone is slow/hard-to-boot #1756

Closed amcewen closed 1 year ago

amcewen commented 1 year ago

The admin mobile phone is sometimes left unplugged, so runs out of battery. It takes quite a while to boot up, so it's tricky to then take card payments.

Yesterday I'd noticed that, but even after leaving it for a while - it was reporting being at ~60% charged - it wouldn't cleanly boot up so I gave up and we raised an invoice instead.

MatthewCroughan commented 1 year ago

State! Factory reset and start again! What phone model is it? I could potentially build DoES a custom LineageOS Android image for the phone that only has the specified applications on it, so that no unwanted state accumulation and slow down is possible. With no Google/PlayStore, etc. We can even run the OTA update service at android.doesliverpool.xyz, to keep it up to date. I already do this for my devices.

DoESsean commented 1 year ago

The phone is properly dead, I think. Even when plugged in it'll show as zero battery and charging, so I think it's just done for. To be fair, it's my old phone from at least three upgrades ago, which makes it a minimum of 7 or 8 years old at this point.

Until we get a new(er) one, it's still possible to take card payments if you have the Zettle app on your own phone - you just need to log into the DoES Zettle account, and proceed as you would if using the admin phone. I've just taken a payment from @JackiePease in this manner.

JackiePease commented 1 year ago

@goatchurchprime has donated an old Samsung. The glass on the back is broken, but @Sean-anotherone has made a stand for it. It's on @DoESsean desk. Once the glue has dried we need to tape the phone in with double-sided tape, and install whatever software it needs.

Sean-anotherone commented 1 year ago

Before taping the phone in, a hole will need to be made for the power button.  I did not think about this when making the case, only the charge port.

On Sunday, 16 April 2023 at 16:20:24 BST, Jackie Pease ***@***.***> wrote:  

@goatchurchprime has donated an old Samsung. The glass on the back is broken, but @Sean-anotherone has made a stand for it. It's on @DoESsean desk. Once the glue has dried we need to tape the phone in with double-sided tape, and install whatever software it needs.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

amcewen commented 1 year ago

Had an initial look at how we can get the iZettle app installed on the "new" phone. It's running LineageOS, so doesn't have the Play Store installed by default. Looks like that can be installed separately, so we should try that next.

amcewen commented 1 year ago

Had a go at installing Gapps on the (Galaxy S8) phone (to get the play store) at Maker Night.

The install seemed to go okay, but has left the phone in a state where it's forever booting up. It seems to time out after a while and restart, but still just gets to booting up Lineage. I left it going, plugged in, last night in case it was just a long install, but it's still in that state this morning.

There was mention of Gapps being the first thing installed after the OS, so maybe we need to reinstall Lineage first? Needs more investigating either way :grin:

MatthewCroughan commented 1 year ago

@amcewen It's pretty easy to brick the system/userdata partitions by flashing random zips that people make on XDA forums, they often are not made correctly. You'll have to reflash LineageOS proper by wiping system/userdata in TWRP, flashing the LineageOS Zip and then try using a GApps package generated from https://opengapps.org/

Alternatively, try just using F-Droid to download Aurora Store (An open source play store client)

amcewen commented 1 year ago

It seemed less of a "random zip" when opengapps.org doesn't have a download available for Android 12, which is what the phone is(/was) running :stuck_out_tongue:

The Samsung Galaxy S8 isn't officially supported by LineageOS, so have you got any suggestions other than a post on the XDA forum for where to get a ROM for it?

MatthewCroughan commented 1 year ago

@amcewen I'm making a Nix expression that builds LineageOS from source and embeds MindTheGapps into it right now. Once done I'll put the Zip/Image in the releases for https://github.com/DoESLiverpool/nixcfgs/ as well as instructions should anyone wish to reproduce it in the future. This means we are maintaining our own ROM and not using random XDA images.

I also found out that OpenGapps isn't maintained anymore and that https://nikgapps.com/ is the fork that is. But MindTheGapps is also maintained and comes in a format that permits me to build it and add it to the LineageOS/AOSP vendor folder as an overlay (vendor/gapps) so I'll just use that for now.

ETA an hour or two.

MatthewCroughan commented 1 year ago

If you want to see the WIP code for that, it's here https://github.com/DoESLiverpool/nixcfgs/commit/1e4e170cb2f41e93702c3e934d901dd8066b2259

nix build github:doesliverpool/nixcfgs/mc/admin-phone#robotnixConfigurations.admin-phone.ota will reproduce and build an image you can flash via TWRP locally if you want to, but my 32 thread Ryzen is currently churning away building it, so it'll probably be faster.

amcewen commented 1 year ago

There's no rush. I doubt I'll do anything with it before next Maker Night.

Will apps installed on it automatically update?

MatthewCroughan commented 1 year ago

@amcewen Yes, it just runs the same Google Play Services program as any normal device you'd expect from a vendor like Samsung, and Google Play Services will manage/maintain itself, (which I don't like), but it will work as you expect.

MatthewCroughan commented 1 year ago

Look at the build go. Wheeeee!

image

MatthewCroughan commented 1 year ago

@amcewen Where is the phone located? I'll come in tonight and flash it so that you can get on with configuring the banking app credentials when you next get around to it. I will record the process so that no details are missed.

MatthewCroughan commented 1 year ago

@amcewen I'm not sure if this works yet and I may have to adjust the build, but if you get a chance try to flash this in TWRP after wiping cache data and storage https://github.com/DoESLiverpool/nixcfgs/releases/download/admin-phone/9wqanig7almllv5j8rafay3vrjkcnjbv-dreamlte-ota_update-2022110721.zip

MatthewCroughan commented 1 year ago

I have taken the phone and performed the following steps:

  1. Factory reset via TWRP wiping all partitions available on the "Wipe" menu
  2. Updated TWRP from 3.6.2 -> 3.7.0
  3. Flashed the result of nix build github:doesliverpool/nixcfgs#robotnixConfigurations.admin-phone.ota adb sideload in TWRP
  4. Booted into the device

The Google services come preinstalled as they have been inserted via the Android/LineageOS (AOSP) build process, and all @amcewen needs to do now is log in to the various banking apps with the credentials. The phone is now sitting in its laser cut cradle on @DoESsean's desk waiting to be provisioned.

The build did require a modification to include the MindTheGapps vendor folder, that modification looks like:

...
  vendor.extraConfig = ''
    include vendor/gapps/arm64/arm64-vendor.mk
  '';
...

MindTheGapps is the main distribution of Google Play Services for LineageOS devices and is tested to be working with LineageOS by upstream.

The FlameGapps zip that was previously flashed survived TWRP's normal "wipe" and "delete data" options via some functionality called a "survival script" which kept bricking the Android installation each time I tried to flash a new one. I had to choose advanced wipe and get rid of it for good, it's indiscernible from malware.

I've merged the Nix work into the master of the nixcfgs repo https://github.com/DoESLiverpool/nixcfgs/commit/9f3e21ba75924c881b188a9d2c80fa02269fe55c and the final pre-compiled zip file for this work is available at https://github.com/DoESLiverpool/nixcfgs/releases/download/admin-phone/zgfz5xr0fpdp584awinpvdrjrwz0qlwx-dreamlte-ota_update-2022110721.zip

amcewen commented 1 year ago

I've set the phone up with the same Play Store account as the last one had, and installed and set up Zettle. I've made a test donation with my card, and that seemed to go through okay (it's left my account at least!).

I've cut part of the case off to allow access to the power switch, and fixed the phone in with some glue-dots (so it will come out again, but not accidentally).