Samsung Galaxy S7 Battery Swap

Sure, the Samsung S7 is a 6 year old phone at this point – but it’s perfect for my son who’s in grade 7 and doesn’t really need a phone. The other day it stopped turning on – when you plugged it in, it would indicate the battery was at 100%. I could even get it to power on while plugged in, but removing the USB power would result in an immediate black screen as it powered off hard.

I sort of dreaded opening this phone up because it’s one of the ones that is glued shut. I was pleasantly surprised, as a little heating with the heat gun and the all metal back came up pretty easily using a suction cup. After that there were some phillips screws to remove and I was able to see the battery.

It was clear there was a problem here – the connector should be squared up with the rest of the circuit board. If you look closely – you can see that the battery has also shifted down significantly within the phone, nearly 2mm.

Taking a close look at the cable – you can see the connector is a little busted up despite my photo being a bit out of focus.

I attempted to reconnect the cable, but soon found out that the connector was badly damaged and it snapped off the cable completely.

Oh well. Off to search up buying a new battery for this phone. A quick look around and it seems there are lots of choices – some as low as $16 (eBay), and the normal crazy mark-up ones at $60-$90. I opted for one of the Chinese made knock off brands off of Amazon that came with tools (junk) and the adhesive to re-attach the back. It also claimed to be 3300 mAh vs the stock 3000. It was at a slight premium vs. eBay, but only a couple of bucks and the reviews were good. Worth the $25 and it shipped to me the next day.

My pricing logic for stuff like this is to avoid the cheapest prices – these are often very cheap for a reason. There is a step up from the cheapest where you’re going to get basically the same part up to the next price plateau – if you can discern the price notches you can basically buy at certain quality levels. The danger with all of these is that lots of unethical sellers will slap OEM labels on parts that are not, so often paying a high premium is not buying quality at all. It’s always a gamble which is frustrating.

The battery I’m replacing was already previously replaced. I think this is why the battery didn’t fit very well in the phone.  The poor fit is likely what resulted in it breaking off (when the phone was dropped, probably multiple times if I know my son). If you fit the broken battery into the compartment properly there is a significant gap at the bottom.

Again, this is nearly 2mm gap. The OEM battery is tape/glued in – but I suspect it also fit much more snugly in the space. If you are replacing a battery – consider if it will slide around and either tape – or pad it – to avoid the battery moving. I know that I’ve done battery swaps and left a gap in the past – I probably won’t in the future.

The new battery fits like a glove. Top to bottom, almost no space to move around. So I didn’t bother taping it in place, I’m pretty confident it’ll stay put.

While I’m not a fan of glued shut phones – I did use adhesive to re-seal the phone. Hopefully I won’t have to go back in at all. In a couple of years this phone will basically be too old to use. While it’s still running stock firmware, it does appear that there is an unofficial but current LineageOS build for it.

The S7 got a 3/10 score for repairability – but it wasn’t really that bad to get at the battery. The places where it got hit on the score was replacing some of the other components – I’ve certainly had more than 1 USB charge port go bad, and gluing that to the screen seems like a really bad idea. There really needs to be a better trade of for waterproofing and repairability.

Upgrade Pixel XL to LineageOS 17.1 (Android 10)

LineageOS recently pushed official 17.1 images for my phone, the Pixel XL (marlin). I’d been stalling a little bit in the upgrade as the only path is a manual and I was concerned I was going to lose all of my application state.

I finally took the plunge, in part I was keen to move to the new Android 10 features – and LineageOS has also stopped their 16.0 builds, and this means you won’t get new security patch levels.

It turns out that while you need to take some manual steps, the upgrade path was very smooth. Still, here are the steps I took:

(1) Backup

  • I already make use of SimpleSSHD to support nightly SSH based backups.
  • Export settings from various apps: k9mail, feedme, etc. that are not backed by cloud services.
  • Run SMS Backup+ to archive all my SMS to my gmail account.

Usually I run TWRP recovery, but LineageOS has moved to their own recovery. Unfortunately the LineageOS recovery doesn’t support Nandroid backups. You can however still use adb backup.

To perform an adb backup, have the phone running as normal. Enable both developer options, and then allow adb (debugging) and adb root access. To do the backup we need to let adb connect, and have root access to access the files.

On your desktop machine:

Your phone will prompt you for confirmation of the backup process. Once it starts to run, it’ll take a while (mine was 8GB over USB2).

Additionally I manually copied the backup files (exported settings) I had made.

(2) Download the ROM

Grab the 17.1 marlin ROM from LineageOS. I also run the Google stuff, so also go to OpenGApps to get that. I initially picked ‘stock’ because I though, hey the Pixel is as Google a phone as you might get. The list of stock apps is pretty close to what I have installed anyways – despite the fact that my current gapps is the nano version.

Once I upgrade my phone to a later version of the hardware, I’ll probably stick with the Pixel line. LineageOS isn’t officially supported on the more recent hardware, but the delta between LineageOS and Google stock has become pretty slim too. I may finally give up on custom firmware and run stock, we’ll have to see.

[If you read on, you’ll note that I ended up falling back to the nano pico gapps build.  Oh well]

(3) Check hashes of all downloads

Always check the hashes. I’ve personally had bad downloads. You don’t want a bad file to cause you additional grief, it’s easy to check.

(4) Upgrade

We can follow the LineageOS upgrade wiki to do the install.

My device did reboot to a blank screen, but once I started the next command – I got a visual progress display. It is possible I just didn’t wait long enough, but either way things started up just fine.

If you are as I am, intending to install the Google apps, then you want to avoid booting into normal mode.

On the phone in recovery once it has finished the sideload

  • Click Advanced
  • Reboot to Recovery
  • Once recovery start again..
  • Click Apply Update
  • Apply from ADB

Now we sideload gapps:

Note: It does appear that I got a new recovery as part of the lineage install.

Here is where I ran into trouble with the stock version of gapps. While the source file did match the md5sum, the phone install was giving me a signature verification failure – at 47%.

oh oh.. 1st try to install the (md5sum verified) gapps.. and I get a signature verification failure.. but at 47% progress.. hmm. It turns out that other people have had exactly this problem.

The 47% appears to be a side effect of the sideload process. I banged my head on this a few times, until I carefully read what was actually being reported on the phone screen when the verification failed.

Not enough system space to install the stock gapps. Sigh, how many times have I struggled with getting a computer to do something when the problem was that I didn’t carefully read the error message.

Downloading and installing the nano pico version worked fine, but my notes say that I still saw the signature verification failure (this may be due to the gapps approach to building the bundle).

(5) Reboot

And wait, and wait, and wait.. The first boot is always exciting and takes enough extra time you start to worry something is wrong.

And.. it’s alive! All my apps/data are still “ok”. This is unexpected, I had prepared myself to do a full rebuild of things, but it seems that this upgrade path allows my applications and their state to persist.

There were some minor configuration difference (launcher UI settings reset.. to 5×5 instead of 5×6 which I prefer). This was easy to fix and my layout was fully restored.

A bunch of permission checks popping up too, still overall a mostly painless upgrade to Android 10. Lots of settings persisted, like my mobile data per app preferences. Ringtones and sounds were busted, because the LineageOS sounds have been replaced by the Pixel ones.

(6) Epilogue

It’s been over a week, and no big surprises (which is good).

The whole Privacy stuff is great. I always liked Privacy Guard in LineageOS and now that similar function added to Android itself, I’m ok with letting that go. I’m a bit disappointed with the stock sounds available, I may just need to go add the old LineageOS sounds as user sounds so I can get the ones I’m used to.