question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Questions on possible changes to be performed

See original GitHub issue

Hi, I’m opening this issue because, while libaums fulfills most of my needs for EtchDroid, there are currently a few issues which are forcing me to keep my incompatible fork, and I’d reeeeally like to avoid that.

So these are a few changes I’d like to merge here, let me know what you think about them and what kind of changes you would like.


First of all, and we already talked about this, I’d need to access the block device directly. In my fork I made blockDevice public:

https://github.com/EtchDroid/libdepaums/blob/master/libdepaums/src/main/java/eu/depau/etchdroid/libdepaums/UsbMassStorageDevice.kt#L106

I remember you rejected my PR for this because I didn’t have any tests written. Before you ask: no, I’m not planning to write unit tests for the SCSI protocol 😂

It should probably be better to write instrumented tests for that instead of unit tests. And by the way I’m planning to do that! I’m working on a Qemu setup with Android-x86 that emulates a USB 3.0 stick, it works-ish but I need to get some issues fixed.

Other than that it’s just a matter of running qemu with:

  -device nec-usb-xhci,id=xhci \
  -drive if=none,id=usbstick,file=usb.img,format=raw \
  -device usb-storage,bus=xhci.0,drive=usbstick

(Pretty easy to merge if above also gets merged)

I wrote InputStream and OutputStream implementations on top of BlockDeviceDrivers:

https://github.com/EtchDroid/libdepaums/tree/master/libdepaums/src/main/java/eu/depau/etchdroid/libdepaums/streams

With tests:

https://github.com/EtchDroid/libdepaums/tree/master/libdepaums/src/test/java/eu/depau/etchdroid/libdepaums/streams

The use case is simply to be able to copy data in a dd kinf of fashion, which is what EtchDroid does. Having a wrapper that implements a standard Java interface makes it easy for me to reuse code and provide the same kind of functionality on top of other implementations.


(Breaks API)

I don’t necessarily need to access the filesystem inside of the USB drive, the fact that by default it reads the partition table kind of gets in my way, so I had to incompatibly split that away:

https://github.com/EtchDroid/libdepaums/blob/dafec1f38fd2028bd983cc570d4dbf7efbbd3d85/libdepaums/src/main/java/eu/depau/etchdroid/libdepaums/UsbMassStorageDevice.kt#L124-L194

While this is a deal-breaker for me, I could probably be able to keep a soft-fork if you’d prefer not to break the API. Or if you have a better solution that doesn’t break the API I’ll be happy to adopt it.

Let me know 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
depaucommented, Oct 7, 2019

Alright, I will send you a pull request soon™️ 😉

0reactions
magnusjacommented, Sep 12, 2019

This would change the API but it would be perfectly backwards compatible, so that would be fine for me 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 Questions Employees Will Have About Any Change - Prosci
1. Why is change happening now? · 2. What is the risk of not changing? · 3. What is the rush? · 4....
Read more >
50+ Change Management Questions to Ask During a Change ...
What new skills do employees need after the change is complete? What is their skill level now? What resources and activities do we...
Read more >
16 Change Management Questions to Ask - Apty
16 Change Management questions companies should ask to make their change initiatives successful.
Read more >
10 Change Management Questions to Answer for End Users
1. Who or what will this change impact? · 2. Why is this change necessary now? · 3. Do I have choices? ·...
Read more >
Ask these 6 critical questions before implementing company ...
Ask these 6 critical questions before implementing company change · 1. Do you have an inspirational way of sharing what the future looks...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found