mirror of
https://github.com/playmusicexporter/playmusicexporter
synced 2024-05-14 12:46:42 +00:00
Update appcompat
Update to api 23 Update the copyright to Android Studio 1.3.x Added my own ByteBuffer (old was removed)
This commit is contained in:
parent
ce1aa10276
commit
c32918a009
6
.idea/copyright/MIT.xml
Normal file
6
.idea/copyright/MIT.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<component name="CopyrightManager">
|
||||
<copyright>
|
||||
<option name="myName" value="MIT" />
|
||||
<option name="notice" value="Copyright (c) &#36;today.year David Schulte Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." />
|
||||
</copyright>
|
||||
</component>
|
|
@ -1,15 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="appcompat-v7-22.1.1">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$PROJECT_DIR$/framework/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.1.1/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/framework/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.1.1/res" />
|
||||
<root url="jar://$PROJECT_DIR$/framework/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.1.1/classes.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/appcompat-v7/22.1.1/appcompat-v7-22.1.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
|
@ -1,15 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="appcompat-v7-22.2.1">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/res" />
|
||||
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/classes.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/appcompat-v7/22.2.1/appcompat-v7-22.2.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
10
.idea/libraries/appcompat_v7_23_0_0.xml
Normal file
10
.idea/libraries/appcompat_v7_23_0_0.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<component name="libraryTable">
|
||||
<library name="appcompat-v7-23.0.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/playmusiclib/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$PROJECT_DIR$/playmusiclib/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="design-22.2.1">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/design/22.2.1/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/design/22.2.1/res" />
|
||||
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/design/22.2.1/classes.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
10
.idea/libraries/design_23_0_0.xml
Normal file
10
.idea/libraries/design_23_0_0.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<component name="libraryTable">
|
||||
<library name="design-23.0.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/design/23.0.0/jars/classes.jar!/" />
|
||||
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/design/23.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
|
@ -1,11 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="support-annotations-22.1.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/support-annotations/22.1.1/support-annotations-22.1.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/support-annotations/22.1.1/support-annotations-22.1.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
|
@ -1,11 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="support-annotations-22.2.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/support-annotations/22.2.1/support-annotations-22.2.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/support-annotations/22.2.1/support-annotations-22.2.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
11
.idea/libraries/support_annotations_23_0_0.xml
Normal file
11
.idea/libraries/support_annotations_23_0_0.xml
Normal file
|
@ -0,0 +1,11 @@
|
|||
<component name="libraryTable">
|
||||
<library name="support-annotations-23.0.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/support-annotations/23.0.0/support-annotations-23.0.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/support-annotations/23.0.0/support-annotations-23.0.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
|
@ -1,13 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="support-v4-22.1.1">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/framework/build/intermediates/exploded-aar/com.android.support/support-v4/22.1.1/res" />
|
||||
<root url="jar://$PROJECT_DIR$/framework/build/intermediates/exploded-aar/com.android.support/support-v4/22.1.1/classes.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/framework/build/intermediates/exploded-aar/com.android.support/support-v4/22.1.1/libs/internal_impl-22.1.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/support-v4/22.1.1/support-v4-22.1.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
|
@ -1,16 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="support-v4-22.2.1">
|
||||
<ANNOTATIONS>
|
||||
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.1/annotations.zip!/" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.1/res" />
|
||||
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.1/libs/internal_impl-22.2.1.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/playmusicexporter/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.1/classes.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/android-sdks/extras/android/m2repository/com/android/support/support-v4/22.2.1/support-v4-22.2.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
11
.idea/libraries/support_v4_23_0_0.xml
Normal file
11
.idea/libraries/support_v4_23_0_0.xml
Normal file
|
@ -0,0 +1,11 @@
|
|||
<component name="libraryTable">
|
||||
<library name="support-v4-23.0.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/playmusiclib/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.0/jars/classes.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/playmusiclib/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.0/jars/libs/internal_impl-23.0.0.jar!/" />
|
||||
<root url="file://$PROJECT_DIR$/playmusiclib/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.0/res" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
|
@ -29,7 +29,7 @@ buildscript {
|
|||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.0.0'
|
||||
classpath 'com.android.tools.build:gradle:1.3.0'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 21
|
||||
buildToolsVersion "21.1.2"
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.0"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 8
|
||||
targetSdkVersion 21
|
||||
targetSdkVersion 23
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
}
|
||||
|
@ -42,5 +42,5 @@ android {
|
|||
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
compile 'com.android.support:appcompat-v7:22.1.1'
|
||||
compile 'com.android.support:appcompat-v7:23.0.0'
|
||||
}
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
|
||||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
|
||||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
|
||||
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
|
||||
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugTestSources" />
|
||||
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
|
||||
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
|
||||
<afterSyncTasks>
|
||||
<task>generateDebugAndroidTestSources</task>
|
||||
<task>generateDebugSources</task>
|
||||
<task>generateDebugTestSources</task>
|
||||
</afterSyncTasks>
|
||||
<option name="ALLOW_USER_CONFIGURATION" value="false" />
|
||||
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
|
||||
|
@ -29,7 +29,7 @@
|
|||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
|
||||
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
|
||||
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
|
||||
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
|
||||
|
@ -37,13 +37,13 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/test/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/test/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
|
||||
|
@ -87,10 +87,10 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-22.1.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-22.1.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-22.1.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-23.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-23.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" />
|
||||
</component>
|
||||
</module>
|
|
@ -22,8 +22,6 @@
|
|||
|
||||
package de.arcus.framework.superuser;
|
||||
|
||||
import org.apache.http.util.ByteArrayBuffer;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
@ -33,6 +31,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import de.arcus.framework.logger.Logger;
|
||||
import de.arcus.framework.utils.ByteBuffer;
|
||||
|
||||
/**
|
||||
* This class executes superuser commands.
|
||||
|
@ -303,7 +302,7 @@ public class SuperUserCommand {
|
|||
byte[] buffer = new byte[1024];
|
||||
|
||||
// Byte buffer
|
||||
ByteArrayBuffer byteArrayBuffer = new ByteArrayBuffer(1024);
|
||||
ByteBuffer byteBuffer = new ByteBuffer();
|
||||
|
||||
// Need the direct input stream
|
||||
InputStream inputStream = SuperUser.getProcess().getInputStream();
|
||||
|
@ -314,7 +313,7 @@ public class SuperUserCommand {
|
|||
len = inputStream.read(buffer);
|
||||
|
||||
// Write to buffer
|
||||
byteArrayBuffer.append(buffer, 0, len);
|
||||
byteBuffer.append(buffer, 0, len);
|
||||
}
|
||||
|
||||
// Fix: Wait for the buffer and try again
|
||||
|
@ -327,7 +326,7 @@ public class SuperUserCommand {
|
|||
}
|
||||
} while (bufferedInputReader.ready());
|
||||
|
||||
mOutputStandardBinary = byteArrayBuffer.toByteArray();
|
||||
mOutputStandardBinary = byteBuffer.toByteArray();
|
||||
} else {
|
||||
// Reads the standard output as text
|
||||
tmpList.clear();
|
||||
|
|
129
framework/src/main/java/de/arcus/framework/utils/ByteBuffer.java
Normal file
129
framework/src/main/java/de/arcus/framework/utils/ByteBuffer.java
Normal file
|
@ -0,0 +1,129 @@
|
|||
/*
|
||||
* Copyright (c) 2015 David Schulte
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package de.arcus.framework.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A dynamic growing byte buffer
|
||||
*/
|
||||
public class ByteBuffer {
|
||||
private int mChunkSize = 4096;
|
||||
private int mSize = 0;
|
||||
private List<byte[]> mChunks = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Creates a byte buffer
|
||||
*/
|
||||
public ByteBuffer() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a byte buffer
|
||||
* @param chunkSize Sets the chunks size
|
||||
*/
|
||||
public ByteBuffer(int chunkSize) {
|
||||
mChunkSize = chunkSize;
|
||||
}
|
||||
/**
|
||||
* @return Returns the size of the buffer
|
||||
*/
|
||||
public long size() {
|
||||
return mSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the buffer
|
||||
*/
|
||||
public void clear() {
|
||||
mSize = 0;
|
||||
mChunks.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds bytes to the buffer
|
||||
* @param bytes The bytes to add
|
||||
*/
|
||||
public void append(byte[] bytes, int offset, int length) {
|
||||
|
||||
|
||||
while(length > 0) {
|
||||
int freeSpaceInEndChunk = mChunks.size() * mChunkSize - mSize;
|
||||
int positionInEndChunk = mChunkSize - freeSpaceInEndChunk;
|
||||
|
||||
// Adds a new chunk
|
||||
if (freeSpaceInEndChunk == 0) {
|
||||
mChunks.add(new byte[mChunkSize]);
|
||||
freeSpaceInEndChunk = mChunkSize;
|
||||
positionInEndChunk = 0;
|
||||
}
|
||||
byte[] endChunk = mChunks.get(mChunks.size() - 1);
|
||||
|
||||
// We want to add more bytes the chunk can contain
|
||||
if (length > freeSpaceInEndChunk) {
|
||||
|
||||
// Copies to end of chunk
|
||||
System.arraycopy(bytes, offset, endChunk, positionInEndChunk, freeSpaceInEndChunk);
|
||||
|
||||
// Adds the size
|
||||
mSize += freeSpaceInEndChunk;
|
||||
offset += freeSpaceInEndChunk;
|
||||
length -= freeSpaceInEndChunk;
|
||||
} else {
|
||||
// Copies the rest of the data
|
||||
System.arraycopy(bytes, offset, endChunk, positionInEndChunk, length);
|
||||
|
||||
// Adds the size
|
||||
mSize += length;
|
||||
|
||||
offset += length;
|
||||
length = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the bytes as array
|
||||
*/
|
||||
public byte[] toByteArray() {
|
||||
byte[] bytes = new byte[mSize];
|
||||
|
||||
int pos = 0;
|
||||
|
||||
// Copies all chunks
|
||||
for(byte[] subBytes : mChunks) {
|
||||
int chunkSize = mChunkSize;
|
||||
// Last segment
|
||||
if (pos + chunkSize > mSize)
|
||||
chunkSize = mSize - pos;
|
||||
|
||||
// Copies the bytes
|
||||
System.arraycopy(subBytes, 0, bytes, pos, chunkSize);
|
||||
|
||||
pos += chunkSize;
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
}
|
|
@ -25,13 +25,13 @@
|
|||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 22
|
||||
buildToolsVersion "21.1.2"
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.0"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "de.arcus.playmusicexporter2"
|
||||
minSdkVersion 8
|
||||
targetSdkVersion 22
|
||||
targetSdkVersion 23
|
||||
versionCode 101
|
||||
versionName '2.4.1'
|
||||
}
|
||||
|
@ -45,9 +45,9 @@ android {
|
|||
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
compile 'com.android.support:appcompat-v7:22.2.1'
|
||||
compile 'com.android.support:support-v4:22.2.1'
|
||||
compile 'com.android.support:design:22.2.1'
|
||||
compile 'com.android.support:appcompat-v7:23.0.0'
|
||||
compile 'com.android.support:support-v4:23.0.0'
|
||||
compile 'com.android.support:design:23.0.0'
|
||||
compile project(':framework')
|
||||
compile project(':playmusiclib')
|
||||
}
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
|
||||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
|
||||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
|
||||
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
|
||||
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugTestSources" />
|
||||
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
|
||||
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
|
||||
<afterSyncTasks>
|
||||
<task>generateDebugAndroidTestSources</task>
|
||||
<task>generateDebugSources</task>
|
||||
<task>generateDebugTestSources</task>
|
||||
</afterSyncTasks>
|
||||
<option name="ALLOW_USER_CONFIGURATION" value="false" />
|
||||
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
|
||||
|
@ -28,7 +28,7 @@
|
|||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
|
||||
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
|
||||
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
|
||||
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
|
||||
|
@ -36,13 +36,13 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/test/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/test/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
|
||||
|
@ -71,6 +71,7 @@
|
|||
<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/design/23.0.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" />
|
||||
|
@ -86,12 +87,12 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" name="design-22.2.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-22.2.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-22.2.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-22.2.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="design-23.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-23.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-23.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" />
|
||||
<orderEntry type="module" module-name="playmusiclib" exported="" />
|
||||
<orderEntry type="module" module-name="framework" exported="" />
|
||||
</component>
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 22
|
||||
buildToolsVersion "21.1.2"
|
||||
compileSdkVersion 23
|
||||
buildToolsVersion "23.0.0"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 8
|
||||
targetSdkVersion 22
|
||||
targetSdkVersion 23
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
}
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
|
||||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
|
||||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
|
||||
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
|
||||
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugTestSources" />
|
||||
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
|
||||
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
|
||||
<afterSyncTasks>
|
||||
<task>generateDebugAndroidTestSources</task>
|
||||
<task>generateDebugSources</task>
|
||||
<task>generateDebugTestSources</task>
|
||||
</afterSyncTasks>
|
||||
<option name="ALLOW_USER_CONFIGURATION" value="false" />
|
||||
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
|
||||
|
@ -29,7 +29,7 @@
|
|||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
|
||||
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
|
||||
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
|
||||
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
|
||||
|
@ -37,13 +37,13 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/test/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/test/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
|
||||
|
@ -87,10 +87,10 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" name="mp3agic-0.8.4-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-22.1.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" />
|
||||
<orderEntry type="module" module-name="framework" exported="" />
|
||||
</component>
|
||||
</module>
|
|
@ -55,6 +55,7 @@ public class ArtworkLoader {
|
|||
try {
|
||||
// Load the local file
|
||||
byte[] bitmapData = SuperUserTools.fileReadToByteArray(artworkPath);
|
||||
|
||||
bitmap = ImageTools.decodeByteArraySubsampled(bitmapData, artworkSize, artworkSize);
|
||||
} catch (Exception e) {
|
||||
// Error
|
||||
|
|
Loading…
Reference in a new issue