big refactor

This commit is contained in:
arrase 2016-11-24 02:56:11 +01:00
parent 6658101dd9
commit d28db41782
18 changed files with 40 additions and 46 deletions

View File

@ -137,7 +137,7 @@
</receiver> </receiver>
<activity <activity
android:name=".ui.hs.HiddenServicesActivity" android:name=".ui.hiddenservices.HiddenServicesActivity"
android:label="@string/title_activity_hidden_services" android:label="@string/title_activity_hidden_services"
android:theme="@style/DefaultTheme" > android:theme="@style/DefaultTheme" >
<meta-data <meta-data
@ -146,13 +146,13 @@
</activity> </activity>
<provider <provider
android:name=".ui.hs.providers.HSContentProvider" android:name=".ui.hiddenservices.providers.HSContentProvider"
android:exported="false" android:exported="false"
android:authorities="org.torproject.android.ui.hs.providers" /> android:authorities="org.torproject.android.ui.hiddenservices.providers" />
<provider <provider
android:name="org.torproject.android.storage.AppDataProvider" android:name=".ui.hiddenservices.storage.AppDataProvider"
android:authorities="org.torproject.android.storage" android:authorities="org.torproject.android.ui.hiddenservices.storage"
android:exported="false" android:exported="false"
android:grantUriPermissions="true"> android:grantUriPermissions="true">
<meta-data <meta-data

View File

@ -23,13 +23,13 @@ import org.torproject.android.service.TorServiceConstants;
import org.torproject.android.service.util.TorServiceUtils; import org.torproject.android.service.util.TorServiceUtils;
import org.torproject.android.settings.SettingsPreferences; import org.torproject.android.settings.SettingsPreferences;
import org.torproject.android.ui.AppManager; import org.torproject.android.ui.AppManager;
import org.torproject.android.ui.hs.HiddenServicesActivity; import org.torproject.android.ui.hiddenservices.HiddenServicesActivity;
import org.torproject.android.ui.ImageProgressView; import org.torproject.android.ui.ImageProgressView;
import org.torproject.android.ui.PromoAppsActivity; import org.torproject.android.ui.PromoAppsActivity;
import org.torproject.android.ui.Rotate3dAnimation; import org.torproject.android.ui.Rotate3dAnimation;
import org.torproject.android.ui.hs.providers.HSContentProvider; import org.torproject.android.ui.hiddenservices.providers.HSContentProvider;
import org.torproject.android.vpn.VPNEnableActivity; import org.torproject.android.vpn.VPNEnableActivity;
import org.torproject.android.backup.BackupUtils; import org.torproject.android.ui.hiddenservices.backup.BackupUtils;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.ActivityManager; import android.app.ActivityManager;

View File

