Commit Graph

295 Commits

Author SHA1 Message Date
Ido Ben-Hur 9d5e1ddfed
OpenDelta: MainActivity: Improve some code
Use switch case and reuse more code.
2022-10-21 15:59:45 +03:00
Ido Ben-Hur 0e6967f688
OpenDelta: Properly describe a SHA mismatch state 2022-10-21 10:40:00 +03:00
Ido Ben-Hur 03147665ce
OpenDelta: Do not leak service connection
We bind using the old API so we should also unbind.
bind onCreate so symmetricly unbind onDestroy
2022-10-20 15:45:10 +03:00
Ido Ben-Hur a8f06d50a9
OpenDelta: Remove deprecated delta scheduler option
And some other missed vars during de-deltaing
2022-10-20 15:44:44 +03:00
Ido Ben-Hur 3844f53652
OpenDelta: Alert only once for progress notifications 2022-10-20 01:59:46 +03:00
Ido Ben-Hur 71e4734f65
OpenDelta: Fixup check function after de-delta
should return before checkExistingBuild if the date isn't greater than
2022-10-20 01:15:19 +03:00
Ido Ben-Hur e901cae04b
OpenDelta: UpdateService: Refactor download out 2022-10-19 18:32:15 +03:00
Ido Ben-Hur 075dcb3cc5
OpenDelta: De-Delta
no one is gonna use this risky s**t anyways

Also:
Improve so much code all around, prep for rewriting a lot.
Get rid of the official tag check
And another old AF config no one needs
2022-10-19 18:11:41 +03:00
Ido Ben-Hur 3cebec66f6
OpenDelta: Manually request POST_NOTIFICATIONS if missing 2022-10-07 20:21:09 +03:00
Ido Ben-Hur 3d5eeb8126
OpenDelta: config: A13 tag 2022-10-07 20:21:09 +03:00
Ido Ben-Hur 926711413e
AndroidManifest: Add missing perm for notifications on A13 2022-10-02 13:47:43 +03:00
John Galt 0742da4b8a zlib -> zlib-ng 2022-09-28 09:46:30 -04:00
Ido Ben-Hur 5f25015f18
OpenDelta: Refactor state handling out of UpdateService
TBD: Move more things out such as download handling
2022-09-06 00:09:04 +03:00
Ido Ben-Hur adf8449d9e
OpenDelta: Also set sub text when updating progress
Otherwise resuming the activity while flashing a local file for example shows no status string.
Also get rid of some useless functions
2022-09-03 17:36:35 +03:00
Ido Ben-Hur 36b4d747e6
OpenDelta: Don't show the changelog when flashing a local file 2022-08-27 03:26:32 +03:00
Ido Ben-Hur 1b4e4b80de
OpenDelta: Stop abusing intents & refactor
For service - activity communications, bind the service instead.

Also:
* Force portrait, get rid of old land layout
* Do not use network on autoState
* Properly handle download notification actions - w/o dismissing
* Stop using shared prefs to trigger service events
* Improve and simplify a lot of code
* Get rid of some edge case crashes
* Many other fixes I can't recall
2022-08-16 07:15:27 +03:00
Ido Ben-Hur ffa3654fcb
OpenDelta: Redesign to fit A12's style better 2022-08-12 01:36:18 +03:00
Ido Ben-Hur 0431996eb9
OpenDelta: Don't update EVERYTHING on progress
This was VERY expansive. Can actually feel the difference in responsiveness.
Considerably less CPU usage and CPU time after this fix.

