Initial commit
This commit is contained in:
93
sources/com/bottle/hp/album/media/HPAudio.java
Normal file
93
sources/com/bottle/hp/album/media/HPAudio.java
Normal file
@@ -0,0 +1,93 @@
|
||||
package com.bottle.hp.album.media;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.provider.MediaStore;
|
||||
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HPAudio extends HPMedia implements Serializable {
|
||||
private String album;
|
||||
private String artist;
|
||||
private long duration;
|
||||
|
||||
public HPAudio() {
|
||||
this.mediaType = 2;
|
||||
}
|
||||
|
||||
public static List<HPAudio> getAudios(Context context) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (context == null) {
|
||||
return arrayList;
|
||||
}
|
||||
Cursor query = context.getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String[]{FileDownloadModel.ID, "title", "_data", "_display_name", "mime_type", "_size", "album", "artist", "duration", "date_modified"}, null, null, "date_modified DESC");
|
||||
if (query != null) {
|
||||
int columnIndex = query.getColumnIndex(FileDownloadModel.ID);
|
||||
int columnIndex2 = query.getColumnIndex("title");
|
||||
int columnIndex3 = query.getColumnIndex("_data");
|
||||
int columnIndex4 = query.getColumnIndex("_display_name");
|
||||
int columnIndex5 = query.getColumnIndex("mime_type");
|
||||
int columnIndex6 = query.getColumnIndex("_size");
|
||||
int columnIndex7 = query.getColumnIndex("album");
|
||||
int columnIndex8 = query.getColumnIndex("artist");
|
||||
int columnIndex9 = query.getColumnIndex("duration");
|
||||
int columnIndex10 = query.getColumnIndex("date_modified");
|
||||
while (query.moveToNext()) {
|
||||
int i = query.getInt(columnIndex);
|
||||
String string = query.getString(columnIndex2);
|
||||
String string2 = query.getString(columnIndex3);
|
||||
String string3 = query.getString(columnIndex4);
|
||||
String string4 = query.getString(columnIndex5);
|
||||
long j = query.getLong(columnIndex6);
|
||||
String string5 = query.getString(columnIndex7);
|
||||
String string6 = query.getString(columnIndex8);
|
||||
int i2 = columnIndex;
|
||||
long j2 = query.getInt(columnIndex9);
|
||||
int i3 = columnIndex3;
|
||||
HPAudio hPAudio = new HPAudio(i, string, string2, string3, string4, j, "", query.getString(columnIndex10));
|
||||
hPAudio.setAlbum(string5);
|
||||
hPAudio.setArtist(string6);
|
||||
hPAudio.setDuration(j2);
|
||||
arrayList.add(hPAudio);
|
||||
columnIndex = i2;
|
||||
columnIndex2 = columnIndex2;
|
||||
columnIndex3 = i3;
|
||||
columnIndex4 = columnIndex4;
|
||||
}
|
||||
query.close();
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public String getAlbum() {
|
||||
return this.album;
|
||||
}
|
||||
|
||||
public String getArtist() {
|
||||
return this.artist;
|
||||
}
|
||||
|
||||
public long getDuration() {
|
||||
return this.duration;
|
||||
}
|
||||
|
||||
public void setAlbum(String str) {
|
||||
this.album = str;
|
||||
}
|
||||
|
||||
public void setArtist(String str) {
|
||||
this.artist = str;
|
||||
}
|
||||
|
||||
public void setDuration(long j) {
|
||||
this.duration = j;
|
||||
}
|
||||
|
||||
public HPAudio(int i, String str, String str2, String str3, String str4, long j, String str5, String str6) {
|
||||
super(i, str, str2, str3, str4, j, str5, str6);
|
||||
this.mediaType = 2;
|
||||
}
|
||||
}
|
70
sources/com/bottle/hp/album/media/HPImage.java
Normal file
70
sources/com/bottle/hp/album/media/HPImage.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package com.bottle.hp.album.media;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.provider.MediaStore;
|
||||
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HPImage extends HPMedia implements Serializable {
|
||||
private static final String TAG = HPMedia.class.getSimpleName();
|
||||
private static String[] thumbColumns = {FileDownloadModel.ID, "image_id", "_data"};
|
||||
private static String[] projection = {FileDownloadModel.ID, "title", "_data", "_display_name", "mime_type", "_size", "date_modified"};
|
||||
|
||||
public HPImage() {
|
||||
this.mediaType = 0;
|
||||
}
|
||||
|
||||
public static List<HPMedia> getImages(Context context) {
|
||||
Cursor query;
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (context != null && (query = context.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, null, null, "date_modified DESC")) != null) {
|
||||
int columnIndex = query.getColumnIndex(FileDownloadModel.ID);
|
||||
int columnIndex2 = query.getColumnIndex("title");
|
||||
int columnIndex3 = query.getColumnIndex("_data");
|
||||
int columnIndex4 = query.getColumnIndex("_display_name");
|
||||
int columnIndex5 = query.getColumnIndex("mime_type");
|
||||
int columnIndex6 = query.getColumnIndex("_size");
|
||||
int columnIndex7 = query.getColumnIndex("date_modified");
|
||||
while (query.moveToNext()) {
|
||||
int i = query.getInt(columnIndex);
|
||||
String string = query.getString(columnIndex2);
|
||||
String string2 = query.getString(columnIndex3);
|
||||
arrayList.add(new HPImage(i, string, query.getString(columnIndex4), query.getString(columnIndex5), string2, query.getLong(columnIndex6), string2, query.getString(columnIndex7)));
|
||||
}
|
||||
query.close();
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public static HPMedia searchImageByName(Context context, String str) {
|
||||
Cursor query = context.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, "_data=?", new String[]{str + ""}, null);
|
||||
HPImage hPImage = null;
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
int columnIndex = query.getColumnIndex(FileDownloadModel.ID);
|
||||
int columnIndex2 = query.getColumnIndex("title");
|
||||
int columnIndex3 = query.getColumnIndex("_data");
|
||||
int columnIndex4 = query.getColumnIndex("_display_name");
|
||||
int columnIndex5 = query.getColumnIndex("mime_type");
|
||||
int columnIndex6 = query.getColumnIndex("_size");
|
||||
int columnIndex7 = query.getColumnIndex("date_modified");
|
||||
if (query.moveToNext()) {
|
||||
int i = query.getInt(columnIndex);
|
||||
String string = query.getString(columnIndex2);
|
||||
String string2 = query.getString(columnIndex3);
|
||||
hPImage = new HPImage(i, string, query.getString(columnIndex4), query.getString(columnIndex5), string2, query.getLong(columnIndex6), string2, query.getString(columnIndex7));
|
||||
}
|
||||
query.close();
|
||||
return hPImage;
|
||||
}
|
||||
|
||||
public HPImage(int i, String str, String str2, String str3, String str4, long j, String str5, String str6) {
|
||||
super(i, str, str2, str3, str4, j, str5, str6);
|
||||
this.mediaType = 0;
|
||||
}
|
||||
}
|
127
sources/com/bottle/hp/album/media/HPMedia.java
Normal file
127
sources/com/bottle/hp/album/media/HPMedia.java
Normal file
@@ -0,0 +1,127 @@
|
||||
package com.bottle.hp.album.media;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HPMedia implements Serializable {
|
||||
public static final int MEDIA_TYPE_AUDIO = 2;
|
||||
public static final int MEDIA_TYPE_IMAGE = 0;
|
||||
public static final int MEDIA_TYPE_NONE = -1;
|
||||
public static final int MEDIA_TYPE_VIDEO = 1;
|
||||
protected String displayName;
|
||||
protected int id;
|
||||
protected int mediaType;
|
||||
protected String mimeType;
|
||||
protected String modifyDate;
|
||||
protected String path;
|
||||
protected String preview;
|
||||
protected boolean selected;
|
||||
protected long size;
|
||||
protected String title;
|
||||
|
||||
public HPMedia() {
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return this.displayName;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public int getMediaType() {
|
||||
return this.mediaType;
|
||||
}
|
||||
|
||||
public String getMimeType() {
|
||||
return this.mimeType;
|
||||
}
|
||||
|
||||
public String getModifyDate() {
|
||||
return this.modifyDate;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return this.path;
|
||||
}
|
||||
|
||||
public String getPreview() {
|
||||
return this.preview;
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return this.title;
|
||||
}
|
||||
|
||||
public boolean isSelected() {
|
||||
return this.selected;
|
||||
}
|
||||
|
||||
public boolean isVideo() {
|
||||
return this.mediaType == 1;
|
||||
}
|
||||
|
||||
public void setDisplayName(String str) {
|
||||
this.displayName = str;
|
||||
}
|
||||
|
||||
public void setId(int i) {
|
||||
this.id = i;
|
||||
}
|
||||
|
||||
public void setMediaType(int i) {
|
||||
this.mediaType = i;
|
||||
}
|
||||
|
||||
public void setMimeType(String str) {
|
||||
this.mimeType = str;
|
||||
}
|
||||
|
||||
public void setModifyDate(String str) {
|
||||
this.modifyDate = str;
|
||||
}
|
||||
|
||||
public void setPath(String str) {
|
||||
this.path = str;
|
||||
}
|
||||
|
||||
public void setPreview(String str) {
|
||||
this.preview = str;
|
||||
}
|
||||
|
||||
public void setSelected(boolean z) {
|
||||
this.selected = z;
|
||||
}
|
||||
|
||||
public void setSize(long j) {
|
||||
this.size = j;
|
||||
}
|
||||
|
||||
public void setTitle(String str) {
|
||||
this.title = str;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "HPMedia{id=" + this.id + ", title='" + this.title + "', displayName='" + this.displayName + "', mimeType='" + this.mimeType + "', path='" + this.path + "', size=" + this.size + ", modifyDate='" + this.modifyDate + "', preview='" + this.preview + "', selected=" + this.selected + ", mediaType=" + this.mediaType + '}';
|
||||
}
|
||||
|
||||
public HPMedia(int i) {
|
||||
this.id = i;
|
||||
}
|
||||
|
||||
public HPMedia(int i, String str, String str2, String str3, String str4, long j, String str5, String str6) {
|
||||
this.id = i;
|
||||
this.title = str;
|
||||
this.displayName = str2;
|
||||
this.mimeType = str3;
|
||||
this.path = str4;
|
||||
this.size = j;
|
||||
this.preview = str5;
|
||||
this.modifyDate = str6;
|
||||
}
|
||||
}
|
213
sources/com/bottle/hp/album/media/HPVideo.java
Normal file
213
sources/com/bottle/hp/album/media/HPVideo.java
Normal file
@@ -0,0 +1,213 @@
|
||||
package com.bottle.hp.album.media;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.media.MediaMetadataRetriever;
|
||||
import android.provider.MediaStore;
|
||||
import com.bottle.hp.album.Utils;
|
||||
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HPVideo extends HPMedia implements Serializable {
|
||||
private static String[] projection = {FileDownloadModel.ID, "title", "_data", "_display_name", "mime_type", "_size", "album", "artist", "duration", "date_modified"};
|
||||
private static String[] thumbColumns = {FileDownloadModel.ID, "video_id", "_data"};
|
||||
private String album;
|
||||
private String artist;
|
||||
private long duration;
|
||||
|
||||
public HPVideo() {
|
||||
super(0, "title", "displayName", "mimeType", "", 0L, "", "");
|
||||
this.mediaType = 1;
|
||||
}
|
||||
|
||||
public static long getVideoDuration(String str) {
|
||||
try {
|
||||
MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever();
|
||||
mediaMetadataRetriever.setDataSource(str);
|
||||
return Long.parseLong(mediaMetadataRetriever.extractMetadata(9));
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
public static HPMedia getVideoThumnail(Context context, HPMedia hPMedia) {
|
||||
Cursor query = context.getContentResolver().query(MediaStore.Video.Thumbnails.EXTERNAL_CONTENT_URI, thumbColumns, "video_id=?", new String[]{hPMedia.getId() + ""}, null);
|
||||
if (query == null || !query.moveToFirst()) {
|
||||
Utils.a(context.getContentResolver(), hPMedia.getPath(), 3);
|
||||
} else {
|
||||
hPMedia.setPreview(query.getString(query.getColumnIndex("_data")));
|
||||
}
|
||||
if (query != null) {
|
||||
query.close();
|
||||
}
|
||||
return hPMedia;
|
||||
}
|
||||
|
||||
public static List<HPMedia> getVideos(Context context) {
|
||||
Cursor query;
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (context == null || (query = context.getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, projection, null, null, "date_modified DESC")) == null) {
|
||||
return arrayList;
|
||||
}
|
||||
int columnIndex = query.getColumnIndex(FileDownloadModel.ID);
|
||||
int columnIndex2 = query.getColumnIndex("title");
|
||||
int columnIndex3 = query.getColumnIndex("_data");
|
||||
int columnIndex4 = query.getColumnIndex("_display_name");
|
||||
int columnIndex5 = query.getColumnIndex("mime_type");
|
||||
int columnIndex6 = query.getColumnIndex("_size");
|
||||
int columnIndex7 = query.getColumnIndex("album");
|
||||
int columnIndex8 = query.getColumnIndex("artist");
|
||||
int columnIndex9 = query.getColumnIndex("duration");
|
||||
int columnIndex10 = query.getColumnIndex("date_modified");
|
||||
if (query.moveToFirst()) {
|
||||
while (true) {
|
||||
int i = query.getInt(columnIndex);
|
||||
String string = query.getString(columnIndex2);
|
||||
String string2 = query.getString(columnIndex3);
|
||||
String string3 = query.getString(columnIndex4);
|
||||
String string4 = query.getString(columnIndex5);
|
||||
long j = query.getLong(columnIndex6);
|
||||
String string5 = query.getString(columnIndex7);
|
||||
String string6 = query.getString(columnIndex8);
|
||||
int i2 = columnIndex;
|
||||
int i3 = columnIndex2;
|
||||
long j2 = query.getInt(columnIndex9);
|
||||
int i4 = columnIndex3;
|
||||
int i5 = columnIndex4;
|
||||
HPVideo hPVideo = new HPVideo(i, string, string3, string4, string2, j, "", query.getString(columnIndex10));
|
||||
hPVideo.setAlbum(string5);
|
||||
hPVideo.setArtist(string6);
|
||||
hPVideo.setDuration(j2);
|
||||
arrayList.add(hPVideo);
|
||||
if (!query.moveToNext()) {
|
||||
break;
|
||||
}
|
||||
columnIndex = i2;
|
||||
columnIndex2 = i3;
|
||||
columnIndex3 = i4;
|
||||
columnIndex4 = i5;
|
||||
}
|
||||
}
|
||||
query.close();
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public static HPVideo searchVideoByName(Context context, String str) {
|
||||
Cursor query = context.getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, projection, "_data=?", new String[]{str + ""}, null);
|
||||
HPVideo hPVideo = null;
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
int columnIndex = query.getColumnIndex(FileDownloadModel.ID);
|
||||
int columnIndex2 = query.getColumnIndex("title");
|
||||
int columnIndex3 = query.getColumnIndex("_data");
|
||||
int columnIndex4 = query.getColumnIndex("_display_name");
|
||||
int columnIndex5 = query.getColumnIndex("mime_type");
|
||||
int columnIndex6 = query.getColumnIndex("_size");
|
||||
int columnIndex7 = query.getColumnIndex("album");
|
||||
int columnIndex8 = query.getColumnIndex("artist");
|
||||
int columnIndex9 = query.getColumnIndex("duration");
|
||||
int columnIndex10 = query.getColumnIndex("date_modified");
|
||||
if (query.moveToFirst()) {
|
||||
int i = query.getInt(columnIndex);
|
||||
String string = query.getString(columnIndex2);
|
||||
String string2 = query.getString(columnIndex3);
|
||||
String string3 = query.getString(columnIndex4);
|
||||
String string4 = query.getString(columnIndex5);
|
||||
long j = query.getLong(columnIndex6);
|
||||
String string5 = query.getString(columnIndex7);
|
||||
String string6 = query.getString(columnIndex8);
|
||||
long j2 = query.getInt(columnIndex9);
|
||||
HPVideo hPVideo2 = new HPVideo(i, string, string3, string4, string2, j, "", query.getString(columnIndex10));
|
||||
hPVideo2.setAlbum(string5);
|
||||
hPVideo2.setArtist(string6);
|
||||
hPVideo2.setDuration(j2);
|
||||
hPVideo = hPVideo2;
|
||||
}
|
||||
query.close();
|
||||
return hPVideo;
|
||||
}
|
||||
|
||||
public String getAlbum() {
|
||||
return this.album;
|
||||
}
|
||||
|
||||
public String getArtist() {
|
||||
return this.artist;
|
||||
}
|
||||
|
||||
public long getDuration() {
|
||||
return this.duration;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:13:0x001f, code lost:
|
||||
|
||||
if (r1 == null) goto L15;
|
||||
*/
|
||||
/* JADX WARN: Removed duplicated region for block: B:17:0x0026 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public android.graphics.Bitmap getFirstFrame() {
|
||||
/*
|
||||
r4 = this;
|
||||
r0 = 0
|
||||
android.media.MediaMetadataRetriever r1 = new android.media.MediaMetadataRetriever // Catch: java.lang.Throwable -> L15 java.lang.Exception -> L1a
|
||||
r1.<init>() // Catch: java.lang.Throwable -> L15 java.lang.Exception -> L1a
|
||||
java.lang.String r2 = r4.path // Catch: java.lang.Exception -> L13 java.lang.Throwable -> L23
|
||||
r1.setDataSource(r2) // Catch: java.lang.Exception -> L13 java.lang.Throwable -> L23
|
||||
android.graphics.Bitmap r0 = r1.getFrameAtTime() // Catch: java.lang.Exception -> L13 java.lang.Throwable -> L23
|
||||
Lf:
|
||||
r1.release()
|
||||
goto L22
|
||||
L13:
|
||||
r2 = move-exception
|
||||
goto L1c
|
||||
L15:
|
||||
r1 = move-exception
|
||||
r3 = r1
|
||||
r1 = r0
|
||||
r0 = r3
|
||||
goto L24
|
||||
L1a:
|
||||
r2 = move-exception
|
||||
r1 = r0
|
||||
L1c:
|
||||
r2.printStackTrace() // Catch: java.lang.Throwable -> L23
|
||||
if (r1 == 0) goto L22
|
||||
goto Lf
|
||||
L22:
|
||||
return r0
|
||||
L23:
|
||||
r0 = move-exception
|
||||
L24:
|
||||
if (r1 == 0) goto L29
|
||||
r1.release()
|
||||
L29:
|
||||
throw r0
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.bottle.hp.album.media.HPVideo.getFirstFrame():android.graphics.Bitmap");
|
||||
}
|
||||
|
||||
public void setAlbum(String str) {
|
||||
this.album = str;
|
||||
}
|
||||
|
||||
public void setArtist(String str) {
|
||||
this.artist = str;
|
||||
}
|
||||
|
||||
public void setDuration(long j) {
|
||||
this.duration = j;
|
||||
}
|
||||
|
||||
public HPVideo(int i, String str, String str2, String str3, String str4, long j, String str5, String str6) {
|
||||
super(i, str, str2, str3, str4, j, str5, str6);
|
||||
this.mediaType = 1;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user