This is Galaxy now..

This commit is contained in:
Mr. Dragon
2018-02-02 10:01:40 +05:30
parent 547bf47e8b
commit 101d2d2dcc
41 changed files with 101 additions and 103 deletions

View File

@@ -16,7 +16,7 @@
<application
android:allowBackup="false"
android:name=".YalpStoreApplication"
android:name=".GalaxyApplication"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:banner="@mipmap/ic_launcher"
@@ -42,8 +42,8 @@
</receiver>
<provider
android:exported="false"
android:name=".YalpSuggestionProvider"
android:authorities="in.dragons.galaxy.YalpSuggestionProvider"
android:name=".GalaxySuggestionProvider"
android:authorities="in.dragons.galaxy.GalaxySuggestionProvider"
android:enabled="true" />
<activity android:name=".DetailsActivity" android:configChanges="keyboardHidden|orientation|screenSize">
<meta-data android:name="android.app.default_searchable" android:value=".SearchActivity" />
@@ -111,7 +111,6 @@
<activity android:name=".AboutActivity" android:launchMode="singleInstance" android:configChanges="keyboardHidden|orientation|screenSize" android:label="@string/action_about" >
<meta-data android:name="android.app.default_searchable" android:value=".SearchActivity" />
</activity>
<activity android:name=".BugReportActivity" android:launchMode="singleInstance" android:noHistory="true" android:process=":report_process" />
<activity android:name=".DeviceInfoActivity" android:launchMode="singleInstance" android:configChanges="keyboardHidden|orientation|screenSize" />
<activity android:name=".InstalledAppsActivity" android:launchMode="singleInstance" android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
@@ -124,7 +123,6 @@
<service android:enabled="true" android:name=".notification.CancelDownloadService" />
<service android:enabled="true" android:name=".notification.IgnoreUpdatesService" />
<service android:enabled="true" android:name=".bugreport.BugReportService" />
</application>
</manifest>

View File