@ -1,4 +1,4 @@
package org.torproject.android.ui.hs; package org.torproject.android.ui.hiddenservices;
import android.content.ContentResolver; import android.content.ContentResolver;
@ -16,12 +16,12 @@ import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import org.torproject.android.R; import org.torproject.android.R;
import org.torproject.android.storage.PermissionManager; import org.torproject.android.ui.hiddenservices.storage.PermissionManager;
import org.torproject.android.ui.hs.adapters.OnionListAdapter; import org.torproject.android.ui.hiddenservices.adapters.OnionListAdapter;
import org.torproject.android.ui.hs.dialogs.HSActionsDialog; import org.torproject.android.ui.hiddenservices.dialogs.HSActionsDialog;
import org.torproject.android.ui.hs.dialogs.HSDataDialog; import org.torproject.android.ui.hiddenservices.dialogs.HSDataDialog;
import org.torproject.android.ui.hs.dialogs.SelectBackupDialog; import org.torproject.android.ui.hiddenservices.dialogs.SelectBackupDialog;
import org.torproject.android.ui.hs.providers.HSContentProvider; import org.torproject.android.ui.hiddenservices.providers.HSContentProvider;
public class HiddenServicesActivity extends AppCompatActivity { public class HiddenServicesActivity extends AppCompatActivity {
private ContentResolver mCR; private ContentResolver mCR;

View File

@ -1,4 +1,4 @@
package org.torproject.android.ui.hs.adapters; package org.torproject.android.ui.hiddenservices.adapters;
import android.content.Context; import android.content.Context;
import android.view.LayoutInflater; import android.view.LayoutInflater;

View File

@ -1,4 +1,4 @@
package org.torproject.android.ui.hs.adapters; package org.torproject.android.ui.hiddenservices.adapters;
import android.content.Context; import android.content.Context;
import android.database.Cursor; import android.database.Cursor;
@ -9,7 +9,7 @@ import android.view.ViewGroup;
import android.widget.TextView; import android.widget.TextView;
import org.torproject.android.R; import org.torproject.android.R;
import org.torproject.android.ui.hs.providers.HSContentProvider; import org.torproject.android.ui.hiddenservices.providers.HSContentProvider;
public class OnionListAdapter extends CursorAdapter { public class OnionListAdapter extends CursorAdapter {
private LayoutInflater cursorInflater; private LayoutInflater cursorInflater;

View File

@ -1,4 +1,4 @@
package org.torproject.android.backup; package org.torproject.android.ui.hiddenservices.backup;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
@ -6,7 +6,7 @@ import android.widget.Toast;
import org.torproject.android.service.R; import org.torproject.android.service.R;
import org.torproject.android.service.TorServiceConstants; import org.torproject.android.service.TorServiceConstants;
import org.torproject.android.storage.ExternalStorage; import org.torproject.android.ui.hiddenservices.storage.ExternalStorage;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;

View File

@ -1,4 +1,4 @@
package org.torproject.android.backup; package org.torproject.android.ui.hiddenservices.backup;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;

View File

@ -1,4 +1,4 @@
package org.torproject.android.ui.hs.database; package org.torproject.android.ui.hiddenservices.database;
import android.content.Context; import android.content.Context;

View File

@ -1,20 +1,14 @@
package org.torproject.android.ui.hs.dialogs; package org.torproject.android.ui.hiddenservices.dialogs;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Dialog; import android.app.Dialog;
import android.content.ClipData; import android.content.ClipData;
import android.content.ClipboardManager; import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.DialogFragment; import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.view.View; import android.view.View;
@ -22,9 +16,9 @@ import android.widget.Button;
import android.widget.Toast; import android.widget.Toast;
import org.torproject.android.R; import org.torproject.android.R;
import org.torproject.android.backup.BackupUtils; import org.torproject.android.ui.hiddenservices.backup.BackupUtils;
import org.torproject.android.storage.PermissionManager; import org.torproject.android.ui.hiddenservices.storage.PermissionManager;
import org.torproject.android.ui.hs.providers.HSContentProvider; import org.torproject.android.ui.hiddenservices.providers.HSContentProvider;
public class HSActionsDialog extends DialogFragment { public class HSActionsDialog extends DialogFragment {
public final int PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 1; public final int PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 1;

View File

@ -1,4 +1,4 @@
package org.torproject.android.ui.hs.dialogs; package org.torproject.android.ui.hiddenservices.dialogs;
import android.app.Dialog; import android.app.Dialog;
@ -14,7 +14,7 @@ import android.widget.EditText;
import android.widget.Toast; import android.widget.Toast;
import org.torproject.android.R; import org.torproject.android.R;
import org.torproject.android.ui.hs.providers.HSContentProvider; import org.torproject.android.ui.hiddenservices.providers.HSContentProvider;
public class HSDataDialog extends DialogFragment { public class HSDataDialog extends DialogFragment {

View File

@ -1,4 +1,4 @@
package org.torproject.android.ui.hs.dialogs; package org.torproject.android.ui.hiddenservices.dialogs;
import android.app.Dialog; import android.app.Dialog;
import android.content.DialogInterface; import android.content.DialogInterface;
@ -11,8 +11,8 @@ import android.widget.AdapterView;
import android.widget.ListView; import android.widget.ListView;
import org.torproject.android.R; import org.torproject.android.R;
import org.torproject.android.storage.ExternalStorage; import org.torproject.android.ui.hiddenservices.storage.ExternalStorage;
import org.torproject.android.ui.hs.adapters.BackupAdapter; import org.torproject.android.ui.hiddenservices.adapters.BackupAdapter;
import java.io.File; import java.io.File;
import java.io.FilenameFilter; import java.io.FilenameFilter;

View File

@ -1,4 +1,4 @@
package org.torproject.android.ui.hs.providers; package org.torproject.android.ui.hiddenservices.providers;
import android.content.ContentProvider; import android.content.ContentProvider;
import android.content.ContentUris; import android.content.ContentUris;
@ -12,11 +12,11 @@ import android.provider.BaseColumns;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import org.torproject.android.ui.hs.database.HSDatabase; import org.torproject.android.ui.hiddenservices.database.HSDatabase;
public class HSContentProvider extends ContentProvider { public class HSContentProvider extends ContentProvider {
private static final String AUTH = "org.torproject.android.ui.hs.providers"; private static final String AUTH = "org.torproject.android.ui.hiddenservices.providers";
public static final Uri CONTENT_URI = public static final Uri CONTENT_URI =
Uri.parse("content://" + AUTH + "/hs"); Uri.parse("content://" + AUTH + "/hs");
//UriMatcher //UriMatcher

View File

@ -1,4 +1,4 @@
package org.torproject.android.storage; package org.torproject.android.ui.hiddenservices.storage;
import android.app.Application; import android.app.Application;

View File

@ -1,4 +1,4 @@
package org.torproject.android.storage; package org.torproject.android.ui.hiddenservices.storage;
import android.os.Environment; import android.os.Environment;

View File

@ -1,4 +1,4 @@
package org.torproject.android.storage; package org.torproject.android.ui.hiddenservices.storage;
import android.Manifest; import android.Manifest;

View File

@ -5,7 +5,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
tools:context="org.torproject.android.ui.hs.HiddenServicesActivity"> tools:context="org.torproject.android.ui.hiddenservices.HiddenServicesActivity">
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -10,7 +10,7 @@
android:paddingRight="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior" app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="org.torproject.android.ui.hs.HiddenServicesActivity" tools:context="org.torproject.android.ui.hiddenservices.HiddenServicesActivity"
tools:showIn="@layout/layout_hs_list_view"> tools:showIn="@layout/layout_hs_list_view">
<ListView <ListView

View File

@ -132,7 +132,7 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
private Shell mShellPolipo; private Shell mShellPolipo;
private static final Uri CONTENT_URI = Uri.parse("content://org.torproject.android.ui.hs.providers/hs"); private static final Uri CONTENT_URI = Uri.parse("content://org.torproject.android.ui.hiddenservices.providers/hs");
public static final class HiddenService implements BaseColumns { public static final class HiddenService implements BaseColumns {
public static final String NAME = "name"; public static final String NAME = "name";