Commit caf8f22a authored by Christian Bremvåg's avatar Christian Bremvåg 😎

Fixed 2 imports not reachable + Code enhancements for ChrootFragment

parent 44cc5c7c
......@@ -27,7 +27,7 @@ repositories {
}
dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0-rc02'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'org.thoughtcrime.ssl.pinning:AndroidPinning:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0-rc02'
implementation 'androidx.appcompat:appcompat:1.1.0'
}
......@@ -21,15 +21,15 @@ repositories {
}
dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0-rc02'
implementation 'androidx.appcompat:appcompat:1.0.0-rc02'
implementation 'com.google.android.material:material:1.0.0-rc01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0-alpha10'
implementation project(':androidwversionmanager')
implementation 'org.thoughtcrime.ssl.pinning:AndroidPinning:1.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'joda-time:joda-time:2.10'
implementation 'com.google.guava:guava:24.1-jre'
implementation 'org.jetbrains:annotations:15.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'joda-time:joda-time:2.10.4'
implementation 'com.google.guava:guava:28.1-jre'
implementation 'org.jetbrains:annotations:17.0.0'
}
android {
......
......@@ -10,9 +10,8 @@ import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NavUtils;
// TODO: FIX IMPORTS!
//import com.offsec.nethunter.utils.NhPaths;
//import com.offsec.nethunter.utils.ShellExecuter;
import com.offsec.nethunter.utils.NhPaths;
import com.offsec.nethunter.utils.ShellExecuter;
import java.util.Locale;
import java.util.Objects;
......@@ -22,8 +21,8 @@ import static android.R.id;
public class EditSourceActivity extends AppCompatActivity {
private String configFilePath = "";
private NhPaths nh;
private final ShellExecuter exe = new ShellExecuter();
public NhPaths nh;
public final ShellExecuter exe = new ShellExecuter();
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -74,7 +73,7 @@ public class EditSourceActivity extends AppCompatActivity {
public void updateSource(View view) {
EditText source = findViewById(R.id.source);
String newSource = source.getText().toString();
Boolean isSaved = exe.SaveFileContents(newSource, configFilePath);
boolean isSaved = exe.SaveFileContents(newSource, configFilePath);
if (isSaved) {
nh.showMessage("Source updated");
} else {
......
......@@ -24,9 +24,8 @@ import android.widget.ImageButton;
import android.widget.Spinner;
import android.widget.TextView;
// TODO: SAME ISSUE HERE, MISSING IMPORTS GIVES US TROUBLE (CODE RED)
//import com.offsec.nethunter.utils.NhPaths;
//import com.offsec.nethunter.utils.ShellExecuter;
import com.offsec.nethunter.utils.NhPaths;
import com.offsec.nethunter.utils.ShellExecuter;
import java.util.ArrayList;
import java.util.List;
......
......@@ -17,9 +17,8 @@ import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
//TODO: THESE IMPORTS ARE IMPORTANT
//import com.offsec.nethunter.utils.NhPaths;
//import com.offsec.nethunter.utils.ShellExecuter;
import com.offsec.nethunter.utils.NhPaths;
import com.offsec.nethunter.utils.ShellExecuter;
import java.io.BufferedReader;
//import java.io.IOException;
......
......@@ -55,15 +55,16 @@ class SearchSploitSQL extends SQLiteOpenHelper {
}
Boolean doDbFeed() {
String _cmd = "su -c bootkali\n" + "csv2sqlite.py /usr/share/exploitdb/files_exploits.csv SearchSploit " +
SearchSploit.TABLE + "\n" +
"sqlite3 SearchSploit 'UPDATE " +
SearchSploit.TABLE + " SET " +
SearchSploit.PORT + " = 0 WHERE " +
SearchSploit.PORT + " IS NULL;'\n" +
"mv SearchSploit /sdcard/nh_files/SearchSploit\n";
// Generate the csv to kali /root first as temp (so we can read it)
String _cmd1 = "su -c 'bootkali custom_cmd /usr/bin/python /sdcard/nh_files/modules/csv2sqlite.py /usr/share/exploitdb/files_exploits.csv /root/SearchSploit " + SearchSploit.TABLE + "'";
exe.RunAsRootOutput(_cmd1);
// Then move it to app db folder
String _cmd2 = "mv /data/local/nhsystem/kali-armhf/root/SearchSploit /sdcard/nh_files/";
exe.RunAsRootOutput(_cmd2);
return true;
}
long getCount() {
String sql = "SELECT COUNT(*) FROM " + SearchSploit.TABLE;
SQLiteDatabase db = this.getWritableDatabase();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment