This essay introduces a commonly used BASE64 exception condition that is not easily found when encoding and decoding URIs.
Android uses NANOHTTPD as an HTTP server to provide HTTP data stream transmission to the application, using BASE64 to encode a resource, as follows (debug):
Resources:/storage/emulated/0/movies/the Mountain.mp4
Base64 after encoding: l3n0b3jhz2uvzw11bgf0zwqvmc9nb3zpzxmvvghlie1vdw50ywlulm1wna==
At this point the link to this resource is this: http://xxxxxxxxxxxx/L3N0b3JhZ2UvZW11bGF0ZWQvMC9Nb3ZpZXMvVGhlIE1vdW50YWluLm1wNA==
When an external request device requests the resource, the URI is as follows
/l3n0b3jhz2uvzw11bgf0zwqvmc9nb3zpzxmvvghlie1vdw50ywlulm1wna==
That is, more than the original code after the URI of a "/", if not do anything to deal with this URI "/l3n0b3jhz2uvzw11bgf0zwqvmc9nb3zpzxmvvghlie1vdw50ywlulm1wna==" Using Base64 decoding is the occurrence of bad-base64 anomaly, the first character is "/" is removed when the solution.
Android Base64 URI codec bad base-64 exception handling