You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use glide, I process the request in the inherited DataFetcher class and don’t decrypt the data, but I don’t know how to do it in the coil. For example, the url of the image I loaded is downloaded with the suffix of .bnc. I need to put the specific letters of the data in it according to The password book has been replaced, but now I don't know how to do it, can you call me.
Below is my decryption code in glide,the rules are simple val keyMap = hashMapOf( "0" to "!", "1" to ")", "9" to "&", "a" to "*", "c" to "%", "3" to ":", "2" to "+", "d" to "-", "6" to "<" )
`@Override
public void loadData(@nonnull Priority priority, @nonnull DataCallback<? super ByteBuffer> callback) {
try {
Request request = new Request.Builder().url(model)
.addHeader("referer", ImageLoader.INSTANCE.getReferer())
.build();
call = new OkHttpClient.Builder().build().newCall(request);
Response response = call.execute();
if (response.code() == 200) {
if (model.contains(".enc")) {
String responseBody = response.body().string().replace(" ", "");
HashMap<String, String> keymap = ImageLoader.INSTANCE.getKeyMap();
for (String key : keymap.keySet()) {
responseBody = responseBody.replace(keymap.get(key), key);
}
callback.onDataReady(ByteBuffer.wrap(Hex.decode(responseBody)));
} else if (model.contains(".bnc")) {
byte[] result = ImageLoader.INSTANCE.decryptOrigin(response.body().bytes(), ImageLoader.INSTANCE.getAES_KEY());
callback.onDataReady(ByteBuffer.wrap(result));
} else {
callback.onDataReady(ByteBuffer.wrap(response.body().bytes()));
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When I use glide, I process the request in the inherited DataFetcher class and don’t decrypt the data, but I don’t know how to do it in the coil. For example, the url of the image I loaded is downloaded with the suffix of .bnc. I need to put the specific letters of the data in it according to The password book has been replaced, but now I don't know how to do it, can you call me.
Below is my decryption code in glide,the rules are simple
val keyMap = hashMapOf( "0" to "!", "1" to ")", "9" to "&", "a" to "*", "c" to "%", "3" to ":", "2" to "+", "d" to "-", "6" to "<" )
`@Override
public void loadData(@nonnull Priority priority, @nonnull DataCallback<? super ByteBuffer> callback) {
try {
Request request = new Request.Builder().url(model)
.addHeader("referer", ImageLoader.INSTANCE.getReferer())
.build();
call = new OkHttpClient.Builder().build().newCall(request);
Response response = call.execute();
if (response.code() == 200) {
if (model.contains(".enc")) {
String responseBody = response.body().string().replace(" ", "");
HashMap<String, String> keymap = ImageLoader.INSTANCE.getKeyMap();
for (String key : keymap.keySet()) {
responseBody = responseBody.replace(keymap.get(key), key);
}
callback.onDataReady(ByteBuffer.wrap(Hex.decode(responseBody)));
} else if (model.contains(".bnc")) {
byte[] result = ImageLoader.INSTANCE.decryptOrigin(response.body().bytes(), ImageLoader.INSTANCE.getAES_KEY());
callback.onDataReady(ByteBuffer.wrap(result));
} else {
callback.onDataReady(ByteBuffer.wrap(response.body().bytes()));
}
Beta Was this translation helpful? Give feedback.
All reactions