Reformat code

This commit is contained in:
Boris Timofeev 2017-01-19 17:35:00 +03:00
parent 1e634ec86e
commit c7754a562f
48 changed files with 399 additions and 363 deletions

View file

@ -56,10 +56,10 @@ android {
def Properties props = new Properties() def Properties props = new Properties()
def propFile = file('../../signing.properties') def propFile = file('../../signing.properties')
if (propFile.canRead()){ if (propFile.canRead()) {
props.load(new FileInputStream(propFile)) props.load(new FileInputStream(propFile))
if (props!=null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') && if (props != null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) { props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
println 'RELEASE BUILD SIGNING' println 'RELEASE BUILD SIGNING'

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.emunix.unipatcher"> package="org.emunix.unipatcher">
<uses-permission android:name="com.android.vending.BILLING" /> <uses-permission android:name="com.android.vending.BILLING"/>
<application /> <application/>
</manifest> </manifest>

View file

@ -1,77 +1,77 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.emunix.unipatcher" package="org.emunix.unipatcher"
android:installLocation="auto"> android:installLocation="auto">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application <application
android:allowBackup="false" android:allowBackup="false"
android:extractNativeLibs="false"
android:fullBackupContent="false" android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:supportsRtl="false" android:supportsRtl="false"
android:extractNativeLibs="false"
android:theme="@style/AppTheme.NoActionBar"> android:theme="@style/AppTheme.NoActionBar">
<activity <activity
android:name=".ui.activity.MainActivity" android:name=".ui.activity.MainActivity"
android:label="@string/app_name" android:label="@string/app_name"
android:launchMode="singleTask"> android:launchMode="singleTask">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="file" /> <data android:scheme="file"/>
<data android:mimeType="*/*" /> <data android:mimeType="*/*"/>
<data android:pathPattern="/.*\\.aps" /> <data android:pathPattern="/.*\\.aps"/>
<data android:pathPattern="/.*\\.ips" /> <data android:pathPattern="/.*\\.ips"/>
<data android:pathPattern="/.*\\.ups" /> <data android:pathPattern="/.*\\.ups"/>
<data android:pathPattern="/.*\\.bps" /> <data android:pathPattern="/.*\\.bps"/>
<data android:pathPattern="/.*\\.ppf" /> <data android:pathPattern="/.*\\.ppf"/>
<data android:pathPattern="/.*\\.ebp" /> <data android:pathPattern="/.*\\.ebp"/>
<data android:pathPattern="/.*\\.dps" /> <data android:pathPattern="/.*\\.dps"/>
<data android:pathPattern="/.*\\.xdelta" /> <data android:pathPattern="/.*\\.xdelta"/>
<data android:pathPattern="/.*\\.xdelta3" /> <data android:pathPattern="/.*\\.xdelta3"/>
<data android:pathPattern="/.*\\.vcdiff" /> <data android:pathPattern="/.*\\.vcdiff"/>
<data android:host="*" /> <data android:host="*"/>
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".ui.activity.FilePickerActivity" android:name=".ui.activity.FilePickerActivity"
android:label="@string/file_picker_activity_title" /> android:label="@string/file_picker_activity_title"/>
<activity <activity
android:name=".ui.activity.SettingsActivity" android:name=".ui.activity.SettingsActivity"
android:label="@string/settings_activity_title" android:label="@string/settings_activity_title"
android:theme="@style/PreferenceTheme" /> android:theme="@style/PreferenceTheme"/>
<activity <activity
android:name=".ui.activity.HelpActivity" android:name=".ui.activity.HelpActivity"
android:label="@string/help_activity_title" /> android:label="@string/help_activity_title"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity <activity
android:name=".ui.activity.DonateActivity" android:name=".ui.activity.DonateActivity"
android:label="@string/donate_activity_title" /> android:label="@string/donate_activity_title"/>
<service <service
android:name=".WorkerService" android:name=".WorkerService"
android:exported="false" /> android:exported="false"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
</application> </application>

View file

@ -39,11 +39,10 @@ const int ERR_UNABLE_OPEN_OUTPUT = -5003;
const int ERR_WRONG_CHECKSUM = -5010; const int ERR_WRONG_CHECKSUM = -5010;
int Java_org_emunix_unipatcher_patch_XDelta_xdelta3apply(JNIEnv *env, int Java_org_emunix_unipatcher_patch_XDelta_xdelta3apply(JNIEnv *env,
jobject this, jobject this,
jstring patchPath, jstring patchPath,
jstring romPath, jstring romPath,
jstring outputPath) jstring outputPath) {
{
int ret = 0; int ret = 0;
const char *patchName = (*env)->GetStringUTFChars(env, patchPath, NULL); const char *patchName = (*env)->GetStringUTFChars(env, patchPath, NULL);
const char *romName = (*env)->GetStringUTFChars(env, romPath, NULL); const char *romName = (*env)->GetStringUTFChars(env, romPath, NULL);
@ -57,19 +56,16 @@ int Java_org_emunix_unipatcher_patch_XDelta_xdelta3apply(JNIEnv *env,
(*env)->ReleaseStringUTFChars(env, romPath, romName); (*env)->ReleaseStringUTFChars(env, romPath, romName);
(*env)->ReleaseStringUTFChars(env, outputPath, outputName); (*env)->ReleaseStringUTFChars(env, outputPath, outputName);
if (!patchFile) if (!patchFile) {
{
return ERR_UNABLE_OPEN_PATCH; return ERR_UNABLE_OPEN_PATCH;
} }
if (!romFile) if (!romFile) {
{
fclose(patchFile); fclose(patchFile);
return ERR_UNABLE_OPEN_ROM; return ERR_UNABLE_OPEN_ROM;
} }
if (!outputFile) if (!outputFile) {
{
fclose(patchFile); fclose(patchFile);
fclose(romFile); fclose(romFile);
return ERR_UNABLE_OPEN_OUTPUT; return ERR_UNABLE_OPEN_OUTPUT;
@ -83,19 +79,18 @@ int Java_org_emunix_unipatcher_patch_XDelta_xdelta3apply(JNIEnv *env,
return ret; return ret;
} }
int apply(FILE *patch, FILE *in, FILE *out) int apply(FILE *patch, FILE *in, FILE *out) {
{
int BUFFER_SIZE = 32768; int BUFFER_SIZE = 32768;
int r, ret; int r, ret;
xd3_stream stream; xd3_stream stream;
xd3_config config; xd3_config config;
xd3_source source; xd3_source source;
void* Input_Buf; void *Input_Buf;
int Input_Buf_Read; int Input_Buf_Read;
memset (&stream, 0, sizeof (stream)); memset(&stream, 0, sizeof(stream));
memset (&source, 0, sizeof (source)); memset(&source, 0, sizeof(source));
xd3_init_config(&config, 0); xd3_init_config(&config, 0);
config.winsize = BUFFER_SIZE; config.winsize = BUFFER_SIZE;
@ -108,18 +103,16 @@ int apply(FILE *patch, FILE *in, FILE *out)
r = fseek(in, 0, SEEK_SET); r = fseek(in, 0, SEEK_SET);
if (r) if (r)
return r; return r;
source.onblk = fread((void*)source.curblk, 1, source.blksize, in); source.onblk = fread((void *) source.curblk, 1, source.blksize, in);
source.curblkno = 0; source.curblkno = 0;
xd3_set_source(&stream, &source); xd3_set_source(&stream, &source);
Input_Buf = malloc(BUFFER_SIZE); Input_Buf = malloc(BUFFER_SIZE);
fseek(patch, 0, SEEK_SET); fseek(patch, 0, SEEK_SET);
do do {
{
Input_Buf_Read = fread(Input_Buf, 1, BUFFER_SIZE, patch); Input_Buf_Read = fread(Input_Buf, 1, BUFFER_SIZE, patch);
if (Input_Buf_Read < BUFFER_SIZE) if (Input_Buf_Read < BUFFER_SIZE) {
{
xd3_set_flags(&stream, XD3_FLUSH | stream.flags); xd3_set_flags(&stream, XD3_FLUSH | stream.flags);
} }
xd3_avail_input(&stream, Input_Buf, Input_Buf_Read); xd3_avail_input(&stream, Input_Buf, Input_Buf_Read);
@ -128,14 +121,13 @@ int apply(FILE *patch, FILE *in, FILE *out)
ret = xd3_decode_input(&stream); ret = xd3_decode_input(&stream);
switch (ret) switch (ret) {
{
case XD3_INPUT: case XD3_INPUT:
continue; continue;
case XD3_OUTPUT: case XD3_OUTPUT:
r = fwrite(stream.next_out, 1, stream.avail_out, out); r = fwrite(stream.next_out, 1, stream.avail_out, out);
if (r != (int)stream.avail_out) if (r != (int) stream.avail_out)
return r; return r;
xd3_consume_output(&stream); xd3_consume_output(&stream);
goto process; goto process;
@ -144,7 +136,7 @@ int apply(FILE *patch, FILE *in, FILE *out)
r = fseek(in, source.blksize * source.getblkno, SEEK_SET); r = fseek(in, source.blksize * source.getblkno, SEEK_SET);
if (r) if (r)
return r; return r;
source.onblk = fread((void*)source.curblk, 1, source.blksize, in); source.onblk = fread((void *) source.curblk, 1, source.blksize, in);
source.curblkno = source.getblkno; source.curblkno = source.getblkno;
goto process; goto process;
@ -166,7 +158,7 @@ int apply(FILE *patch, FILE *in, FILE *out)
free(Input_Buf); free(Input_Buf);
free((void*)source.curblk); free((void *) source.curblk);
xd3_close_stream(&stream); xd3_close_stream(&stream);
xd3_free_stream(&stream); xd3_free_stream(&stream);

View file

@ -73,17 +73,20 @@ public class Utils {
public static long getFreeSpace(File file) { public static long getFreeSpace(File file) {
StatFs stat = new StatFs(file.getPath()); StatFs stat = new StatFs(file.getPath());
long bytesAvailable; long bytesAvailable;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
bytesAvailable = stat.getAvailableBytes(); bytesAvailable = stat.getAvailableBytes();
else } else
//noinspection deprecation //noinspection deprecation
{
bytesAvailable = (long) stat.getBlockSize() * (long) stat.getAvailableBlocks(); bytesAvailable = (long) stat.getBlockSize() * (long) stat.getAvailableBlocks();
}
return bytesAvailable; return bytesAvailable;
} }
public static void copyFile(Context context, File from, File to) throws IOException { public static void copyFile(Context context, File from, File to) throws IOException {
if (Utils.getFreeSpace(to.getParentFile()) < from.length()) if (Utils.getFreeSpace(to.getParentFile()) < from.length()) {
throw new IOException(context.getString(R.string.notify_error_not_enough_space)); throw new IOException(context.getString(R.string.notify_error_not_enough_space));
}
try { try {
FileUtils.copyFile(from, to); FileUtils.copyFile(from, to);
@ -94,7 +97,7 @@ public class Utils {
public static void moveFile(Context context, File from, File to) throws IOException { public static void moveFile(Context context, File from, File to) throws IOException {
FileUtils.deleteQuietly(to); FileUtils.deleteQuietly(to);
if(!from.renameTo(to)) { if (!from.renameTo(to)) {
copyFile(context, from, to); copyFile(context, from, to);
FileUtils.deleteQuietly(from); FileUtils.deleteQuietly(from);
} }
@ -141,24 +144,28 @@ public class Utils {
public static String bytesToHexString(byte[] bytes) { public static String bytesToHexString(byte[] bytes) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for(int i = 0; i < bytes.length ;i++) { for (int i = 0; i < bytes.length; i++) {
sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1)); sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1));
} }
return sb.toString(); return sb.toString();
} }
public static boolean isPatch(File file) { public static boolean isPatch(File file) {
String[] patches = {"ips", "ups", "bps", "aps", "ppf", "dps", "ebp", "xdelta", "xdelta3", "vcdiff"}; String[] patches =
{"ips", "ups", "bps", "aps", "ppf", "dps", "ebp", "xdelta", "xdelta3", "vcdiff"};
String ext = FilenameUtils.getExtension(file.getName()).toLowerCase(Locale.getDefault()); String ext = FilenameUtils.getExtension(file.getName()).toLowerCase(Locale.getDefault());
for (String patch : patches) { for (String patch : patches) {
if (ext.equals(patch)) if (ext.equals(patch)) return true;
return true;
} }
return false; return false;
} }
public static boolean isArchive(String path) { public static boolean isArchive(String path) {
String ext = FilenameUtils.getExtension(path).toLowerCase(Locale.getDefault()); String ext = FilenameUtils.getExtension(path).toLowerCase(Locale.getDefault());
return ext.equals("zip") || ext.equals("rar") || ext.equals("7z") || ext.equals("gz") || ext.equals("tgz"); return ext.equals("zip")
|| ext.equals("rar")
|| ext.equals("7z")
|| ext.equals("gz")
|| ext.equals("tgz");
} }
} }

View file

@ -99,7 +99,7 @@ public class WorkerService extends IntentService {
File outputFile = new File(intent.getStringExtra("outputPath")); File outputFile = new File(intent.getStringExtra("outputPath"));
Patch patcher = null; Patch patcher = null;
if(!fileExists(patchFile) || !fileExists(romFile)) if (!fileExists(patchFile) || !fileExists(romFile))
return; return;
// create output dir // create output dir
@ -115,7 +115,7 @@ public class WorkerService extends IntentService {
// check access to output dir // check access to output dir
try { try {
if (!outputFile.getParentFile().canWrite()){ if (!outputFile.getParentFile().canWrite()) {
String text = getString(R.string.notify_error_unable_to_write_to_directory, outputFile.getParent()); String text = getString(R.string.notify_error_unable_to_write_to_directory, outputFile.getParent());
showErrorNotification(text); showErrorNotification(text);
return; return;
@ -176,7 +176,7 @@ public class WorkerService extends IntentService {
String errorMsg = null; String errorMsg = null;
File romFile = new File(intent.getStringExtra("romPath")); File romFile = new File(intent.getStringExtra("romPath"));
if(!fileExists(romFile)) if (!fileExists(romFile))
return; return;
SmdFixChecksum fixer = new SmdFixChecksum(this, romFile); SmdFixChecksum fixer = new SmdFixChecksum(this, romFile);
@ -200,7 +200,7 @@ public class WorkerService extends IntentService {
File romFile = new File(intent.getStringExtra("romPath")); File romFile = new File(intent.getStringExtra("romPath"));
String headerPath = intent.getStringExtra("headerPath"); String headerPath = intent.getStringExtra("headerPath");
if(!fileExists(romFile)) if (!fileExists(romFile))
return; return;
SnesSmcHeader worker = new SnesSmcHeader(); SnesSmcHeader worker = new SnesSmcHeader();
@ -230,7 +230,7 @@ public class WorkerService extends IntentService {
File romFile = new File(intent.getStringExtra("romPath")); File romFile = new File(intent.getStringExtra("romPath"));
if(!fileExists(romFile)) if (!fileExists(romFile))
return; return;
SnesSmcHeader worker = new SnesSmcHeader(); SnesSmcHeader worker = new SnesSmcHeader();
@ -271,7 +271,7 @@ public class WorkerService extends IntentService {
.setContentIntent(PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT)) .setContentIntent(PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT))
.setAutoCancel(true) .setAutoCancel(true)
.setStyle(new NotificationCompat.BigTextStyle() .setStyle(new NotificationCompat.BigTextStyle()
.bigText(text)) .bigText(text))
.build(); .build();
nm.notify(0, notify); nm.notify(0, notify);
} }

View file

@ -47,9 +47,11 @@ public class APS extends Patch {
Patch aps = null; Patch aps = null;
switch (checkAPS(patchFile)) { switch (checkAPS(patchFile)) {
case APS_N64_PATCH: case APS_N64_PATCH:
aps = new APS_N64(context, patchFile, romFile, outputFile); break; aps = new APS_N64(context, patchFile, romFile, outputFile);
break;
case APS_GBA_PATCH: case APS_GBA_PATCH:
aps = new APS_GBA(context, patchFile, romFile, outputFile); break; aps = new APS_GBA(context, patchFile, romFile, outputFile);
break;
case NOT_APS_PATCH: case NOT_APS_PATCH:
throw new PatchException(context.getString(R.string.notify_error_not_aps_patch)); throw new PatchException(context.getString(R.string.notify_error_not_aps_patch));
} }

View file

@ -130,7 +130,7 @@ public class APS_GBA extends Patch {
crc = crc16(romBuf); crc = crc16(romBuf);
for(int i = 0; i < CHUNK_SIZE; i++) for (int i = 0; i < CHUNK_SIZE; i++)
romBuf[i] ^= patchBuf[i]; romBuf[i] ^= patchBuf[i];
if (crc == patchCrc1) { if (crc == patchCrc1) {
@ -151,7 +151,7 @@ public class APS_GBA extends Patch {
IOUtils.closeQuietly(output); IOUtils.closeQuietly(output);
} }
if(isOriginal) { if (isOriginal) {
Utils.truncateFile(outputFile, fileSize2); Utils.truncateFile(outputFile, fileSize2);
} else { } else {
Utils.truncateFile(outputFile, fileSize1); Utils.truncateFile(outputFile, fileSize1);

View file

@ -144,7 +144,7 @@ public class APS_N64 extends Patch {
size = patchStream.read(); size = patchStream.read();
patchPos++; patchPos++;
if (size != 0) { if (size != 0) {
byte[] data = new byte[(int)size]; byte[] data = new byte[(int) size];
patchStream.read(data); patchStream.read(data);
patchPos += size; patchPos += size;
outputStream.write(data); outputStream.write(data);
@ -153,7 +153,7 @@ public class APS_N64 extends Patch {
byte val = (byte) patchStream.read(); byte val = (byte) patchStream.read();
size = patchStream.read(); size = patchStream.read();
patchPos += 2; patchPos += 2;
byte[] data = new byte[(int)size]; byte[] data = new byte[(int) size];
Arrays.fill(data, val); Arrays.fill(data, val);
outputStream.write(data); outputStream.write(data);
outPos += size; outPos += size;
@ -164,7 +164,7 @@ public class APS_N64 extends Patch {
if (romPos + size > romSize) { if (romPos + size > romSize) {
romPos = (int) romSize; romPos = (int) romSize;
} else { } else {
byte[] buf = new byte[(int)size]; byte[] buf = new byte[(int) size];
romStream.read(buf); romStream.read(buf);
romPos += size; romPos += size;
} }
@ -226,7 +226,7 @@ public class APS_N64 extends Patch {
} }
private long readLELong(InputStream stream) throws IOException { private long readLELong(InputStream stream) throws IOException {
return (stream.read() & 0xff) + ((stream.read() & 0xff) << 8) return (stream.read() & 0xff) + ((stream.read() & 0xff) << 8)
+ ((stream.read() & 0xff) << 16) + ((stream.read() & 0xff) << 24); + ((stream.read() & 0xff) << 16) + ((stream.read() & 0xff) << 24);
} }
} }

View file

@ -250,7 +250,7 @@ public class BPS extends Patch {
throw new PatchException(context.getString(R.string.notify_error_patch_corrupted)); throw new PatchException(context.getString(R.string.notify_error_patch_corrupted));
return new BpsCrc(inputCrc, outputCrc, patchCrc, realPatchCrc); return new BpsCrc(inputCrc, outputCrc, patchCrc, realPatchCrc);
} finally { } finally {
IOUtils.closeQuietly(stream); IOUtils.closeQuietly(stream);
} }
} }

View file

@ -44,11 +44,11 @@ public class DPS extends Patch {
@Override @Override
public void apply() throws PatchException, IOException { public void apply() throws PatchException, IOException {
if (patchFile.length() < MIN_SIZE_PATCH) { if (patchFile.length() < MIN_SIZE_PATCH) {
throw new PatchException(context.getString(R.string.notify_error_patch_corrupted)); throw new PatchException(context.getString(R.string.notify_error_patch_corrupted));
} }
BufferedInputStream patchStream = null; BufferedInputStream patchStream = null;
RandomAccessFile romStream = null; RandomAccessFile romStream = null;
RandomAccessFile outputStream = null; RandomAccessFile outputStream = null;
@ -121,7 +121,7 @@ public class DPS extends Patch {
} }
private long getUInt(byte[] a, int offset) { private long getUInt(byte[] a, int offset) {
return ((long)(a[offset] & 0xff)) + ((long)(a[offset + 1] & 0xff) << 8) + return ((long) (a[offset] & 0xff)) + ((long) (a[offset + 1] & 0xff) << 8) +
((long)(a[offset + 2] & 0xff) << 16) + ((long)(a[offset + 3] & 0xff) << 24); ((long) (a[offset + 2] & 0xff) << 16) + ((long) (a[offset + 3] & 0xff) << 24);
} }
} }

View file

@ -106,7 +106,7 @@ public class EBP extends Patch {
// if we couldn't fix the ROM, try to remove a 0xff byte at the end. // if we couldn't fix the ROM, try to remove a 0xff byte at the end.
if (!checkMD5(file)) { if (!checkMD5(file)) {
int length = (int)file.length(); int length = (int) file.length();
byte[] buffer = new byte[length]; byte[] buffer = new byte[length];
FileInputStream in = new FileInputStream(file); FileInputStream in = new FileInputStream(file);
int count = in.read(buffer); int count = in.read(buffer);
@ -254,7 +254,7 @@ public class EBP extends Patch {
if (size < 2) if (size < 2)
throw new PatchException(context.getString(R.string.notify_error_patch_corrupted)); throw new PatchException(context.getString(R.string.notify_error_patch_corrupted));
ips.write(buffer, 0, 2); ips.write(buffer, 0, 2);
size = (((int)buffer[0] & 0xff) << 8) + ((int)buffer[1] & 0xff); size = (((int) buffer[0] & 0xff) << 8) + ((int) buffer[1] & 0xff);
if (size != 0) { if (size != 0) {
int c = ebp.read(buffer, 0, size); int c = ebp.read(buffer, 0, size);
if (c < size) if (c < size)

View file

@ -32,7 +32,6 @@ import java.util.Arrays;
public class PPF extends Patch { public class PPF extends Patch {
// private static final String LOG_TAG = "PPF";
private static final byte[] MAGIC_NUMBER = {0x50, 0x50, 0x46}; // "PPF" without version private static final byte[] MAGIC_NUMBER = {0x50, 0x50, 0x46}; // "PPF" without version
private RandomAccessFile patchStream; private RandomAccessFile patchStream;
@ -75,10 +74,17 @@ public class PPF extends Patch {
} }
switch (getPPFVersion(patchFile)) { switch (getPPFVersion(patchFile)) {
case 1: applyPPF1(); break; case 1:
case 2: applyPPF2(); break; applyPPF1();
case 3: applyPPF3(); break; break;
default: throw new PatchException(context.getString(R.string.notify_error_not_ppf_patch)); case 2:
applyPPF2();
break;
case 3:
applyPPF3();
break;
default:
throw new PatchException(context.getString(R.string.notify_error_not_ppf_patch));
} }
} }
@ -217,24 +223,24 @@ public class PPF extends Patch {
private long readLittleEndianLong(RandomAccessFile stream) throws IOException { private long readLittleEndianLong(RandomAccessFile stream) throws IOException {
byte[] b = new byte[8]; byte[] b = new byte[8];
stream.read(b); stream.read(b);
long result = ((long)(b[7] & 0xff) << 56) + ((long)(b[6] & 0xff) << 48 ) + long result = ((long) (b[7] & 0xff) << 56) + ((long) (b[6] & 0xff) << 48) +
((long)(b[5] & 0xff) << 40) + ((long)(b[4] & 0xff) << 32 ) + ((long) (b[5] & 0xff) << 40) + ((long) (b[4] & 0xff) << 32) +
((long)(b[3] & 0xff) << 24) + ((long)(b[2] & 0xff) << 16 ) + ((long) (b[3] & 0xff) << 24) + ((long) (b[2] & 0xff) << 16) +
((long)(b[1] & 0xff) << 8) + ((long)b[0] & 0xff); ((long) (b[1] & 0xff) << 8) + ((long) b[0] & 0xff);
return result; return result;
} }
private int readLittleEndianInt(RandomAccessFile stream) throws IOException { private int readLittleEndianInt(RandomAccessFile stream) throws IOException {
byte[] b = new byte[4]; byte[] b = new byte[4];
stream.read(b); stream.read(b);
return ((b[3] & 0xff) << 24) + ((b[2] & 0xff) <<16 ) + return ((b[3] & 0xff) << 24) + ((b[2] & 0xff) << 16) +
((b[1] & 0xff) << 8) + (b[0]&0xff); ((b[1] & 0xff) << 8) + (b[0] & 0xff);
} }
/** /**
* Returns size of FileID * Returns size of FileID
* *
* @param stream stream of PPF file * @param stream stream of PPF file
* @param ppfVersion version of PPF patch * @param ppfVersion version of PPF patch
* @return size of FileID or 0 * @return size of FileID or 0
*/ */

View file

@ -38,6 +38,7 @@ import java.util.zip.CRC32;
public class UPS extends Patch { public class UPS extends Patch {
private static final byte[] MAGIC_NUMBER = {0x55, 0x50, 0x53, 0x31}; // "UPS1" private static final byte[] MAGIC_NUMBER = {0x55, 0x50, 0x53, 0x31}; // "UPS1"
public UPS(Context context, File patch, File rom, File output) { public UPS(Context context, File patch, File rom, File output) {
super(context, patch, rom, output); super(context, patch, rom, output);
} }
@ -197,7 +198,7 @@ public class UPS extends Patch {
throw new PatchException(context.getString(R.string.notify_error_patch_corrupted)); throw new PatchException(context.getString(R.string.notify_error_patch_corrupted));
return new UpsCrc(inputCrc, outputCrc, patchCrc, realPatchCrc); return new UpsCrc(inputCrc, outputCrc, patchCrc, realPatchCrc);
} finally { } finally {
IOUtils.closeQuietly(stream); IOUtils.closeQuietly(stream);
} }
} }
@ -243,7 +244,7 @@ public class UPS extends Patch {
return realPatchCRC; return realPatchCRC;
} }
public void swapInOut(){ public void swapInOut() {
long tmp; long tmp;
tmp = inputFileCRC; tmp = inputFileCRC;
inputFileCRC = outputFileCRC; inputFileCRC = outputFileCRC;

View file

@ -51,7 +51,7 @@ public class SmdFixChecksum {
try { try {
smdStream = new BufferedInputStream(new FileInputStream(smdFile)); smdStream = new BufferedInputStream(new FileInputStream(smdFile));
long c = IOUtils.skip(smdStream, 512); long c = IOUtils.skip(smdStream, 512);
if (c != 512) if (c != 512)
throw new IOException("Skip failed"); throw new IOException("Skip failed");
@ -83,7 +83,7 @@ public class SmdFixChecksum {
smdStream.writeByte((sum >> 8) & 0xff); smdStream.writeByte((sum >> 8) & 0xff);
smdStream.writeByte(sum & 0xff); smdStream.writeByte(sum & 0xff);
} finally { } finally {
IOUtils.closeQuietly(smdStream); IOUtils.closeQuietly(smdStream);
} }
} }
} }

View file

@ -60,7 +60,7 @@ public class SnesSmcHeader {
int length; int length;
length = inputRom.read(header); length = inputRom.read(header);
if (saveHeader) { if (saveHeader) {
File headerfile = new File(romfile.getPath()+".smc_header"); File headerfile = new File(romfile.getPath() + ".smc_header");
outputHeader = new FileOutputStream(headerfile); outputHeader = new FileOutputStream(headerfile);
outputHeader.write(header, 0, length); outputHeader.write(header, 0, length);
} }

View file

@ -216,7 +216,7 @@ public class FilePickerActivity extends AppCompatActivity implements FilePickerA
fileList.add(entry); fileList.add(entry);
} else { } else {
entry = new FileEntry(); entry = new FileEntry();
if (Utils.isPatch(file)){ if (Utils.isPatch(file)) {
entry.setIcon(R.drawable.ic_healing_grey600_24dp); entry.setIcon(R.drawable.ic_healing_grey600_24dp);
} else { } else {
entry.setIcon(R.drawable.ic_insert_drive_file_grey600_24dp); entry.setIcon(R.drawable.ic_insert_drive_file_grey600_24dp);
@ -359,8 +359,7 @@ public class FilePickerActivity extends AppCompatActivity implements FilePickerA
} }
} }
private HashMap<String, String> getFileChecksums(File file) throws IOException, NoSuchAlgorithmException, IllegalArgumentException private HashMap<String, String> getFileChecksums(File file) throws IOException, NoSuchAlgorithmException, IllegalArgumentException {
{
if (file.isDirectory()) if (file.isDirectory())
throw new IllegalArgumentException("Unable calculate checksum for directory"); throw new IllegalArgumentException("Unable calculate checksum for directory");

View file

@ -54,7 +54,7 @@ import static android.support.v7.app.AppCompatDelegate.MODE_NIGHT_NO;
import static android.support.v7.app.AppCompatDelegate.MODE_NIGHT_YES; import static android.support.v7.app.AppCompatDelegate.MODE_NIGHT_YES;
public class MainActivity extends AppCompatActivity public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener { implements NavigationView.OnNavigationItemSelectedListener {
private static final String LOG_TAG = "org.emunix.unipatcher"; private static final String LOG_TAG = "org.emunix.unipatcher";
private FirebaseAnalytics firebaseAnalytics; private FirebaseAnalytics firebaseAnalytics;
@ -84,7 +84,7 @@ public class MainActivity extends AppCompatActivity
public void onClick(View view) { public void onClick(View view) {
FragmentManager fragmentManager = getSupportFragmentManager(); FragmentManager fragmentManager = getSupportFragmentManager();
ActionFragment fragment = (ActionFragment) fragmentManager.findFragmentById(R.id.content_frame); ActionFragment fragment = (ActionFragment) fragmentManager.findFragmentById(R.id.content_frame);
if (fragment != null){ if (fragment != null) {
boolean ret = fragment.runAction(); boolean ret = fragment.runAction();
} }
//Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) //Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
@ -105,7 +105,7 @@ public class MainActivity extends AppCompatActivity
private void setTheme() { private void setTheme() {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
String theme = sp.getString("theme","light"); String theme = sp.getString("theme", "light");
switch (theme) { switch (theme) {
case "light": case "light":
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO); AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO);
@ -156,9 +156,14 @@ public class MainActivity extends AppCompatActivity
// update the main content by replacing fragments // update the main content by replacing fragments
Fragment fragment; Fragment fragment;
switch (position) { switch (position) {
case 1: fragment = new SmdFixChecksumFragment(); break; case 1:
case 2: fragment = new SnesSmcHeaderFragment(); break; fragment = new SmdFixChecksumFragment();
default: fragment = new PatchingFragment(); break;
case 2:
fragment = new SnesSmcHeaderFragment();
break;
default:
fragment = new PatchingFragment();
} }
FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); FragmentTransaction ft = getSupportFragmentManager().beginTransaction();

View file

@ -38,6 +38,7 @@ public class FilePickerAdapter extends RecyclerView.Adapter<FilePickerAdapter.Vi
public interface OnItemClickListener { public interface OnItemClickListener {
void onItemClick(View v, int position); void onItemClick(View v, int position);
void onItemLongClick(View v, int position); void onItemLongClick(View v, int position);
} }

View file

@ -58,7 +58,8 @@ public class PatchingFragment extends ActionFragment implements View.OnClickList
private String patchPath = null; private String patchPath = null;
private String outputPath = null; private String outputPath = null;
public PatchingFragment() {} public PatchingFragment() {
}
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -118,14 +119,14 @@ public class PatchingFragment extends ActionFragment implements View.OnClickList
} }
private void restoreState(Bundle savedInstanceState) { private void restoreState(Bundle savedInstanceState) {
if (savedInstanceState != null){ if (savedInstanceState != null) {
romPath = savedInstanceState.getString("romPath"); romPath = savedInstanceState.getString("romPath");
patchPath = savedInstanceState.getString("patchPath"); patchPath = savedInstanceState.getString("patchPath");
outputPath = savedInstanceState.getString("outputPath"); outputPath = savedInstanceState.getString("outputPath");
if (romPath != null) if (romPath != null)
romNameTextView.setText(new File(romPath).getName()); romNameTextView.setText(new File(romPath).getName());
if (patchPath != null) if (patchPath != null)
patchNameTextView.setText(new File (patchPath).getName()); patchNameTextView.setText(new File(patchPath).getName());
if (outputPath != null) if (outputPath != null)
outputNameTextView.setText(new File(outputPath).getName()); outputNameTextView.setText(new File(outputPath).getName());
} }
@ -140,7 +141,7 @@ public class PatchingFragment extends ActionFragment implements View.OnClickList
} }
@Override @Override
public void onClick(View view){ public void onClick(View view) {
Intent intent = new Intent(getActivity(), FilePickerActivity.class); Intent intent = new Intent(getActivity(), FilePickerActivity.class);
switch (view.getId()) { switch (view.getId()) {
case R.id.patchCardView: case R.id.patchCardView:
@ -160,7 +161,7 @@ public class PatchingFragment extends ActionFragment implements View.OnClickList
} }
@Override @Override
public void onActivityResult(int requestCode, int resultCode, Intent data){ public void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d(LOG_TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data); Log.d(LOG_TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data);
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
String path = data.getStringExtra("path"); String path = data.getStringExtra("path");
@ -171,20 +172,20 @@ public class PatchingFragment extends ActionFragment implements View.OnClickList
} }
switch (requestCode) { switch (requestCode) {
case SELECT_ROM_FILE: case SELECT_ROM_FILE:
romPath = path; romPath = path;
romNameTextView.setVisibility(View.VISIBLE); romNameTextView.setVisibility(View.VISIBLE);
romNameTextView.setText(fpath.getName()); romNameTextView.setText(fpath.getName());
Settings.setLastRomDir(getActivity(), fpath.getParent()); Settings.setLastRomDir(getActivity(), fpath.getParent());
outputPath = makeOutputPath(path); outputPath = makeOutputPath(path);
outputNameTextView.setText(new File(outputPath).getName()); outputNameTextView.setText(new File(outputPath).getName());
break; break;
case SELECT_PATCH_FILE: case SELECT_PATCH_FILE:
patchPath = path; patchPath = path;
patchNameTextView.setVisibility(View.VISIBLE); patchNameTextView.setVisibility(View.VISIBLE);
patchNameTextView.setText(fpath.getName()); patchNameTextView.setText(fpath.getName());
Settings.setLastPatchDir(getActivity(), fpath.getParent()); Settings.setLastPatchDir(getActivity(), fpath.getParent());
break; break;
} }
} }
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
@ -200,14 +201,14 @@ public class PatchingFragment extends ActionFragment implements View.OnClickList
return FilenameUtils.concat(dir, baseName.concat(" [patched].").concat(ext)); return FilenameUtils.concat(dir, baseName.concat(" [patched].").concat(ext));
} }
public boolean runAction(){ public boolean runAction() {
if (romPath == null & patchPath == null){ if (romPath == null & patchPath == null) {
Toast.makeText(getActivity(), getString(R.string.main_activity_toast_rom_and_patch_not_selected), Toast.LENGTH_LONG).show(); Toast.makeText(getActivity(), getString(R.string.main_activity_toast_rom_and_patch_not_selected), Toast.LENGTH_LONG).show();
return false; return false;
} else if (romPath == null){ } else if (romPath == null) {
Toast.makeText(getActivity(), getString(R.string.main_activity_toast_rom_not_selected), Toast.LENGTH_LONG).show(); Toast.makeText(getActivity(), getString(R.string.main_activity_toast_rom_not_selected), Toast.LENGTH_LONG).show();
return false; return false;
} else if (patchPath == null){ } else if (patchPath == null) {
Toast.makeText(getActivity(), getString(R.string.main_activity_toast_patch_not_selected), Toast.LENGTH_LONG).show(); Toast.makeText(getActivity(), getString(R.string.main_activity_toast_patch_not_selected), Toast.LENGTH_LONG).show();
return false; return false;
} }
@ -219,11 +220,11 @@ public class PatchingFragment extends ActionFragment implements View.OnClickList
intent.putExtra("outputPath", outputPath); intent.putExtra("outputPath", outputPath);
getActivity().startService(intent); getActivity().startService(intent);
Toast.makeText(getActivity(), R.string.toast_patching_started_check_notify,Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), R.string.toast_patching_started_check_notify, Toast.LENGTH_SHORT).show();
return true; return true;
} }
private void renameOutputRom(){ private void renameOutputRom() {
if (romPath == null) { if (romPath == null) {
Toast.makeText(getActivity(), getString(R.string.main_activity_toast_rom_not_selected), Toast.LENGTH_LONG).show(); Toast.makeText(getActivity(), getString(R.string.main_activity_toast_rom_not_selected), Toast.LENGTH_LONG).show();
return; return;

View file

@ -49,7 +49,8 @@ public class SmdFixChecksumFragment extends ActionFragment implements View.OnCli
private TextView fixChecksumInfoTextview; private TextView fixChecksumInfoTextview;
private String romPath = null; private String romPath = null;
public SmdFixChecksumFragment() {} public SmdFixChecksumFragment() {
}
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -87,7 +88,7 @@ public class SmdFixChecksumFragment extends ActionFragment implements View.OnCli
} }
private void restoreState(Bundle savedInstanceState) { private void restoreState(Bundle savedInstanceState) {
if (savedInstanceState != null){ if (savedInstanceState != null) {
romPath = savedInstanceState.getString("romPath"); romPath = savedInstanceState.getString("romPath");
if (romPath != null) if (romPath != null)
romNameTextView.setText(new File(romPath).getName()); romNameTextView.setText(new File(romPath).getName());
@ -101,7 +102,7 @@ public class SmdFixChecksumFragment extends ActionFragment implements View.OnCli
} }
@Override @Override
public void onClick(View view){ public void onClick(View view) {
Intent intent = new Intent(getActivity(), FilePickerActivity.class); Intent intent = new Intent(getActivity(), FilePickerActivity.class);
switch (view.getId()) { switch (view.getId()) {
case R.id.romCardView: case R.id.romCardView:
@ -113,7 +114,7 @@ public class SmdFixChecksumFragment extends ActionFragment implements View.OnCli
} }
@Override @Override
public void onActivityResult(int requestCode, int resultCode, Intent data){ public void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d(LOG_TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data); Log.d(LOG_TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data);
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
String path = data.getStringExtra("path"); String path = data.getStringExtra("path");
@ -134,8 +135,8 @@ public class SmdFixChecksumFragment extends ActionFragment implements View.OnCli
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
} }
public boolean runAction(){ public boolean runAction() {
if (romPath == null){ if (romPath == null) {
Toast.makeText(getActivity(), getString(R.string.main_activity_toast_rom_not_selected), Toast.LENGTH_LONG).show(); Toast.makeText(getActivity(), getString(R.string.main_activity_toast_rom_not_selected), Toast.LENGTH_LONG).show();
return false; return false;
} }
@ -145,7 +146,7 @@ public class SmdFixChecksumFragment extends ActionFragment implements View.OnCli
intent.putExtra("romPath", romPath); intent.putExtra("romPath", romPath);
getActivity().startService(intent); getActivity().startService(intent);
Toast.makeText(getActivity(), R.string.notify_smd_fix_checksum_started_check_notify,Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), R.string.notify_smd_fix_checksum_started_check_notify, Toast.LENGTH_SHORT).show();
return true; return true;
} }
} }

View file

@ -55,7 +55,8 @@ public class SnesSmcHeaderFragment extends ActionFragment implements View.OnClic
private int action = 0; private int action = 0;
public SnesSmcHeaderFragment() {} public SnesSmcHeaderFragment() {
}
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -69,7 +70,7 @@ public class SnesSmcHeaderFragment extends ActionFragment implements View.OnClic
romNameTextView = (TextView) view.findViewById(R.id.romNameTextView); romNameTextView = (TextView) view.findViewById(R.id.romNameTextView);
headerNameTextView = (TextView) view.findViewById(R.id.headerNameTextView); headerNameTextView = (TextView) view.findViewById(R.id.headerNameTextView);
headerInfoTextView = (TextView) view.findViewById(R.id.headerInfoTextView); headerInfoTextView = (TextView) view.findViewById(R.id.headerInfoTextView);
CardView romCardView = (CardView) view.findViewById(R.id.romCardView); CardView romCardView = (CardView) view.findViewById(R.id.romCardView);
romCardView.setOnClickListener(this); romCardView.setOnClickListener(this);
headerCardView = (CardView) view.findViewById(R.id.headerCardView); headerCardView = (CardView) view.findViewById(R.id.headerCardView);
@ -99,7 +100,7 @@ public class SnesSmcHeaderFragment extends ActionFragment implements View.OnClic
} }
private void restoreState(Bundle savedInstanceState) { private void restoreState(Bundle savedInstanceState) {
if (savedInstanceState != null){ if (savedInstanceState != null) {
romPath = savedInstanceState.getString("romPath"); romPath = savedInstanceState.getString("romPath");
headerPath = savedInstanceState.getString("headerPath"); headerPath = savedInstanceState.getString("headerPath");
action = savedInstanceState.getInt("action"); action = savedInstanceState.getInt("action");
@ -126,7 +127,7 @@ public class SnesSmcHeaderFragment extends ActionFragment implements View.OnClic
} }
@Override @Override
public void onClick(View view){ public void onClick(View view) {
Intent intent = new Intent(getActivity(), FilePickerActivity.class); Intent intent = new Intent(getActivity(), FilePickerActivity.class);
switch (view.getId()) { switch (view.getId()) {
case R.id.romCardView: case R.id.romCardView:
@ -142,7 +143,7 @@ public class SnesSmcHeaderFragment extends ActionFragment implements View.OnClic
} }
@Override @Override
public void onActivityResult(int requestCode, int resultCode, Intent data){ public void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d(LOG_TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data); Log.d(LOG_TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data);
if (resultCode == Activity.RESULT_OK) { if (resultCode == Activity.RESULT_OK) {
String path = data.getStringExtra("path"); String path = data.getStringExtra("path");
@ -179,8 +180,8 @@ public class SnesSmcHeaderFragment extends ActionFragment implements View.OnClic
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
} }
public boolean runAction(){ public boolean runAction() {
if (romPath == null){ if (romPath == null) {
Toast.makeText(getActivity(), getString(R.string.main_activity_toast_rom_not_selected), Toast.LENGTH_LONG).show(); Toast.makeText(getActivity(), getString(R.string.main_activity_toast_rom_not_selected), Toast.LENGTH_LONG).show();
return false; return false;
} }

View file

@ -68,6 +68,7 @@ public abstract class Notify {
} }
public abstract void setCompleted(); public abstract void setCompleted();
public abstract void setFailed(String message); public abstract void setFailed(String message);
public void setProgress(boolean isEnabled) { public void setProgress(boolean isEnabled) {

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" <set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator"> android:interpolator="@android:anim/decelerate_interpolator">
<translate <translate
android:duration="500"
android:fromYDelta="100%" android:fromYDelta="100%"
android:toYDelta="0" android:toYDelta="0"/>
android:duration="500" />
</set> </set>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -17,7 +18,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.NoActionBar.PopupOverlay" /> app:popupTheme="@style/AppTheme.NoActionBar.PopupOverlay"/>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
@ -25,6 +26,6 @@
android:id="@+id/donate_fragment" android:id="@+id/donate_fragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>

View file

@ -6,18 +6,19 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
tools:context=".ui.activity.FilePickerActivity"> tools:context=".ui.activity.FilePickerActivity">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/appbar"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<include layout="@layout/toolbar" /> <include layout="@layout/toolbar"/>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
@ -26,12 +27,12 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/appbar" android:layout_below="@id/appbar"
android:layout_margin="@dimen/activity_horizontal_margin"
android:gravity="center" android:gravity="center"
android:includeFontPadding="false" android:includeFontPadding="false"
android:layout_margin="@dimen/activity_horizontal_margin" android:text="@string/permissions_storage_error_info"
android:visibility="gone"
android:textStyle="bold" android:textStyle="bold"
android:text="@string/permissions_storage_error_info" /> android:visibility="gone"/>
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/list" android:id="@+id/list"

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -18,14 +19,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
<android.support.design.widget.TabLayout <android.support.design.widget.TabLayout
android:id="@+id/tab_layout" android:id="@+id/tab_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize" /> android:minHeight="?attr/actionBarSize"/>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
@ -33,6 +34,6 @@
android:id="@+id/pager" android:id="@+id/pager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>

View file

@ -19,7 +19,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<include layout="@layout/toolbar" /> <include layout="@layout/toolbar"/>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
@ -36,7 +36,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
android:src="@drawable/ic_save_white_24dp" /> android:src="@drawable/ic_save_white_24dp"/>
</android.support.design.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>
@ -47,8 +47,8 @@
android:layout_gravity="start" android:layout_gravity="start"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main" app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" app:itemIconTint="@color/colorDrawerText"
app:itemTextColor="@color/colorDrawerText" app:itemTextColor="@color/colorDrawerText"
app:itemIconTint="@color/colorDrawerText" /> app:menu="@menu/activity_main_drawer"/>
</android.support.v4.widget.DrawerLayout> </android.support.v4.widget.DrawerLayout>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -17,7 +18,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.NoActionBar.PopupOverlay" /> app:popupTheme="@style/AppTheme.NoActionBar.PopupOverlay"/>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>

View file

@ -1,41 +1,42 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" > android:layout_height="wrap_content">
<RelativeLayout <RelativeLayout
android:id="@+id/item_layout" android:id="@+id/item_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" > android:layout_height="wrap_content">
<ImageView <ImageView
android:id="@+id/row_image" android:id="@+id/row_image"
android:contentDescription="@string/icon" android:layout_width="wrap_content"
android:layout_alignParentLeft="true" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_alignParentLeft="true"
android:layout_height="wrap_content" android:layout_marginBottom="8dp"
android:layout_marginTop="8dp" android:layout_marginLeft="@dimen/keyline_one"
android:layout_marginBottom="8dp" android:layout_marginTop="8dp"
android:layout_marginLeft="@dimen/keyline_one"> android:contentDescription="@string/icon">
</ImageView> </ImageView>
<TextView <TextView
android:id="@+id/row_text" android:id="@+id/row_text"
android:layout_alignParentLeft="true" android:layout_width="wrap_content"
android:layout_centerVertical="true" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_alignParentLeft="true"
android:layout_height="wrap_content" android:layout_centerVertical="true"
android:layout_marginTop="8dp" android:layout_marginBottom="8dp"
android:layout_marginBottom="8dp" android:layout_marginLeft="@dimen/keyline_two"
android:layout_marginLeft="@dimen/keyline_two" android:layout_marginRight="@dimen/keyline_one"
android:layout_marginRight="@dimen/keyline_one" android:layout_marginTop="8dp"
android:textSize="20sp"> android:textSize="20sp">
</TextView> </TextView>
</RelativeLayout> </RelativeLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?android:attr/selectableItemBackground" /> android:background="?android:attr/selectableItemBackground"/>
</FrameLayout> </FrameLayout>

View file

@ -1,4 +1,6 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -19,13 +21,13 @@
<ImageView <ImageView
android:id="@+id/appIcon" android:id="@+id/appIcon"
android:layout_width="64dp" android:layout_width="64dp"
android:layout_height="64dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
android:src="@mipmap/ic_launcher"
android:contentDescription="@string/app_name"
android:adjustViewBounds="false" android:adjustViewBounds="false"
android:contentDescription="@string/app_name"
android:cropToPadding="false" android:cropToPadding="false"
android:layout_height="64dp" /> android:src="@mipmap/ic_launcher"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -46,10 +48,10 @@
android:text="@string/help_activity_about_tab_version"/> android:text="@string/help_activity_about_tab_version"/>
<TextView <TextView
android:text="@string/help_activity_about_tab_license" android:id="@+id/textView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/textView" /> android:text="@string/help_activity_about_tab_license"/>
<TextView <TextView
android:id="@+id/copyright" android:id="@+id/copyright"
@ -65,7 +67,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:textAppearance="@android:style/TextAppearance.Small" /> android:textAppearance="@android:style/TextAppearance.Small"/>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

View file

@ -1,4 +1,6 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -13,7 +15,7 @@
android:id="@+id/changelogText" android:id="@+id/changelogText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="@android:style/TextAppearance.Small" /> android:textAppearance="@android:style/TextAppearance.Small"/>
</FrameLayout> </FrameLayout>
</ScrollView> </ScrollView>

View file

@ -1,4 +1,6 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -13,7 +15,7 @@
android:id="@+id/faqText" android:id="@+id/faqText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAppearance="@android:style/TextAppearance.Small" /> android:textAppearance="@android:style/TextAppearance.Small"/>
</FrameLayout> </FrameLayout>
</ScrollView> </ScrollView>

View file

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" > android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -11,19 +12,19 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/name_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingRight="8dp" android:paddingRight="8dp"
android:text="@string/file_properties_dialog_name" android:text="@string/file_properties_dialog_name"
android:id="@+id/name_label" android:textSize="@dimen/material_text_subhead"/>
android:textSize="@dimen/material_text_subhead" />
<TextView <TextView
android:id="@+id/name_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/name_value" android:textIsSelectable="true"
android:textSize="@dimen/material_text_subhead" android:textSize="@dimen/material_text_subhead"/>
android:textIsSelectable="true" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -33,19 +34,19 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/path_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingRight="8dp" android:paddingRight="8dp"
android:text="@string/file_properties_dialog_path" android:text="@string/file_properties_dialog_path"
android:id="@+id/path_label" android:textSize="@dimen/material_text_subhead"/>
android:textSize="@dimen/material_text_subhead" />
<TextView <TextView
android:id="@+id/path_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/path_value" android:textIsSelectable="true"
android:textSize="@dimen/material_text_subhead" android:textSize="@dimen/material_text_subhead"/>
android:textIsSelectable="true" />
</LinearLayout> </LinearLayout>
@ -56,19 +57,19 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/size_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingRight="8dp" android:paddingRight="8dp"
android:text="@string/file_properties_dialog_size" android:text="@string/file_properties_dialog_size"
android:id="@+id/size_label" android:textSize="@dimen/material_text_subhead"/>
android:textSize="@dimen/material_text_subhead" />
<TextView <TextView
android:id="@+id/size_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/size_value" android:textIsSelectable="true"
android:textSize="@dimen/material_text_subhead" android:textSize="@dimen/material_text_subhead"/>
android:textIsSelectable="true" />
</LinearLayout> </LinearLayout>
@ -79,20 +80,20 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/crc32_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingRight="8dp" android:paddingRight="8dp"
android:text="@string/file_properties_dialog_crc32" android:text="@string/file_properties_dialog_crc32"
android:id="@+id/crc32_label" android:textSize="@dimen/material_text_subhead"/>
android:textSize="@dimen/material_text_subhead" />
<TextView <TextView
android:id="@+id/crc32_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/file_properties_dialog_wait_message" android:text="@string/file_properties_dialog_wait_message"
android:id="@+id/crc32_value" android:textIsSelectable="true"
android:textSize="@dimen/material_text_subhead" android:textSize="@dimen/material_text_subhead"/>
android:textIsSelectable="true" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -102,20 +103,20 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/SHA1_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingRight="8dp" android:paddingRight="8dp"
android:text="@string/file_properties_dialog_sha1" android:text="@string/file_properties_dialog_sha1"
android:id="@+id/SHA1_label" android:textSize="@dimen/material_text_subhead"/>
android:textSize="@dimen/material_text_subhead" />
<TextView <TextView
android:id="@+id/sha1_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/file_properties_dialog_wait_message" android:text="@string/file_properties_dialog_wait_message"
android:id="@+id/sha1_value" android:textIsSelectable="true"
android:textSize="@dimen/material_text_subhead" android:textSize="@dimen/material_text_subhead"/>
android:textIsSelectable="true" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -124,20 +125,20 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/md5_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingRight="8dp" android:paddingRight="8dp"
android:text="@string/file_properties_dialog_md5" android:text="@string/file_properties_dialog_md5"
android:id="@+id/md5_label" android:textSize="@dimen/material_text_subhead"/>
android:textSize="@dimen/material_text_subhead" />
<TextView <TextView
android:id="@+id/md5_value"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/file_properties_dialog_wait_message" android:text="@string/file_properties_dialog_wait_message"
android:id="@+id/md5_value" android:textIsSelectable="true"
android:textSize="@dimen/material_text_subhead" android:textSize="@dimen/material_text_subhead"/>
android:textIsSelectable="true" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height" android:layout_height="@dimen/nav_header_height"
android:background="@drawable/drawer_header" android:background="@drawable/drawer_header"

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_alignParentTop="true"> android:layout_alignParentTop="true">
@ -18,30 +19,30 @@
android:padding="@dimen/card_padding"> android:padding="@dimen/card_padding">
<TextView <TextView
android:id="@+id/patchLabel"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/patchLabel"
android:padding="8dp" android:padding="8dp"
android:text="@string/main_activity_patch_file" android:text="@string/main_activity_patch_file"
android:textColor="@color/colorCardHeaderText" android:textColor="@color/colorCardHeaderText"
android:textSize="24sp"/> android:textSize="24sp"/>
<View <View
android:layout_marginTop="@dimen/card_line_margin"
android:layout_marginBottom="@dimen/card_line_margin"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/card_line_height" android:layout_height="@dimen/card_line_height"
android:layout_marginBottom="@dimen/card_line_margin"
android:layout_marginTop="@dimen/card_line_margin"
android:background="@color/colorCardLine"/> android:background="@color/colorCardLine"/>
<TextView <TextView
android:id="@+id/patchNameTextView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/patchNameTextView" android:drawableLeft="@drawable/ic_folder_grey600_24dp"
android:drawablePadding="8dp"
android:padding="8dp" android:padding="8dp"
android:text="@string/main_activity_tap_to_select" android:text="@string/main_activity_tap_to_select"
android:textSize="20sp" android:textSize="20sp"/>
android:drawableLeft="@drawable/ic_folder_grey600_24dp"
android:drawablePadding="8dp"/>
</LinearLayout> </LinearLayout>
@ -58,30 +59,30 @@
android:padding="@dimen/card_padding"> android:padding="@dimen/card_padding">
<TextView <TextView
android:id="@+id/romLabel"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/romLabel"
android:padding="8dp" android:padding="8dp"
android:text="@string/main_activity_rom_file" android:text="@string/main_activity_rom_file"
android:textColor="@color/colorCardHeaderText" android:textColor="@color/colorCardHeaderText"
android:textSize="24sp"/> android:textSize="24sp"/>
<View <View
android:layout_marginTop="@dimen/card_line_margin"
android:layout_marginBottom="@dimen/card_line_margin"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/card_line_height" android:layout_height="@dimen/card_line_height"
android:layout_marginBottom="@dimen/card_line_margin"
android:layout_marginTop="@dimen/card_line_margin"
android:background="@color/colorCardLine"/> android:background="@color/colorCardLine"/>
<TextView <TextView
android:id="@+id/romNameTextView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/romNameTextView" android:drawableLeft="@drawable/ic_folder_grey600_24dp"
android:drawablePadding="8dp"
android:padding="8dp" android:padding="8dp"
android:text="@string/main_activity_tap_to_select" android:text="@string/main_activity_tap_to_select"
android:textSize="20sp" android:textSize="20sp"/>
android:drawableLeft="@drawable/ic_folder_grey600_24dp"
android:drawablePadding="8dp"/>
</LinearLayout> </LinearLayout>
@ -98,30 +99,30 @@
android:padding="@dimen/card_padding"> android:padding="@dimen/card_padding">
<TextView <TextView
android:id="@+id/outputLabel"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/outputLabel"
android:padding="8dp" android:padding="8dp"
android:text="@string/main_activity_output_file" android:text="@string/main_activity_output_file"
android:textColor="@color/colorCardHeaderText" android:textColor="@color/colorCardHeaderText"
android:textSize="24sp"/> android:textSize="24sp"/>
<View <View
android:layout_marginTop="@dimen/card_line_margin"
android:layout_marginBottom="@dimen/card_line_margin"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/card_line_height" android:layout_height="@dimen/card_line_height"
android:layout_marginBottom="@dimen/card_line_margin"
android:layout_marginTop="@dimen/card_line_margin"
android:background="@color/colorCardLine"/> android:background="@color/colorCardLine"/>
<TextView <TextView
android:id="@+id/outputNameTextView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/outputNameTextView"
android:padding="8dp"
android:textSize="20sp"
android:text="@string/main_activity_tap_to_rename"
android:drawableLeft="@drawable/ic_edit_grey600_24dp" android:drawableLeft="@drawable/ic_edit_grey600_24dp"
android:drawablePadding="8dp"/> android:drawablePadding="8dp"
android:padding="8dp"
android:text="@string/main_activity_tap_to_rename"
android:textSize="20sp"/>
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_alignParentTop="true"> android:layout_alignParentTop="true">
@ -18,9 +19,9 @@
android:padding="@dimen/card_padding"> android:padding="@dimen/card_padding">
<TextView <TextView
android:id="@+id/romLabel"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/romLabel"
android:padding="8dp" android:padding="8dp"
android:text="@string/main_activity_rom_file" android:text="@string/main_activity_rom_file"
android:textColor="@color/colorCardHeaderText" android:textColor="@color/colorCardHeaderText"
@ -28,21 +29,21 @@
<View <View
android:id="@+id/romLine" android:id="@+id/romLine"
android:layout_marginTop="@dimen/card_line_margin"
android:layout_marginBottom="@dimen/card_line_margin"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/card_line_height" android:layout_height="@dimen/card_line_height"
android:layout_marginBottom="@dimen/card_line_margin"
android:layout_marginTop="@dimen/card_line_margin"
android:background="@color/colorCardLine"/> android:background="@color/colorCardLine"/>
<TextView <TextView
android:id="@+id/romNameTextView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/romNameTextView" android:drawableLeft="@drawable/ic_folder_grey600_24dp"
android:drawablePadding="8dp"
android:padding="8dp" android:padding="8dp"
android:text="@string/main_activity_tap_to_select" android:text="@string/main_activity_tap_to_select"
android:textSize="20sp" android:textSize="20sp"/>
android:drawableLeft="@drawable/ic_folder_grey600_24dp"
android:drawablePadding="8dp"/>
</LinearLayout> </LinearLayout>
@ -53,12 +54,12 @@
style="@style/Card"> style="@style/Card">
<TextView <TextView
android:padding="@dimen/card_padding" android:id="@+id/fixChecksumInfoTextView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/fixChecksumInfoTextView" android:padding="@dimen/card_padding"
android:textSize="16sp" android:text="@string/smd_fix_checksum_help"
android:text="@string/smd_fix_checksum_help"/> android:textSize="16sp"/>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_alignParentTop="true"> android:layout_alignParentTop="true">
@ -18,9 +19,9 @@
android:padding="@dimen/card_padding"> android:padding="@dimen/card_padding">
<TextView <TextView
android:id="@+id/romLabel"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/romLabel"
android:padding="8dp" android:padding="8dp"
android:text="@string/main_activity_rom_file" android:text="@string/main_activity_rom_file"
android:textColor="@color/colorCardHeaderText" android:textColor="@color/colorCardHeaderText"
@ -28,21 +29,21 @@
<View <View
android:id="@+id/romLine" android:id="@+id/romLine"
android:layout_marginTop="@dimen/card_line_margin"
android:layout_marginBottom="@dimen/card_line_margin"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/card_line_height" android:layout_height="@dimen/card_line_height"
android:layout_marginBottom="@dimen/card_line_margin"
android:layout_marginTop="@dimen/card_line_margin"
android:background="@color/colorCardLine"/> android:background="@color/colorCardLine"/>
<TextView <TextView
android:id="@+id/romNameTextView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/romNameTextView" android:drawableLeft="@drawable/ic_folder_grey600_24dp"
android:drawablePadding="8dp"
android:padding="8dp" android:padding="8dp"
android:text="@string/main_activity_tap_to_select" android:text="@string/main_activity_tap_to_select"
android:textSize="20sp" android:textSize="20sp"/>
android:drawableLeft="@drawable/ic_folder_grey600_24dp"
android:drawablePadding="8dp"/>
</LinearLayout> </LinearLayout>
@ -53,12 +54,12 @@
style="@style/Card"> style="@style/Card">
<TextView <TextView
android:padding="@dimen/card_padding" android:id="@+id/headerInfoTextView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/headerInfoTextView" android:padding="@dimen/card_padding"
android:textSize="16sp" android:text="@string/snes_smc_header_help"
android:text="@string/snes_smc_header_help"/> android:textSize="16sp"/>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
@ -74,9 +75,9 @@
android:padding="@dimen/card_padding"> android:padding="@dimen/card_padding">
<TextView <TextView
android:id="@+id/headerLabel"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/headerLabel"
android:padding="8dp" android:padding="8dp"
android:text="@string/main_activity_header_file" android:text="@string/main_activity_header_file"
android:textColor="@color/colorCardHeaderText" android:textColor="@color/colorCardHeaderText"
@ -84,21 +85,21 @@
<View <View
android:id="@+id/headerLine" android:id="@+id/headerLine"
android:layout_marginTop="@dimen/card_line_margin"
android:layout_marginBottom="@dimen/card_line_margin"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/card_line_height" android:layout_height="@dimen/card_line_height"
android:layout_marginBottom="@dimen/card_line_margin"
android:layout_marginTop="@dimen/card_line_margin"
android:background="@color/colorCardLine"/> android:background="@color/colorCardLine"/>
<TextView <TextView
android:id="@+id/headerNameTextView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/headerNameTextView" android:drawableLeft="@drawable/ic_folder_grey600_24dp"
android:drawablePadding="8dp"
android:padding="8dp" android:padding="8dp"
android:text="@string/main_activity_tap_to_select" android:text="@string/main_activity_tap_to_select"
android:textSize="20sp" android:textSize="20sp"/>
android:drawableLeft="@drawable/ic_folder_grey600_24dp"
android:drawablePadding="8dp"/>
</LinearLayout> </LinearLayout>

View file

@ -6,4 +6,4 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" /> app:popupTheme="@style/AppTheme.PopupOverlay"/>

View file

@ -1,17 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" <menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
tools:context=".ui.activity.HelpActivity" > tools:context=".ui.activity.HelpActivity">
<item android:id="@+id/action_send_feedback" <item
android:title="@string/help_activity_action_send_feedback" android:id="@+id/action_send_feedback"
android:orderInCategory="100" android:orderInCategory="100"
app:showAsAction="never" /> android:title="@string/help_activity_action_send_feedback"
app:showAsAction="never"/>
<item android:id="@+id/action_visit_website" <item
android:title="@string/help_activity_action_visit_site" android:id="@+id/action_visit_website"
android:orderInCategory="200" android:orderInCategory="200"
app:showAsAction="never" /> android:title="@string/help_activity_action_visit_site"
app:showAsAction="never"/>
</menu> </menu>

View file

@ -1,46 +1,46 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <menu xmlns:android="http://schemas.android.com/apk/res/android">
<group <group
android:checkableBehavior="single" android:id="@+id/grp_action"
android:id="@+id/grp_action"> android:checkableBehavior="single">
<item <item
android:id="@+id/nav_apply_patch" android:id="@+id/nav_apply_patch"
android:icon="@drawable/ic_healing_grey600_24dp" android:icon="@drawable/ic_healing_grey600_24dp"
android:title="@string/nav_apply_patch" /> android:title="@string/nav_apply_patch"/>
<item <item
android:id="@+id/nav_smd_fix_checksum" android:id="@+id/nav_smd_fix_checksum"
android:icon="@drawable/ic_fingerprint_grey600_24dp" android:icon="@drawable/ic_fingerprint_grey600_24dp"
android:title="@string/nav_smd_fix_checksum" /> android:title="@string/nav_smd_fix_checksum"/>
<item <item
android:id="@+id/nav_snes_add_del_smc_header" android:id="@+id/nav_snes_add_del_smc_header"
android:icon="@drawable/ic_content_cut_grey600_24dp" android:icon="@drawable/ic_content_cut_grey600_24dp"
android:title="@string/nav_snes_add_del_smc_header" /> android:title="@string/nav_snes_add_del_smc_header"/>
</group> </group>
<group <group
android:checkableBehavior="none" android:id="@+id/grp_other"
android:id="@+id/grp_other"> android:checkableBehavior="none">
<item <item
android:id="@+id/nav_settings" android:id="@+id/nav_settings"
android:icon="@drawable/ic_settings_grey600_24dp" android:icon="@drawable/ic_settings_grey600_24dp"
android:title="@string/nav_settings" /> android:title="@string/nav_settings"/>
<item <item
android:id="@+id/nav_rate" android:id="@+id/nav_rate"
android:icon="@drawable/ic_thumb_up_grey600_24dp" android:icon="@drawable/ic_thumb_up_grey600_24dp"
android:title="@string/nav_rate" /> android:title="@string/nav_rate"/>
<item <item
android:id="@+id/nav_donate" android:id="@+id/nav_donate"
android:icon="@drawable/ic_gift_grey600_24dp" android:icon="@drawable/ic_gift_grey600_24dp"
android:title="@string/nav_donate" /> android:title="@string/nav_donate"/>
<item <item
android:id="@+id/nav_share" android:id="@+id/nav_share"
android:icon="@drawable/ic_share_grey600_24dp" android:icon="@drawable/ic_share_grey600_24dp"
android:title="@string/nav_share" /> android:title="@string/nav_share"/>
<item <item
android:id="@+id/nav_help" android:id="@+id/nav_help"
android:icon="@drawable/ic_help_grey600_24dp" android:icon="@drawable/ic_help_grey600_24dp"
android:title="@string/nav_help" /> android:title="@string/nav_help"/>
</group> </group>
</menu> </menu>

View file

@ -38,7 +38,7 @@
<string name="file_picker_activity_title_select_patch">Seleziona il file di patch</string> <string name="file_picker_activity_title_select_patch">Seleziona il file di patch</string>
<string name="file_picker_activity_title_select_header">Scegli il file di intestazione</string> <string name="file_picker_activity_title_select_header">Scegli il file di intestazione</string>
<string name="file_picker_activity_error_unable_read_dir">Impossibile leggere la cartella %1$s</string> <string name="file_picker_activity_error_unable_read_dir">Impossibile leggere la cartella %1$s</string>
<!-- File properties dialog --> <!-- File properties dialog -->
<string name="file_properties_dialog_title">Proprietà</string> <string name="file_properties_dialog_title">Proprietà</string>
<string name="file_properties_dialog_name">Nome:</string> <string name="file_properties_dialog_name">Nome:</string>

View file

@ -38,7 +38,7 @@
<string name="file_picker_activity_title_select_patch">Wybier plik Łatki</string> <string name="file_picker_activity_title_select_patch">Wybier plik Łatki</string>
<string name="file_picker_activity_title_select_header">Wybierz plik nagłówka</string> <string name="file_picker_activity_title_select_header">Wybierz plik nagłówka</string>
<string name="file_picker_activity_error_unable_read_dir">Błędna ścieżka %1$s</string> <string name="file_picker_activity_error_unable_read_dir">Błędna ścieżka %1$s</string>
<!-- File properties dialog --> <!-- File properties dialog -->
<string name="file_properties_dialog_title">Właściwości</string> <string name="file_properties_dialog_title">Właściwości</string>
<string name="file_properties_dialog_name">Nazwa:</string> <string name="file_properties_dialog_name">Nazwa:</string>

View file

@ -38,7 +38,7 @@
<string name="file_picker_activity_title_select_patch">Выберите патч</string> <string name="file_picker_activity_title_select_patch">Выберите патч</string>
<string name="file_picker_activity_title_select_header">Выберите файл заголовка</string> <string name="file_picker_activity_title_select_header">Выберите файл заголовка</string>
<string name="file_picker_activity_error_unable_read_dir">Не удалось открыть директорию %1$s</string> <string name="file_picker_activity_error_unable_read_dir">Не удалось открыть директорию %1$s</string>
<!-- File properties dialog --> <!-- File properties dialog -->
<string name="file_properties_dialog_title">Свойства</string> <string name="file_properties_dialog_title">Свойства</string>
<string name="file_properties_dialog_name">Имя:</string> <string name="file_properties_dialog_name">Имя:</string>

View file

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml <!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This (such as screen margins) for screens with more than 820dp of available width. This

View file

@ -38,7 +38,7 @@
<string name="file_picker_activity_title_select_patch">Select the patch file</string> <string name="file_picker_activity_title_select_patch">Select the patch file</string>
<string name="file_picker_activity_title_select_header">Select the header file</string> <string name="file_picker_activity_title_select_header">Select the header file</string>
<string name="file_picker_activity_error_unable_read_dir">Unable to read directory %1$s</string> <string name="file_picker_activity_error_unable_read_dir">Unable to read directory %1$s</string>
<!-- File properties dialog --> <!-- File properties dialog -->
<string name="file_properties_dialog_title">Properties</string> <string name="file_properties_dialog_title">Properties</string>
<string name="file_properties_dialog_name">Name:</string> <string name="file_properties_dialog_name">Name:</string>

View file

@ -15,9 +15,9 @@
<item name="windowNoTitle">true</item> <item name="windowNoTitle">true</item>
</style> </style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
<style name="CardsHolder"> <style name="CardsHolder">
<item name="android:orientation">vertical</item> <item name="android:orientation">vertical</item>
@ -44,9 +44,9 @@
<item name="android:foreground">?attr/selectableItemBackground</item> <item name="android:foreground">?attr/selectableItemBackground</item>
</style> </style>
<style name="AppTheme.NoActionBar.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> <style name="AppTheme.NoActionBar.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.NoActionBar.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> <style name="AppTheme.NoActionBar.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
<style name="PreferenceTheme" parent="AppTheme.NoActionBar"> <style name="PreferenceTheme" parent="AppTheme.NoActionBar">
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item> <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>

View file

@ -2,35 +2,35 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/settings_interface_header"> <PreferenceCategory android:title="@string/settings_interface_header">
<ListPreference <ListPreference
android:key="theme" android:defaultValue="light"
android:title="@string/settings_theme"
android:summary="@string/settings_theme_description"
android:dialogTitle="@string/settings_theme_dialog_title" android:dialogTitle="@string/settings_theme_dialog_title"
android:entries="@array/theme_names" android:entries="@array/theme_names"
android:entryValues="@array/theme_values" android:entryValues="@array/theme_values"
android:defaultValue="light" /> android:key="theme"
android:summary="@string/settings_theme_description"
android:title="@string/settings_theme"/>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/settings_directories_header"> <PreferenceCategory android:title="@string/settings_directories_header">
<CheckBoxPreference <CheckBoxPreference
android:key="remember_last_directories"
android:defaultValue="true" android:defaultValue="true"
android:disableDependentsState="true" android:disableDependentsState="true"
android:title="@string/settings_remember_last_directories" /> android:key="remember_last_directories"
android:title="@string/settings_remember_last_directories"/>
<EditTextPreference <EditTextPreference
android:defaultValue="/"
android:dependency="remember_last_directories" android:dependency="remember_last_directories"
android:key="rom_directory" android:key="rom_directory"
android:title="@string/settings_rom_directory" android:title="@string/settings_rom_directory"/>
android:defaultValue="/" />
<EditTextPreference <EditTextPreference
android:defaultValue="/"
android:dependency="remember_last_directories" android:dependency="remember_last_directories"
android:key="patch_directory" android:key="patch_directory"
android:title="@string/settings_patch_directory" android:title="@string/settings_patch_directory"/>
android:defaultValue="/" />
<EditTextPreference <EditTextPreference
android:defaultValue=""
android:key="output_directory" android:key="output_directory"
android:title="@string/settings_output_directory"
android:summary="@string/settings_output_directory_description" android:summary="@string/settings_output_directory_description"
android:defaultValue="" /> android:title="@string/settings_output_directory"/>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>