ethical-haquer / Galaxy-Flasher

A GUI for Samsung Flash Tools
GNU General Public License v3.0
48 stars 3 forks source link

Porting to LibAdwaita and publishing to Flathub #12

Open IverCoder opened 6 months ago

IverCoder commented 6 months ago

Is your feature request related to a problem? Please describe.

I have used this app a few times and it worked pretty well for me. However, it can use a bit of UI polish and more discoverability by being published on an app store. Few people unfortunately know about this nice piece of software, a bit more public exposure would be a big help.

Describe the solution you'd like.

The app can be ported to LibAdwaita for a quick and easy UI interface, use the XDG portals File Chooser and File Transfer for accessing the files to be flashed and facilitating drag and drop, and probably the Inhibit portal as well to prevent logging out or shutting down while flashing. Then the app can be submitted to Flathub.

Describe why the feature would be helpful

Flathub is the fastest-growing app store for desktop users, and LibAdwaita guarantees a nice UI compliant with GNOME's HIG for the best user experience.

Thor GUI version

Alpha v0.4.5

ethical-haquer commented 4 months ago

Apparently, PyInstaller works to package Thor GUI GTK. I was able to make a working executable on Debian 12 with no extra configuration. Maybe new GitHub releases can include PyInstaller executables, at least before we get it on FlatHub. (although having an alt way to install it wouldn't hurt either).

ethical-haquer commented 4 months ago

I figured you were working on that! Nice work!

ethical-haquer commented 4 months ago

I've been working on trying to get GTK4 compiled on Debian 10, but after working on it for like a week straight I still haven't gotten quite there. I'm going to work on renaming Thor GUI to "Galaxy Flasher" (or should it be "GalaxyFlasher"?), and adding support for Odin4 and PyThor (keep up the good work, BTW!). Also, I made a few scripts while trying to compile GTK4, I will probably push them to a repo in case you want to have a look at them.

ethical-haquer commented 3 months ago

Bro, I figured out what we need for Odin4 support, a shell script! I just added a simple example in the last commit.

justaCasualCoder commented 3 months ago

Looks great! I was thinking though, it's a little inefficient to run python inside of python (in the case of PyThor)... It would be easy to include PyThor just using git submodules. The issue is finding a way to get PyThor's CLI in the VTE terminal (without running Python again).

ethical-haquer commented 3 months ago

Thanks! Yeah, you're right, there are better ways to interface with PyThor. I just improved the wrapper a ton, but I still need to test it more. Also, "Odin4 Wrapper" is not the best name, feel free to suggest anything! 🤣

ethical-haquer commented 3 months ago

Alright, I finally got around to testing the Odin4 wrapper (now called "Interactive Odin4"). Only the flash command needed tweaking, Odin4 was complaining about invalid options. Next up is implementing support in Galaxy Flasher!

ethical-haquer commented 3 months ago

Odin4 flashing is now supported! I just flashed my S5 with no issues.

ethical-haquer commented 3 months ago

You are now able to select a device with Odin4! Also, if there's only one device, it doesn't ask you to select one (something that should be added to Thor).

One of the major changes is that I made a get_command_output function. While I was making it, I saw a lot of similarities between it and scan_output, and after thinking about it, I've realized that scan_output was crucial to Thor GUI because it was able to detect certain lines, say "Choose a device to connect to:", and present a pop-up window to the user. That was important because with Thor GUI you couldn't just have the Log tab in focus and use keys normally to navigate interactive commands, at best you could use the "Space", "Enter", etc. to try and navigate.

Now the user can use commands in the terminal like normal, so we don't need to detect "Choose a device to connect to:" and display a pop-up window. If the user uses the terminal directly than that should imply that they don't want pop-up windows, and if they use the GUI, than get_command_output can handle that stuff on it's own. The same for the command entry, we have the ability to see the commands they run, and use get_command_output for that too.

The only things I can think of right now that to be added to get_command_output is the ability to see more than what's onscreen (I believe the answer is here: term_text = vte.get_text_range_format(Vte.Format(1), 0, 0, 10000, 10000)[0], I also just noticed that I removed the comment you had there, I'll have to re-add it.) and the ability to handle interactive commands.

