Update AppCompat

Workaround for the Marshmallow problem (writes temp files to external storage instead of the private data)
Update binary
This commit is contained in:
David 2015-11-14 00:35:21 +01:00
parent 6e2a763494
commit e5208454e2
16 changed files with 153 additions and 45 deletions

View file

@ -1,11 +1,11 @@
<component name="libraryTable">
<library name="appcompat-v7-23.1.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/annotations.zip!/" />
<root url="jar://$PROJECT_DIR$/framework/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/res" />
<root url="file://$PROJECT_DIR$/framework/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/res" />
<root url="jar://$PROJECT_DIR$/framework/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>

View file

@ -0,0 +1,12 @@
<component name="libraryTable">
<library name="appcompat-v7-23.1.1">
<CLASSES>
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/res" />
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,15 +0,0 @@
<component name="libraryTable">
<library name="design-23.1.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/design/23.1.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/design/23.1.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/design/23.1.0/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/Android/Sdk/extras/android/m2repository/com/android/support/design/23.1.0/design-23.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,12 @@
<component name="libraryTable">
<library name="design-23.1.1">
<CLASSES>
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/design/23.1.1/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/design/23.1.1/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/Android/Sdk/extras/android/m2repository/com/android/support/design/23.1.1/design-23.1.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,15 +1,12 @@
<component name="libraryTable">
<library name="recyclerview-v7-23.1.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.0/annotations.zip!/" />
</ANNOTATIONS>
<library name="recyclerview-v7-23.1.1">
<CLASSES>
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.0/res" />
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.0/jars/classes.jar!/" />
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.1/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.1/res" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/Android/Sdk/extras/android/m2repository/com/android/support/recyclerview-v7/23.1.0/recyclerview-v7-23.1.0-sources.jar!/" />
<root url="jar://$USER_HOME$/Android/Sdk/extras/android/m2repository/com/android/support/recyclerview-v7/23.1.1/recyclerview-v7-23.1.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -0,0 +1,11 @@
<component name="libraryTable">
<library name="support-annotations-23.1.1">
<CLASSES>
<root url="jar://$USER_HOME$/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/23.1.1/support-annotations-23.1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/23.1.1/support-annotations-23.1.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,12 +1,12 @@
<component name="libraryTable">
<library name="support-v4-23.1.0">
<ANNOTATIONS>
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/annotations.zip!/" />
<root url="jar://$PROJECT_DIR$/framework/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/annotations.zip!/" />
</ANNOTATIONS>
<CLASSES>
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/res" />
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/jars/classes.jar!/" />
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/jars/libs/internal_impl-23.1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/framework/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/jars/classes.jar!/" />
<root url="file://$PROJECT_DIR$/framework/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/res" />
<root url="jar://$PROJECT_DIR$/framework/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/jars/libs/internal_impl-23.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>

View file

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="support-v4-23.1.1">
<CLASSES>
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/res" />
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars/classes.jar!/" />
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars/libs/internal_impl-23.1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/Android/Sdk/extras/android/m2repository/com/android/support/support-v4/23.1.1/support-v4-23.1.1-sources.jar!/" />
</SOURCES>
</library>
</component>

Binary file not shown.

View file

@ -72,6 +72,8 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />

View file

@ -26,14 +26,14 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "de.arcus.playmusicexporter2"
minSdkVersion 8
targetSdkVersion 23
versionCode 101
versionName '2.4.1'
versionCode 102
versionName '2.4.2'
}
buildTypes {
release {
@ -45,9 +45,9 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:support-v4:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:design:23.1.1'
compile project(':framework')
compile project(':playmusiclib')
}

View file

@ -71,10 +71,10 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
@ -92,11 +92,11 @@
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.1.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.1.0" level="project" />
<orderEntry type="library" exported="" name="design-23.1.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.1.0" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.1.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.1.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.1" level="project" />
<orderEntry type="library" exported="" name="design-23.1.1" level="project" />
<orderEntry type="module" module-name="playmusiclib" exported="" />
<orderEntry type="module" module-name="framework" exported="" />
</component>

View file

@ -22,13 +22,19 @@
package de.arcus.playmusicexporter2.activities;
import android.Manifest;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.MenuItemCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.view.Menu;
@ -93,6 +99,8 @@ public class MusicContainerListActivity extends AppCompatActivity
private SearchView mSearchView;
private static final int PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -134,6 +142,59 @@ public class MusicContainerListActivity extends AppCompatActivity
.setActivateOnItemClick(true);
}
boolean waitForPermissions = false;
// Check file system permissions
if (ContextCompat.checkSelfPermission(this,
Manifest.permission.WRITE_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE);
waitForPermissions = true;
}
if (!waitForPermissions)
loadPlayMusicExporter();
}
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
switch (requestCode) {
case PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE: {
// If request is cancelled, the result arrays are empty.
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// Continue loading
loadPlayMusicExporter();
} else {
// Shows a warning and close the app
AlertDialog.Builder builder =
new AlertDialog.Builder(this);
builder.setTitle(R.string.dialog_storage_access_denied_title);
builder.setMessage(R.string.dialog_storage_access_denied);
builder.setCancelable(false);
builder.setPositiveButton(R.string.text_okay, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// Close the app
MusicContainerListActivity.this.finish();
}
});
builder.show();
}
return;
}
}
}
/**
* Loads the PlayMusicExporter lib and shows the list
*/
private void loadPlayMusicExporter()
{
// Gets the running instance
mPlayMusicManager = PlayMusicManager.getInstance();

View file

@ -64,4 +64,6 @@
<string name="toast_error_track_not_offline">Sie können nur offline Titel exportieren. Versuchen Sie das Album in Play Music offline herunterzuladen.</string>
<string name="settings_build_date">Build date</string>
<string name="settings_category_develop">Entwicklung</string>
<string name="dialog_storage_access_denied_title">Daten-Zugriff verweigert</string>
<string name="dialog_storage_access_denied">Der PlayMusicExpoerter benötigt Schreibrechte auf der SD-Karte. Dies ist Teil des Marshmallow-Fix.\n\nBitte starten Sie die App neu und erlauben Sie die Berechtigung.</string>
</resources>

View file

@ -50,8 +50,13 @@
<string name="notification_export_finished_summery">%1$d tracks were exported successfully!</string>
<string name="notification_export_finished_single_summery">%1$s was exported successfully!</string>
<string name="dialog_storage_access_denied_title">Storage access denied</string>
<string name="dialog_storage_access_denied">The PlayMusicExporter always needs to write to the external storage. This is part of the Marshmallow fix.\n\nPlease restart the app and grant the permission.</string>
<string name="toast_error_track_not_offline">You can only export offline tracks. Try to download the album offline in Play Music.</string>
<string name="text_okay">Okay</string>
<string name="search">Search&#8230;</string>
<string name="button_export_group">Export all tracks</string>

View file

@ -144,7 +144,15 @@ public class PlayMusicManager {
* @return Gets the temp path to the exported music
*/
private String getTempPath() {
return mContext.getCacheDir().getAbsolutePath();
// Marshmallow hack
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// Use the internal storage instead
String path = Environment.getExternalStorageDirectory() + "/PlayMusicExporter/";
FileTools.directoryCreate(path);
return path;
} else {
return mContext.getCacheDir().getAbsolutePath();
}
}
/**