seedvault icon indicating copy to clipboard operation
seedvault copied to clipboard

Add support for building installable OTA zips

Open stevesoltys opened this issue 6 years ago • 22 comments

This would make installation easier for users who have root access to their device and are uninterested in building AOSP themselves.

Travis could sign the release APK and bundle it in an OTA zip, similar to what Yalp store does.

stevesoltys avatar Nov 15 '18 02:11 stevesoltys

It should be able to build in F-Droid then

ildar avatar Dec 13 '18 16:12 ildar

Related to #20.

stevesoltys avatar May 17 '19 15:05 stevesoltys

This can be done once https://github.com/stevesoltys/seedvault/issues/58 is merged.

chirayudesai avatar Jul 13 '20 16:07 chirayudesai

So, if somebody desperately wants to flash Seedvault to their (Android 10 based) ROM, they can build a proof-of-concept on top of the no-platform-key branch.

You can get inspiration for how to do that from other OTAs (e.g. F-Droid's priv-ext). Essentially, you need the APK, the two XML files (permissions and whitelist) and a bash script for installing things to the right place.

grote avatar Sep 15 '20 13:09 grote

So, if somebody desperately wants to flash Seedvault to their (Android 10 based) ROM, they can build a proof-of-concept on top of the no-platform-key branch.

ROMs based on Android 11 can now take the master (or later android11) branch which should now also work without being signed with the platform key.

grote avatar Oct 23 '20 10:10 grote

ROMs based on Android 11 can now take the master (or later android11) branch which should now also work without being signed with the platform key.

But still need to flash that as an OTA…?

rugk avatar Oct 23 '20 11:10 rugk

But still need to flash that as an OTA…?

Only if your ROM doesn't ship with it.

grote avatar Oct 23 '20 11:10 grote

I hope this goes back to Android 7.x as otherwise devices of only 6 years old are ending up on the e-waste pile of scrap. Recently updated some devices from Android 4.x to Android 7 and they have the latest security patches of 2020 backported onto them. Ofcourse these are unofficial LineageOS roms but I hope Seedvault can work on them.

Invictaz avatar Nov 04 '20 22:11 Invictaz

Hello, that's very cool to be able to install on any room, thanks for your work ! Would you mind to add a section in Wiki On how to do it from building the apk to finding the 2 xml files for Android 11 ? I'm newb on building apk and would like to use it on my rooted device. Best regards

palight avatar Feb 24 '21 07:02 palight

@stevesoltys @grote Is there an explanation somewhere on how to compile it outside the ROM compilation (for every Android version where Seedvault is currently working)?

Using hidden APIs shouldn't be a problem, there is always reflection. And they work even in new Android versions just by adding a proper xml with: <hidden-api-whitelisted-app package="..." />

ale5000-git avatar May 01 '23 21:05 ale5000-git

Is there an explanation somewhere on how to compile it outside the ROM

Just like any other app - ./gradlew build or in Android Studio

Using hidden APIs shouldn't be a problem

Our solution which avoids reflection has been https://github.com/seedvault-app/seedvault/blob/8bea1be06067eda9c18d984f94f6b1787f2e9614/gradle/dependencies.gradle#L16-L26

chirayudesai avatar May 01 '23 21:05 chirayudesai

Does all branches from 9 to 13 works when compiled without the ROM?

ale5000-git avatar May 01 '23 21:05 ale5000-git

9 might be untested.

The rest should, the app is primarily developed via Android Studio.

chirayudesai avatar May 01 '23 21:05 chirayudesai

Thanks, I will look into doing something about a flashable zip but probably not soon.

ale5000-git avatar May 01 '23 21:05 ale5000-git

The message of @grote refer to the no-platform-key branch, has it been merged back in all android* branches?

ale5000-git avatar May 01 '23 21:05 ale5000-git

no-platform-key hasn't been merged into any branches yet because it's unfinished, hasn't been tested much, and there'd have to be a separate flavor / apk.

Also note that we typically only maintain the latest branch - android13 in this case.

chirayudesai avatar May 01 '23 22:05 chirayudesai

It would be nice if it would be merged as separate flavor but in the same codebase, isn't possible? Like this:

if (BuildConfig.FLAVOR.equals("standalone")) {
    ...
}

I'm not asking any release, just to have it merged. Bugs, if there are, can be fixed later I think.

ale5000-git avatar May 01 '23 23:05 ale5000-git

merged as separate flavor but in the same codebase

Yes, that is possible, but right now it's not a finished commit. It needs to be tested, fixed as needed, and then we can talk about merging it.

Bugs, if there are, can be fixed later I think.

We don't want to merge anything that's untested, not for something as important as a backup app.

chirayudesai avatar May 01 '23 23:05 chirayudesai

I think the no-platform-key branch was just about not needing MANAGE_DOCUMENTS permission which has been merged already in https://github.com/seedvault-app/seedvault/commit/e9f3c082205d72f873abcdc1d45431839ebf5c83 .

grote avatar May 02 '23 15:05 grote

Also relevant: https://github.com/seedvault-app/seedvault/pull/480

chirayudesai avatar May 04 '23 23:05 chirayudesai

Tbh I think a common use-case for a backup tool like SeedVault (besides of backups) would be for users transfering from a stock rom to a custom rom to create the backups before transfering. Sadly as things are right now SeedVault is not able to fullfill that as we're having to switch to a supporting ROM before being able to make use of SeedVault.

I get that it's mandatory for SV to be run as a system app but tbf this is quite easy for rooted devices if there actually was a flashable version...

N0N0 avatar Nov 11 '23 16:11 N0N0

I believe the following development script should work to install the app without building it with AOSP:

https://github.com/seedvault-app/seedvault/blob/android14/app/development/scripts/install_app.sh

It's what we use to install the app on the Android emulator for CI tests. Just need to modify it to support regular (non-emulator) devices. It will be signed with the test keys, though.

It probably wouldn't take much work to bundle Seedvault together in a release zip when we merge to a main branch now that the platform key signature isn't required.

stevesoltys avatar Nov 11 '23 19:11 stevesoltys