@@ -17,7 +17,7 @@ import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
public class AboutActivity extends YalpStoreActivity implements NavigationView.OnNavigationItemSelectedListener{
public class AboutActivity extends GalaxyActivity implements NavigationView.OnNavigationItemSelectedListener{
@Override
protected void onCreate(Bundle savedInstanceState) {

View File

@@ -28,7 +28,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
abstract public class AppListActivity extends YalpStoreActivity implements NavigationView.OnNavigationItemSelectedListener{
abstract public class AppListActivity extends GalaxyActivity implements NavigationView.OnNavigationItemSelectedListener{
protected ListView listView;
protected Map<String, ListItem> listItems = new HashMap<>();
@@ -108,7 +108,7 @@ abstract public class AppListActivity extends YalpStoreActivity implements Navig
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
if (YalpStorePermissionManager.isGranted(requestCode, permissions, grantResults)) {
if (GalaxyPermissionManager.isGranted(requestCode, permissions, grantResults)) {
Log.i(getClass().getSimpleName(), "User granted the write permission");
new ButtonDownload(this, DetailsActivity.app).download();
}

View File

@@ -14,7 +14,7 @@ import in.dragons.galaxy.task.playstore.CategoryListTask;
import in.dragons.galaxy.task.playstore.CategoryTask;
public class CategoryListActivity extends YalpStoreActivity implements NavigationView.OnNavigationItemSelectedListener{
public class CategoryListActivity extends GalaxyActivity implements NavigationView.OnNavigationItemSelectedListener{
@Override
protected void onCreate(Bundle savedInstanceState) {

View File

@@ -13,7 +13,7 @@ import java.util.Map;
public class DebugHttpClientAdapter extends NativeHttpClientAdapter {
static private final String DEBUG_DIRECTORY = "yalp-store-debug";
static private final String DEBUG_DIRECTORY = "galaxy-store-debug";
static private File dumpDirectory;
public DebugHttpClientAdapter() {

View File

@@ -28,7 +28,7 @@ import in.dragons.galaxy.model.App;
import in.dragons.galaxy.task.playstore.CloneableTask;
import in.dragons.galaxy.task.playstore.DetailsTask;
public class DetailsActivity extends YalpStoreActivity implements NavigationView.OnNavigationItemSelectedListener{
public class DetailsActivity extends GalaxyActivity implements NavigationView.OnNavigationItemSelectedListener{
static private final String INTENT_PACKAGE_NAME = "INTENT_PACKAGE_NAME";
@@ -98,7 +98,7 @@ public class DetailsActivity extends YalpStoreActivity implements NavigationView
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
if (YalpStorePermissionManager.isGranted(requestCode, permissions, grantResults)) {
if (GalaxyPermissionManager.isGranted(requestCode, permissions, grantResults)) {
Log.i(getClass().getSimpleName(), "User granted the write permission");
if (null == downloadOrInstallFragment && null != app) {
downloadOrInstallFragment = new DownloadOrInstall(this, app);

View File

@@ -13,7 +13,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Properties;
public class DeviceInfoActivity extends YalpStoreActivity {
public class DeviceInfoActivity extends GalaxyActivity {
public static final String INTENT_DEVICE_NAME = "INTENT_DEVICE_NAME";

View File

@@ -10,7 +10,7 @@ import in.dragons.galaxy.model.App;
import in.dragons.galaxy.task.playstore.DetailsTask;
import in.dragons.galaxy.task.playstore.PurchaseTask;
public class DirectDownloadActivity extends YalpStoreActivity {
public class DirectDownloadActivity extends GalaxyActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -20,7 +20,7 @@ public class DirectDownloadActivity extends YalpStoreActivity {
finish();
return;
}
if (!new YalpStorePermissionManager(this).checkPermission()) {
if (!new GalaxyPermissionManager(this).checkPermission()) {
startActivity(DetailsActivity.getDetailsIntent(this, packageName));
finish();
return;

View File

@@ -45,7 +45,7 @@ public class Downloader {
if (deliveryData.getAdditionalFileCount() > 1) {
bytesNeeded += deliveryData.getAdditionalFile(1).getSize();
}
StatFs stat = new StatFs(Paths.getYalpPath(context).getPath());
StatFs stat = new StatFs(Paths.getDownloadPath(context).getPath());
return (long) stat.getBlockSize() * (long) stat.getAvailableBlocks() >= bytesNeeded;
}

View File

@@ -24,10 +24,10 @@ public class FlagDialogBuilder {
};
static private final String[] reasonLabels = new String[8];
private YalpStoreActivity activity;
private GalaxyActivity activity;
private App app;
public FlagDialogBuilder setActivity(YalpStoreActivity activity) {
public FlagDialogBuilder setActivity(GalaxyActivity activity) {
this.activity = activity;
reasonLabels[0] = activity.getString(R.string.flag_sexual_content);
reasonLabels[1] = activity.getString(R.string.flag_graphic_violence);

View File

@@ -24,19 +24,19 @@ import in.dragons.galaxy.fragment.FilterMenu;
import static in.dragons.galaxy.PlayStoreApiAuthenticator.PREFERENCE_EMAIL;
public abstract class YalpStoreActivity extends AppCompatActivity {
public abstract class GalaxyActivity extends AppCompatActivity {
static protected boolean logout = false;
public static void cascadeFinish() {
YalpStoreActivity.logout = true;
GalaxyActivity.logout = true;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.v(getClass().getSimpleName(), "Starting activity");
logout = false;
if (((YalpStoreApplication) getApplication()).isTv()) {
if (((GalaxyApplication) getApplication()).isTv()) {
requestWindowFeature(Window.FEATURE_OPTIONS_PANEL);
}
ThemeManager.setTheme(this);
@@ -119,7 +119,7 @@ public abstract class YalpStoreActivity extends AppCompatActivity {
@Override
public boolean onQueryTextSubmit(String query) {
Intent i = new Intent(YalpStoreActivity.this, SearchActivity.class);
Intent i = new Intent(GalaxyActivity.this, SearchActivity.class);
i.setAction(Intent.ACTION_SEARCH);
i.putExtra(SearchManager.QUERY, query);
startActivity(i);

View File

@@ -17,7 +17,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class YalpStoreApplication extends Application {
public class GalaxyApplication extends Application {
private boolean isBackgroundUpdating = false;
private List<String> pendingUpdates = new ArrayList<>();

View File

@@ -8,13 +8,13 @@ import android.util.Log;
import java.lang.ref.WeakReference;
public class YalpStorePermissionManager {
public class GalaxyPermissionManager {
private static final int PERMISSIONS_REQUEST_CODE = 384;
private WeakReference<Activity> activityRef = new WeakReference<>(null);
public YalpStorePermissionManager(Activity activity) {
public GalaxyPermissionManager(Activity activity) {
this.activityRef = new WeakReference<>(activity);
}

View File

@@ -17,7 +17,7 @@ import com.github.yeriomin.playstoreapi.SearchSuggestEntry;
import java.io.File;
import java.io.IOException;
public class YalpSuggestionProvider extends ContentProvider {
public class GalaxySuggestionProvider extends ContentProvider {
@Override
public boolean onCreate() {

View File

@@ -65,7 +65,7 @@ public class GlobalDownloadReceiver extends DownloadReceiver {
} else {
Log.i(getClass().getSimpleName(), "Notifying about download completion of " + app.getPackageName());
notifyDownloadComplete(app);
((YalpStoreApplication) context.getApplicationContext()).removePendingUpdate(app.getPackageName());
((GalaxyApplication) context.getApplicationContext()).removePendingUpdate(app.getPackageName());
}
}

View File

@@ -38,7 +38,7 @@ public class GlobalInstallReceiver extends BroadcastReceiver {
if (null != DetailsActivity.app && packageName.equals(DetailsActivity.app.getPackageName())) {
updateDetails(actionIsInstall(intent));
}
((YalpStoreApplication) context.getApplicationContext()).removePendingUpdate(packageName, actionIsInstall(intent));
((GalaxyApplication) context.getApplicationContext()).removePendingUpdate(packageName, actionIsInstall(intent));
if (needToRemoveApk(context) && actionIsInstall(intent)) {
App app = getApp(context, packageName);
File apkPath = Paths.getApkPath(context, app.getPackageName(), app.getVersionCode());

View File

@@ -65,7 +65,7 @@ public abstract class InstallerAbstract {
}
if (!new ApkSignatureVerifier(context).match(app.getPackageName(), apkPath)) {
Log.i(getClass().getSimpleName(), "Signature mismatch for " + app.getPackageName());
((YalpStoreApplication) context.getApplicationContext()).removePendingUpdate(app.getPackageName());
((GalaxyApplication) context.getApplicationContext()).removePendingUpdate(app.getPackageName());
if (ContextUtil.isAlive(context)) {
getSignatureMismatchDialog(app).show();
} else {

View File

@@ -21,7 +21,7 @@ abstract public class InstallerBackground extends InstallerAbstract {
}
if (background && !new PermissionsComparator(context).isSame(app)) {
Log.i(getClass().getSimpleName(), "New permissions for " + app.getPackageName());
((YalpStoreApplication) context.getApplicationContext()).removePendingUpdate(app.getPackageName());
((GalaxyApplication) context.getApplicationContext()).removePendingUpdate(app.getPackageName());
notifyNewPermissions(app);
return false;
}

View File

@@ -75,7 +75,7 @@ public class InstallerPrivileged extends InstallerBackground {
}
if (context.getPackageManager().checkPermission(Manifest.permission.INSTALL_PACKAGES, BuildConfig.APPLICATION_ID) != PackageManager.PERMISSION_GRANTED) {
Log.i(getClass().getSimpleName(), Manifest.permission.INSTALL_PACKAGES + " not granted");
((YalpStoreApplication) context.getApplicationContext()).removePendingUpdate(app.getPackageName());
((GalaxyApplication) context.getApplicationContext()).removePendingUpdate(app.getPackageName());
notifyAndToast(R.string.notification_not_privileged, R.string.pref_not_privileged, app);
return false;
}
@@ -88,7 +88,7 @@ public class InstallerPrivileged extends InstallerBackground {
File apkFile = Paths.getApkPath(context, app.getPackageName(), app.getVersionCode());
if (!apkFile.exists()) {
Log.e(getClass().getSimpleName(), "Installation requested for apk " + apkFile.getAbsolutePath() + " which does not exist");
((YalpStoreApplication) context.getApplicationContext()).removePendingUpdate(app.getPackageName());
((GalaxyApplication) context.getApplicationContext()).removePendingUpdate(app.getPackageName());
sendBroadcast(app.getPackageName(), false);
return;
}
@@ -98,7 +98,7 @@ public class InstallerPrivileged extends InstallerBackground {
pm.getClass().getMethod("installPackage", types).invoke(pm, Uri.fromFile(apkFile), new InstallObserver(app), INSTALL_REPLACE_EXISTING, BuildConfig.APPLICATION_ID);
} catch (NoSuchMethodException | IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {
Log.e(getClass().getSimpleName(), "Could not start privileged installation: " + e.getClass().getName() + " " + e.getMessage());
((YalpStoreApplication) context.getApplicationContext()).removePendingUpdate(app.getPackageName());
((GalaxyApplication) context.getApplicationContext()).removePendingUpdate(app.getPackageName());
sendBroadcast(app.getPackageName(), false);
}
}

View File

@@ -33,7 +33,7 @@ public class Paths {
return storageRoot;
}
static public File getYalpPath(Context context) {
static public File getDownloadPath(Context context) {
return new File(
getStorageRoot(context),
PreferenceManager.getDefaultSharedPreferences(context).getString(PreferenceActivity.PREFERENCE_DOWNLOAD_DIRECTORY, "")
@@ -42,7 +42,7 @@ public class Paths {
static public File getApkPath(Context context, String packageName, int version) {
String filename = packageName + "." + String.valueOf(version) + ".apk";
return new File(getYalpPath(context), filename);
return new File(getDownloadPath(context), filename);
}
static public File getDeltaPath(Context context, String packageName, int version) {

View File

@@ -85,7 +85,7 @@ public class PreferenceActivity extends android.preference.PreferenceActivity {
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
if (!YalpStorePermissionManager.isGranted(requestCode, permissions, grantResults)) {
if (!GalaxyPermissionManager.isGranted(requestCode, permissions, grantResults)) {
Log.i(getClass().getSimpleName(), "User denied the write permission");
finish();
}

View File

@@ -41,12 +41,12 @@ public class SpoofDeviceManager {
devices = getDevicesFromApk();
putDevicesToSharedPreferences(devices);
}
devices.putAll(getDevicesFromYalpDirectory());
devices.putAll(getDevicesFromDownloadDirectory());
return devices;
}
public Properties getProperties(String entryName) {
File defaultDirectoryFile = new File(Paths.getYalpPath(context), entryName);
File defaultDirectoryFile = new File(Paths.getDownloadPath(context), entryName);
if (defaultDirectoryFile.exists()) {
Log.i(getClass().getSimpleName(), "Loading device info from " + defaultDirectoryFile.getAbsolutePath());
return getProperties(defaultDirectoryFile);
@@ -125,7 +125,7 @@ public class SpoofDeviceManager {
return new JarFile(apk);
}
} catch (IOException e) {
Log.e(getClass().getSimpleName(), "Could not open Yalp Store apk as a jar file: " + e.getMessage());
Log.e(getClass().getSimpleName(), "Could not open Galaxy Store apk as a jar file: " + e.getMessage());
}
return null;
}
@@ -142,9 +142,9 @@ public class SpoofDeviceManager {
return null;
}
private Map<String, String> getDevicesFromYalpDirectory() {
private Map<String, String> getDevicesFromDownloadDirectory() {
Map<String, String> deviceNames = new HashMap<>();
File defaultDir = Paths.getYalpPath(context);
File defaultDir = Paths.getDownloadPath(context);
if (!defaultDir.exists() || null == defaultDir.listFiles()) {
return deviceNames;
}

View File

@@ -51,6 +51,6 @@ public class ThemeManager {
}
static private boolean isAmazonTv(Activity activity) {
return ((YalpStoreApplication) activity.getApplication()).isTv() && Build.MANUFACTURER.toLowerCase().contains("amazon");
return ((GalaxyApplication) activity.getApplication()).isTv() && Build.MANUFACTURER.toLowerCase().contains("amazon");
}
}

View File

@@ -57,7 +57,7 @@ public class UpdatableAppsActivity extends AppListActivity {
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
if (YalpStorePermissionManager.isGranted(requestCode, permissions, grantResults)) {
if (GalaxyPermissionManager.isGranted(requestCode, permissions, grantResults)) {
Log.i(getClass().getSimpleName(), "User granted the write permission");
launchUpdateAll();
}
@@ -104,7 +104,7 @@ public class UpdatableAppsActivity extends AppListActivity {
}
public void launchUpdateAll() {
((YalpStoreApplication) getApplicationContext()).setBackgroundUpdating(true);
((GalaxyApplication) getApplicationContext()).setBackgroundUpdating(true);
new UpdateChecker().onReceive(UpdatableAppsActivity.this, getIntent());
Button button = (Button) findViewById(R.id.main_button);
button.setEnabled(false);

View File

@@ -26,7 +26,7 @@ public class UpdateAllReceiver extends BroadcastReceiver {
filter.addAction(ACTION_ALL_UPDATES_COMPLETE);
filter.addAction(ACTION_APP_UPDATE_COMPLETE);
activity.registerReceiver(this, filter);
if (!((YalpStoreApplication) activity.getApplication()).isBackgroundUpdating()) {
if (!((GalaxyApplication) activity.getApplication()).isBackgroundUpdating()) {
enableButton();
}
}
@@ -37,7 +37,7 @@ public class UpdateAllReceiver extends BroadcastReceiver {
return;
}
if (intent.getAction().equals(ACTION_ALL_UPDATES_COMPLETE)) {
((YalpStoreApplication) activity.getApplication()).setBackgroundUpdating(false);
((GalaxyApplication) activity.getApplication()).setBackgroundUpdating(false);
enableButton();
} else if (intent.getAction().equals(ACTION_APP_UPDATE_COMPLETE)) {
processAppUpdate(

View File

@@ -13,7 +13,7 @@ import android.widget.ArrayAdapter;
import in.dragons.galaxy.CategoryManager;
import in.dragons.galaxy.R;
import in.dragons.galaxy.Util;
import in.dragons.galaxy.YalpStoreActivity;
import in.dragons.galaxy.GalaxyActivity;
import in.dragons.galaxy.model.Filter;
import java.util.HashMap;
@@ -33,9 +33,9 @@ public class FilterMenu {
static private final Map<Float, String> ratingLabels = new HashMap<>();
static private final Map<Integer, String> downloadsLabels = new HashMap<>();
private YalpStoreActivity activity;
private GalaxyActivity activity;
public FilterMenu(YalpStoreActivity activity) {
public FilterMenu(GalaxyActivity activity) {
this.activity = activity;
String[] ratingValues = activity.getResources().getStringArray(R.array.filterRatingValues);
for (int i = 0; i < ratingValues.length; i++) {

View File

@@ -5,17 +5,17 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import in.dragons.galaxy.R;
import in.dragons.galaxy.YalpStoreActivity;
import in.dragons.galaxy.GalaxyActivity;
import in.dragons.galaxy.model.App;
public abstract class Abstract {
protected YalpStoreActivity activity;
protected GalaxyActivity activity;
protected App app;
abstract public void draw();
public Abstract(YalpStoreActivity activity, App app) {
public Abstract(GalaxyActivity activity, App app) {
this.activity = activity;
this.app = app;
}

View File

@@ -3,14 +3,14 @@ package in.dragons.galaxy.fragment.details;
import android.content.pm.PackageManager;
import android.view.View;
import in.dragons.galaxy.YalpStoreActivity;
import in.dragons.galaxy.GalaxyActivity;
import in.dragons.galaxy.model.App;
public abstract class Button extends Abstract {
protected View button;
public Button(YalpStoreActivity activity, App app) {
public Button(GalaxyActivity activity, App app) {
super(activity, app);
this.button = getButton();
}

View File

@@ -16,8 +16,8 @@ import in.dragons.galaxy.Downloader;
import in.dragons.galaxy.ManualDownloadActivity;
import in.dragons.galaxy.Paths;
import in.dragons.galaxy.R;
import in.dragons.galaxy.YalpStoreActivity;
import in.dragons.galaxy.YalpStorePermissionManager;
import in.dragons.galaxy.GalaxyActivity;
import in.dragons.galaxy.GalaxyPermissionManager;
import in.dragons.galaxy.model.App;
import in.dragons.galaxy.selfupdate.UpdaterFactory;
import in.dragons.galaxy.task.playstore.PurchaseTask;
@@ -29,7 +29,7 @@ import static in.dragons.galaxy.DownloadState.TriggeredBy.MANUAL_DOWNLOAD_BUTTON
public class ButtonDownload extends Button {
public ButtonDownload(YalpStoreActivity activity, App app) {
public ButtonDownload(GalaxyActivity activity, App app) {
super(activity, app);
}
@@ -64,7 +64,7 @@ public class ButtonDownload extends Button {
public void checkAndDownload() {
button.setVisibility(View.GONE);
View buttonCancel = activity.findViewById(R.id.cancel);
YalpStorePermissionManager permissionManager = new YalpStorePermissionManager(activity);
GalaxyPermissionManager permissionManager = new GalaxyPermissionManager(activity);
if (app.getVersionCode() == 0 && !(activity instanceof ManualDownloadActivity)) {
activity.startActivity(new Intent(activity, ManualDownloadActivity.class));
} else if (permissionManager.checkPermission()) {
@@ -102,12 +102,12 @@ public class ButtonDownload extends Button {
AndroidAppDeliveryData.newBuilder().setDownloadUrl(UpdaterFactory.get(activity).getUrlString(app.getVersionCode())).build()
);
} else {
boolean writePermission = new YalpStorePermissionManager(activity).checkPermission();
boolean writePermission = new GalaxyPermissionManager(activity).checkPermission();
Log.i(getClass().getSimpleName(), "Write permission granted - " + writePermission);
if (writePermission && prepareDownloadsDir()) {
getPurchaseTask().execute();
} else {
File dir = Paths.getYalpPath(activity);
File dir = Paths.getDownloadPath(activity);
Log.i(getClass().getSimpleName(), dir.getAbsolutePath() + " exists=" + dir.exists() + ", isDirectory=" + dir.isDirectory() + ", writable=" + dir.canWrite());
ContextUtil.toast(this.activity.getApplicationContext(), R.string.error_downloads_directory_not_writable);
}
@@ -115,7 +115,7 @@ public class ButtonDownload extends Button {
}
private boolean prepareDownloadsDir() {
File dir = Paths.getYalpPath(activity);
File dir = Paths.getDownloadPath(activity);
if (!dir.exists()) {
dir.mkdirs();
}

View File

@@ -9,7 +9,7 @@ import android.view.View;
import in.dragons.galaxy.DetailsActivity;
import in.dragons.galaxy.R;
import in.dragons.galaxy.YalpStoreApplication;
import in.dragons.galaxy.GalaxyApplication;
import in.dragons.galaxy.model.App;
public class ButtonRun extends Button {
@@ -46,7 +46,7 @@ public class ButtonRun extends Button {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private Intent getLaunchIntent() {
Intent i = activity.getPackageManager().getLaunchIntentForPackage(app.getPackageName());
boolean isTv = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && ((YalpStoreApplication) activity.getApplication()).isTv();
boolean isTv = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && ((GalaxyApplication) activity.getApplication()).isTv();
if (isTv) {
Intent l = activity.getPackageManager().getLeanbackLaunchIntentForPackage(app.getPackageName());
if (null != l) {

View File

@@ -5,14 +5,14 @@ import android.net.Uri;
import android.view.View;
import in.dragons.galaxy.R;
import in.dragons.galaxy.YalpStoreActivity;
import in.dragons.galaxy.GalaxyActivity;
import in.dragons.galaxy.model.App;
import in.dragons.galaxy.task.CheckShellTask;
import in.dragons.galaxy.task.UninstallSystemAppTask;
public class ButtonUninstall extends Button {
public ButtonUninstall(YalpStoreActivity activity, App app) {
public ButtonUninstall(GalaxyActivity activity, App app) {
super(activity, app);
}

View File

@@ -17,7 +17,7 @@ import in.dragons.galaxy.FlagDialogBuilder;
import in.dragons.galaxy.InstalledApkCopier;
import in.dragons.galaxy.ManualDownloadActivity;
import in.dragons.galaxy.R;
import in.dragons.galaxy.YalpStoreActivity;
import in.dragons.galaxy.GalaxyActivity;
import in.dragons.galaxy.model.App;
import in.dragons.galaxy.task.CheckShellTask;
import in.dragons.galaxy.task.ConvertToNormalTask;
@@ -26,7 +26,7 @@ import in.dragons.galaxy.task.SystemRemountTask;
public class DownloadOptions extends Abstract {
public DownloadOptions(YalpStoreActivity activity, App app) {
public DownloadOptions(GalaxyActivity activity, App app) {
super(activity, app);
}

View File

@@ -19,7 +19,7 @@ import in.dragons.galaxy.PreferenceActivity;
import in.dragons.galaxy.R;
import in.dragons.galaxy.SpoofDeviceManager;
import in.dragons.galaxy.Util;
import in.dragons.galaxy.YalpStoreActivity;
import in.dragons.galaxy.GalaxyActivity;
import java.util.LinkedHashMap;
import java.util.Locale;
@@ -129,7 +129,7 @@ public class Device extends List {
private void finishAll() {
new PlayStoreApiAuthenticator(activity.getApplicationContext()).logout();
YalpStoreActivity.cascadeFinish();
GalaxyActivity.cascadeFinish();
activity.finish();
}

View File

@@ -12,7 +12,7 @@ import in.dragons.galaxy.ContextUtil;
import in.dragons.galaxy.Paths;
import in.dragons.galaxy.PreferenceActivity;
import in.dragons.galaxy.R;
import in.dragons.galaxy.YalpStorePermissionManager;
import in.dragons.galaxy.GalaxyPermissionManager;
import java.io.File;
import java.io.IOException;
@@ -28,11 +28,11 @@ public class DownloadDirectory extends Abstract {
@Override
public void draw() {
preference.setSummary(Paths.getYalpPath(activity).getAbsolutePath());
preference.setSummary(Paths.getDownloadPath(activity).getAbsolutePath());
preference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
YalpStorePermissionManager permissionManager = new YalpStorePermissionManager(activity);
GalaxyPermissionManager permissionManager = new GalaxyPermissionManager(activity);
if (!permissionManager.checkPermission()) {
permissionManager.requestPermission();
}

View File

@@ -88,11 +88,11 @@ class OnInstallationMethodChangeListener implements Preference.OnPreferenceChang
}
private App getSelf() {
PackageInfo yalp = new PackageInfo();
yalp.applicationInfo = activity.getApplicationInfo();
yalp.packageName = BuildConfig.APPLICATION_ID;
yalp.versionCode = BuildConfig.VERSION_CODE;
return new App(yalp);
PackageInfo Galaxy = new PackageInfo();
Galaxy.applicationInfo = activity.getApplicationInfo();
Galaxy.packageName = BuildConfig.APPLICATION_ID;
Galaxy.versionCode = BuildConfig.VERSION_CODE;
return new App(Galaxy);
}
}
}

View File

@@ -8,7 +8,7 @@ import android.util.Log;
import in.dragons.galaxy.DownloadManagerFactory;
import in.dragons.galaxy.DownloadManagerInterface;
import in.dragons.galaxy.DownloadState;
import in.dragons.galaxy.YalpStoreApplication;
import in.dragons.galaxy.GalaxyApplication;
import java.util.ArrayList;
import java.util.List;
@@ -37,7 +37,7 @@ public class CancelDownloadService extends IntentService {
downloadIds.add(downloadId);
}
if (!TextUtils.isEmpty(packageName)) {
((YalpStoreApplication) getApplicationContext()).removePendingUpdate(packageName);
((GalaxyApplication) getApplicationContext()).removePendingUpdate(packageName);
downloadIds.addAll(DownloadState.get(packageName).getDownloadIds());
}
for (long id: downloadIds) {

View File

@@ -2,14 +2,14 @@ package in.dragons.galaxy.task.playstore;
import android.os.Build;
import in.dragons.galaxy.YalpStoreActivity;
import in.dragons.galaxy.GalaxyActivity;
class BackgroundCategoryTask extends CategoryTask {
@Override
protected void fill() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && context instanceof YalpStoreActivity) {
((YalpStoreActivity) context).invalidateOptionsMenu();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && context instanceof GalaxyActivity) {
((GalaxyActivity) context).invalidateOptionsMenu();
}
}
}

View File

@@ -19,7 +19,7 @@ import in.dragons.galaxy.PreferenceActivity;
import in.dragons.galaxy.R;
import in.dragons.galaxy.UpdatableAppsActivity;
import in.dragons.galaxy.UpdateAllReceiver;
import in.dragons.galaxy.YalpStoreApplication;
import in.dragons.galaxy.GalaxyApplication;
import in.dragons.galaxy.model.App;
import in.dragons.galaxy.notification.NotificationManagerWrapper;
@@ -81,7 +81,7 @@ public class BackgroundUpdatableAppsTask extends UpdatableAppsTask implements Cl
private void process(Context context, List<App> apps) {
boolean canInstallInBackground = PreferenceActivity.canInstallInBackground(context);
YalpStoreApplication application = (YalpStoreApplication) context.getApplicationContext();
GalaxyApplication application = (GalaxyApplication) context.getApplicationContext();
application.clearPendingUpdates();
for (App app: apps) {
application.addPendingUpdate(app.getPackageName());

View File

@@ -9,8 +9,8 @@ import in.dragons.galaxy.BlackWhiteListManager;
import in.dragons.galaxy.BuildConfig;
import in.dragons.galaxy.R;
import in.dragons.galaxy.UpdatableAppsActivity;
import in.dragons.galaxy.YalpStoreApplication;
import in.dragons.galaxy.YalpStorePermissionManager;
import in.dragons.galaxy.GalaxyApplication;
import in.dragons.galaxy.GalaxyPermissionManager;
import in.dragons.galaxy.model.App;
import in.dragons.galaxy.selfupdate.UpdaterFactory;
import in.dragons.galaxy.task.InstalledAppsTask;
@@ -43,13 +43,13 @@ public class ForegroundUpdatableAppsTask extends UpdatableAppsTask implements Cl
}
int latestVersionCode = UpdaterFactory.get(context).getLatestVersionCode();
if (latestVersionCode > BuildConfig.VERSION_CODE) {
App yalp = InstalledAppsTask.getInstalledApp(context.getPackageManager(), BuildConfig.APPLICATION_ID);
if (null == yalp) {
App Galaxy = InstalledAppsTask.getInstalledApp(context.getPackageManager(), BuildConfig.APPLICATION_ID);
if (null == Galaxy ) {
return updatableApps;
}
yalp.setVersionCode(latestVersionCode);
yalp.setVersionName("0." + latestVersionCode);
updatableApps.add(yalp);
Galaxy.setVersionCode(latestVersionCode);
Galaxy.setVersionName("0." + latestVersionCode);
updatableApps.add(Galaxy);
}
return updatableApps;
}
@@ -79,14 +79,14 @@ public class ForegroundUpdatableAppsTask extends UpdatableAppsTask implements Cl
button.setVisibility(enable ? View.VISIBLE : View.GONE);
textView.setVisibility(enable ? View.VISIBLE : View.GONE);
activity.findViewById(R.id.list_card).setVisibility(View.VISIBLE);
if (((YalpStoreApplication) activity.getApplication()).isBackgroundUpdating()) {
if (((GalaxyApplication) activity.getApplication()).isBackgroundUpdating()) {
button.setEnabled(false);
button.setText(R.string.list_updating);
}
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
YalpStorePermissionManager permissionManager = new YalpStorePermissionManager(activity);
GalaxyPermissionManager permissionManager = new GalaxyPermissionManager(activity);
if (permissionManager.checkPermission()) {
activity.launchUpdateAll();
} else {

View File

@@ -46,15 +46,15 @@
<string name="dialog_two_factor_cancel">Not now</string>
<string name="dialog_two_factor_create_password">Create password</string>
<string name="dialog_title_two_factor">2-Step Verification</string>
<string name="dialog_message_two_factor">It appears you have enabled 2-Step Verification for your account.\n\nPlease, create a dedicated app password for Yalp Store and use it to log in to the Yalp Store.\n\nTap \"Create password\" to be redirected to password creation page.</string>
<string name="dialog_message_two_factor">It appears you have enabled 2-Step Verification for your account.\n\nPlease, create a dedicated app password for Galaxy Store and use it to log in to the Galaxy Store.\n\nTap \"Create password\" to be redirected to password creation page.</string>
<string name="dialog_title_logout">Log out?</string>
<string name="dialog_message_logout">Are you sure you want to log out?</string>
<string name="dialog_account_type_provided_by_user">With your own Google account</string>
<string name="dialog_account_type_predefined">With a fake Yalp Store account</string>
<string name="dialog_account_type_predefined">With a fake Galaxy Store account</string>
<string name="dialog_account_type_title">How would you like to log in to Google Play Store?</string>
<string name="dialog_title_logging_in">Logging in</string>
<string name="dialog_message_logging_in_provided_by_user">Trying to log in with the credentials you provided</string>
<string name="dialog_message_logging_in_predefined">Trying to log in with credentials provided by Yalp Store</string>
<string name="dialog_message_logging_in_predefined">Trying to log in with credentials provided by Galaxy Store</string>
<string name="dialog_title_remounting_system">Working with /system partition</string>
<string name="dialog_message_remounting_system">"Working with /system partition. This might take some time."</string>
<string name="dialog_title_checking_busybox">Checking if busybox is available</string>
@@ -67,10 +67,10 @@
<string name="dialog_message_system_app_warning_to_system">You have selected to convert the app into system app. Most apps do not need to be system apps to work.\n\nKeep in mind that the conversion process is NOT supported by the Android OS and therefore is NOT safe and NOT guaranteed to work.\n\nDo not do it out of curiosity. It might break your device. Backup your device before trying.</string>
<string name="dialog_message_system_app_warning_to_normal">You have selected to convert a system app into a normal app. Most system apps need to be system apps to work.\n\nKeep in mind that the conversion process is NOT supported by the Android OS and therefore is NOT safe and NOT guaranteed to work.\n\nDo not do it out of curiosity. It might break your device. Backup your device before trying.</string>
<string name="dialog_message_system_app_warning_uninstall">Are you sure you want to remove this system app? System apps are placed into your device by device vendor and are most likely required for it to function as intended.\n\nKeep in mind that removing system apps is NOT supported by the Android OS and therefore is NOT safe and NOT guaranteed to work.\n\nDo not do it out of curiosity. It might break your device. Backup your device before trying.</string>
<string name="dialog_title_system_app_self">Making Yalp a system app</string>
<string name="dialog_message_system_app_self">Using privileged permissions to allow background installation of apps requires making Yalp Store a system app.\n\nThe process is imperfect and vendor-specific, so it might not work.\n\nDo it?</string>
<string name="dialog_title_system_app_self">Making Galaxy a system app</string>
<string name="dialog_message_system_app_self">Using privileged permissions to allow background installation of apps requires making Galaxy Store a system app.\n\nThe process is imperfect and vendor-specific, so it might not work.\n\nDo it?</string>
<string name="dialog_title_spoof_request">Request</string>
<string name="dialog_message_spoof_request">Device spoofing is possible because users such as you submit bug reports with device information. If you want the definitions to be precise and up-to-date, please tap OK and your device information will be sent to the Yalp Store developer.</string>
<string name="dialog_message_spoof_request">Device spoofing is possible because users such as you submit bug reports with device information. If you want the definitions to be precise and up-to-date, please tap OK and your device information will be sent to the Galaxy Store developer.</string>
<string name="error_incorrect_password">Incorrect email or password.</string>
<string name="error_credentials_empty">Provide google account credentials, please.</string>
<string name="error_no_network">No network connection.</string>
@@ -151,7 +151,7 @@
<string name="pref_update_list_black">Change apps black list</string>
<string name="pref_update_list_white">Change apps white list</string>
<string name="pref_background_update_interval_manually">Only manually</string>
<string name="pref_background_update_interval_never">Only on Yalp Store launch</string>
<string name="pref_background_update_interval_never">Only on Galaxy Store launch</string>
<string name="pref_background_update_interval_hourly">Hourly</string>
<string name="pref_background_update_interval_daily">Daily</string>
<string name="pref_background_update_interval_weekly">Weekly</string>
@@ -174,7 +174,7 @@
<string name="pref_category_installation">Installation</string>
<string name="pref_category_spoofing">Spoofing</string>
<string name="pref_category_ui">User Interface</string>
<string name="pref_not_privileged">Only available if Yalp is a system app</string>
<string name="pref_not_privileged">Only available if Galaxy is a system app</string>
<string name="pref_installation_method">Installation method</string>
<string name="pref_installation_method_default">Default installation dialog, no background installs</string>
<string name="pref_installation_method_root">Using root</string>
@@ -187,7 +187,7 @@
<string name="pref_download_deltas_summary_on">Only changes are downloaded during updates</string>
<string name="pref_download_directory">Download directory</string>
<string name="pref_auto_whitelist">Auto whitelist</string>
<string name="pref_auto_whitelist_summary_on">Apps installed by Yalp Store are automatically whitelisted</string>
<string name="pref_auto_whitelist_summary_on">Apps installed by Galaxy Store are automatically whitelisted</string>
<string name="pref_auto_whitelist_summary_off">You need to whitelist apps manually</string>
<string name="download_manager_ERROR_UNKNOWN">Unknown error.</string>
<string name="download_manager_ERROR_FILE_ERROR">Unknown file storage error.</string>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/app_name"
android:searchSuggestAuthority="in.dragons.galaxy.YalpSuggestionProvider"
android:searchSuggestAuthority="in.dragons.galaxy.GalaxySuggestionProvider"
android:searchSuggestIntentAction="android.intent.action.VIEW"
android:hint="@string/search_title" />