Also make sure we're rate limited to at least 250ms everywhere except sum verify
2022-08-11 18:08:58 +03:00
Ido Ben-Hur a4c587c09b
OpenDelta: Correctly name public vars
Shortens many lines, follows convention and increases maintainability (which this project lacks anyways)
2022-08-11 18:08:51 +03:00
Ido Ben-Hur aa091f86ee
OpenDelta: Show the changelog of the next version
And get rid of stupidly settings static titles strings, just set the visibility instead
2022-08-11 18:08:04 +03:00
Ido Ben-Hur 5ee40c7d61
OpenDelta: Reliably show when an update is pending a reboot 2022-08-06 17:59:45 +03:00
Ido Ben-Hur a3fa47ede7
OpenDelta: Always skip checking when we are in progress
No need to re-check when we are downloading, nor when we are flashing
2022-08-05 19:19:02 +03:00
Ido Ben-Hur 4b90ed7cae
OpenDelta: Add download notification actions
Also reliability improvements to the way the UI reflects current state
2022-08-04 20:58:31 +03:00
Ido Ben-Hur 34eba98b80
OpenDelta: Provide a proper UI for pausing / resuming downloads
Also allows the user to actually pause (without a network interrupt)
Stop button UI was reworked for this as well
Better reflects a network error is resume-able as well
Many other minor bug & code fixes while at it
2022-08-04 04:41:22 +03:00
Ido Ben-Hur e1c7850150
OpenDelta: Avoid getting stuck in null state
When the user removes the update zip after we're in ready to flash state he could still press on flash
which results in STATE_ERROR_AB_FLASH but we still have the ready prefs set
To avoid just clear the state when the package is not found
2022-08-01 14:32:45 +03:00
Ido Ben-Hur feda8bbda7
OpenDelta: Clean some mess, Target latest SDK
* Adapt for latest SDK
* Get rid of many deprecations
* Use apply() instead of commit() where possible for shared prefs
* Many others like unused vars, bad formatting, bad practices and so on
Really too lazy to list all, just take a look.
2022-08-01 14:05:28 +03:00
Ido Ben-Hur 565bc3b464
OpenDelta: Fix checksum validation for existing files
Also unify the mess that was going on there. Use one function for all.
Always show progress when we check the whole file again.
Few other minor improvements
2022-07-29 21:15:43 +03:00
Ido Ben-Hur 39278dbb2a
OpenDelta: Get rid of old .part files
Just incase the user interrupted a download and decided to wait till the next one
Also fix some typos
2022-07-10 14:27:30 +03:00
Ido Ben-Hur 305b6fd61f
OpenDelta: Make sure we close I/O streams
After downloading / when failing
2022-07-10 11:31:57 +03:00
Ido Ben-Hur eca96ad8f7
OpenDelta: Only set PREF_LAST_DOWNLOAD_TIME once 2022-07-08 15:13:26 +03:00
Ido Ben-Hur 1402f86464
OpenDelta: Delete the downloaded file if corrupted
Resume is no more and the file sum is still mismatching - get rid of it
2022-07-08 14:04:15 +03:00
Smogr Hzzgn 311a879f35
OpenDelta: Show MiB/s when more than 1023 KiB/s (#1) 2022-04-21 23:05:59 +03:00
Ido Ben-Hur ae8c38836c
OpenDelta: Resume interrupted downloads
And update download progress less frequently
2022-02-21 14:12:14 +02:00
Ido Ben-Hur 22e8f90c3b
OpenDelta: Add support for AOSP recovery on A-only
Making android disable encryption for the OTA zip and rebooting to recovery to flash it.

Also remove CWM recovery support. This thing is way too old and too dead.
2022-02-03 14:30:24 +02:00
Ido Ben-Hur 900a97d116
OpenDelta: Check if already installed more reliably
In case the user opened the app too soon after boot
2022-01-24 03:43:33 +02:00
Ido Ben-Hur 9aa25d9150
OpenDelta: Correctly split % between AB flashing stages
Also get rid of that stupid hacky method of setting offset wtf??
2021-12-15 03:36:32 +02:00
Ido Ben-Hur 8d9c84958c
OpenDelta: Resume showing A/B progress if closed
Also refelct:
E/update_engine(1463): [ERROR:update_attempter_android.cc(90)] Replying with failure: pc:0x6241ff04b8: An update already applied, waiting for reboot
with the reboot notice, instead of being stuck at 0%

Also cleanup some code. More to come.
2021-12-15 03:12:03 +02:00
Ido Ben-Hur edd17def43
OpenDelta: Do not hardcode button color
A. It is a bad pracrtice
B. It is barely readable in some cases
2021-11-24 01:53:12 +02:00
Ahmed Harhash 4871877b6e
OpenDelta: Update app icon
* Update the YAAP logo
2021-11-22 18:53:21 +02:00
Ido Ben-Hur 77f43ce75d
OpenDelta: Update configs for A12 2021-11-19 18:17:57 +02:00
Ido Ben-Hur 9d63b089ce
OpenDelta: Adapt to new advanced reboot API 2021-11-19 15:57:39 +02:00
Ido Ben-Hur decfcdf982
OpenDelta: Add missing header libs
aka fix build on A12
2021-11-19 15:11:32 +02:00
Ido Ben-Hur 271879d356
OpenDelta: Dismiss download notification when done 2021-08-09 19:26:52 +03:00
Omkar Chandorkar 31ef3ab628
OpenDelta: check ro.yaap.device instead
* people can't seem to stop spoofing props and I am sick of it

Signed-off-by: Omkar Chandorkar <gotenksIN@aosip.dev>
2021-08-05 18:43:40 +02:00
Ido Ben-Hur 64bc398cf9
OpenDelta: Get rid of more deprecations and bad practices 2021-08-03 18:17:46 +03:00
Ido Ben-Hur 1ba5c4427e
OpenDelta: Comply with android 11's scoped storage
We don't actually need to use scoped storage, just ask correctly for a full storage perm
Finally target latest SDK, this is probably not backwards compatible so also change the minimum

Also improve AndroidManifest, get rid of dangerous permissions such as
http communication and useless ones.
2021-07-27 13:12:19 +03:00
Jyotiraditya Panda 3dbbddd548
OpenDelta: Switch to blueprint
Signed-off-by: Jyotiraditya Panda <jyotiraditya@aospa.co>
2021-07-02 02:28:28 +03:00
Adhitya Mohan 1848bb6046
OpenDelta: Grammar fixes 2021-06-29 01:42:30 +03:00
Ido Ben-Hur 115fa4fbef
OpenDelta: Slightly improve notifications
* Use a more standardized delimiter for notification sub
* Handle everything from UpdateService
* Never show an empty sub
2021-06-28 02:53:03 +03:00
Ido Ben-Hur 9a154abcd4
OpenDelta: Add progress to the download notification
Also display ETA and speed
2021-06-26 04:36:11 +03:00