In short, I think that scan_output should eventually be used only when we need to detect the user running a command through the terminal, for things like enabling more buttons. Other than that, get_command_output should be able to fill in. Sorry for the long comment! 🤣

ethical-haquer commented 3 months ago

get_output now sees the whole terminal, there's a setting for changing the theme, and I just rewrote Thor's partition selection code. Next is adding a setting that allows the user to select the partitions themselves. The thor_flash function can be improved, but it does work. (it was a PIA to implement 😄)

ethical-haquer commented 3 months ago

You're now able to manually select partitions with Thor. I also added a really minimal right-click menu for the terminal.

I think the branch is nearly mature enough for a release. It's not perfect, but that's not what a release is for. It is way better than the previous release; We've gone from partial support of one flash-tool to near full support of two flash-tools.

Here are a few things that should be done before it is released (let me know if you have stuff to add!):

I would love to hear what you think!

justaCasualCoder commented 2 months ago

@ethical-haquer It looks great! I agree, it's probably time for a release. Publishing Galaxy Flasher to Flathub might also be a good idea (for the TODO list!)

ethical-haquer commented 2 months ago

@ethical-haquer It looks great! I agree, it's probably time for a release. Publishing Galaxy Flasher to Flathub might also be a good idea (for the TODO list!)

Thanks! I'm planning to release it tomorrow, hopefully. Which TODO list are you referring to?

ethical-haquer commented 2 months ago

So, what do you think of the possible new flash-tool setting? Also, did you see the new print_widget_tree function? It's a pretty simple function, but it can even handle mapping the whole window. I used it to figure out how to add that custom label to the expander row. I'm going to have a look at removing redundant code, improving the scan_output function, and improving the way setting options works. Oh, and I guess I should finish the flash-tool setting as well. 😄 What have you been working on lately?

justaCasualCoder commented 2 months ago

@ethical-haquer All the commits look great!

ethical-haquer commented 2 months ago

@justaCasualCoder Thanks! Here's another one. 😄 Stuff that needs to be done:

ethical-haquer commented 1 month ago

@justaCasualCoder I hope you're enjoying your vacation! I'm actually taking a vacation in Alaska right now. Where are you?

probonopd commented 1 month ago

Please don't. libadwaita doesn't work well outside of the Gnome desktop. Switching to libadwaita would significantly reduce the potential user base for this application, essentially limiting it to the fraction of users who happen to use Gnome.

ethical-haquer commented 1 month ago

Please don't. libadwaita doesn't work well outside of the Gnome desktop. Switching to libadwaita would significantly reduce the potential user base for this application, essentially limiting it to the fraction of users who happen to use Gnome.

We've already started switching to Libadwaita, and probably will keep using it, but I'm up for supporting multiple GUI toolkits. What GUI toolkit would you prefer? I know of Kivy, Qt, and wxPython, but I'm sure there are others.

probonopd commented 1 month ago

Definitely Qt, without question. I am sure you will not look back.

ethical-haquer commented 1 month ago

I'll start looking into it, thanks!

justaCasualCoder commented 1 month ago

@justaCasualCoder I hope you're enjoying your vacation! I'm actually taking a vacation in Alaska right now. Where are you?

I did! Galaxy Flasher is looking really good, great job with that! I might be able to help with QT but I have only used PySide6 a little bit. I'm working on a WebUSB port of Thor, and it's going pretty good so far!

ethical-haquer commented 4 weeks ago

@justaCasualCoder I hope you're enjoying your vacation! I'm actually taking a vacation in Alaska right now. Where are you?

I did! Galaxy Flasher is looking really good, great job with that! I might be able to help with QT but I have only used PySide6 a little bit. I'm working on a WebUSB port of Thor, and it's going pretty good so far!

Thanks! Yeah, I've never used QT before. GF will definitely need to be broken up into separate files. That Thor port sounds nice! So it's like a webpage you can use, right? I was looking into reverse-engineering Odin4, and I think it's possible, but I need to learn a little C++ first.

justaCasualCoder commented 2 weeks ago

Thanks! Yeah, I've never used QT before. GF will definitely need to be broken up into separate files. That Thor port sounds nice! So it's like a webpage you can use, right? I was looking into reverse-engineering Odin4, and I think it's possible, but I need to learn a little C++ first.

Yep, just a webpage!