Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ dependencies {
// DB
implementation "androidx.room:room-runtime:${room_version}"
annotationProcessor "androidx.room:room-compiler:${room_version}"
implementation 'com.github.evrencoskun:TableView:v0.8.9.4'
implementation 'de.siegmar:fastcsv:2.2.1'

// FM
implementation "com.j256.simplemagic:simplemagic:${simplemagic_version}"
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,10 @@
android:label="@string/files"
android:launchMode="singleTop"
android:taskAffinity="" />
<activity android:name=".sqlite.SqliteDbEditorActivity"
android:exported="true"
android:label="@string/sqlite_db_editor"
android:taskAffinity="" />

<service
android:name=".apk.installer.PackageInstallerService"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: GPL-3.0-or-later

package io.github.muntashirakon.AppManager.sqlite;

public class ColumnHeader extends TableRecordItem {

public ColumnHeader(String id) {
super(id, null);
}

public ColumnHeader(String id, String data) {
super(id, data);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// SPDX-License-Identifier: GPL-3.0-or-later

package io.github.muntashirakon.AppManager.sqlite;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.util.List;

public class QueryResultData {
public final List<List<TableRecordItem>> resultRows;
public final List<TableColumn> resultColumns;
public final long totalRows;
public final int limit;
public final long startOffset;
@Nullable
public final String query;
@Nullable
public final String tableName;

public QueryResultData(@NonNull List<List<TableRecordItem>> resultRows,
@NonNull List<TableColumn> resultColumns,
long totalRows, int limit, long startOffset,
@Nullable String query, @Nullable String tableName) {
this.resultRows = resultRows;
this.resultColumns = resultColumns;
this.totalRows = totalRows;
this.limit = limit;
this.startOffset = startOffset;
this.query = query;
this.tableName = tableName;
}

@Nullable
public Long nextOffset() {
long nextOffset = startOffset + limit;
if (nextOffset < totalRows) {
return nextOffset;
}
// No next offset
return null;
}

@Nullable
public Long previousOffset() {
long previousOffset = startOffset - limit;
if (previousOffset < totalRows) {
if (previousOffset >= 0) {
return previousOffset;
}
// Candidate offset is less than 0.
// If start offset was not 0, start with 0
if (startOffset != 0) {
return 0L;
}
}
// Invalid offset
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: GPL-3.0-or-later

package io.github.muntashirakon.AppManager.sqlite;

public class RecordItemHeader extends TableRecordItem {

public RecordItemHeader(String id) {
super(id, null);
}

public RecordItemHeader(String id, String data) {
super(id, data);
}
}
Loading