Skip to content

Commit 2d47f44

Browse files
committed
Include the prototype/explansion/zip packages with Ren'Py for now.
These were from https://github.com/danikula/Google-Play-Expansion-File, and hosted on bintray, which is now down. This lets us keep building for Android until we can move to asset delivery in the next release.
1 parent c0f9767 commit 2d47f44

File tree

59 files changed

+9587
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+9587
-7
lines changed

rapt/prototype/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ allprojects {
2020
repositories {
2121
google()
2222
jcenter()
23-
maven { url 'https://dl.bintray.com/alexeydanilov/apk-expansion' }
2423
}
2524

2625
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion 29
5+
6+
useLibrary 'org.apache.http.legacy'
7+
8+
defaultConfig {
9+
minSdkVersion 19
10+
targetSdkVersion 29
11+
versionCode 2
12+
versionName '1.3.3'
13+
}
14+
15+
lintOptions {
16+
abortOnError false
17+
}
18+
}
19+
20+
dependencies {
21+
api project (':license')
22+
api project (':zip')
23+
compile 'org.slf4j:slf4j-api:1.7.7'
24+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.android.vending.expansion.downloader"
4+
android:versionCode="2"
5+
android:versionName="1.1" >
6+
7+
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="22"/>
8+
9+
</manifest>
Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
/*
2+
* Copyright (C) 2012 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.android.vending.expansion.downloader;
18+
19+
import java.io.File;
20+
21+
22+
/**
23+
* Contains the internal constants that are used in the download manager.
24+
* As a general rule, modifying these constants should be done with care.
25+
*/
26+
public class Constants {
27+
/** Tag used for debugging/logging */
28+
public static final String TAG = "LVLDL";
29+
30+
/**
31+
* Expansion path where we store obb files
32+
*/
33+
public static final String EXP_PATH = File.separator + "Android"
34+
+ File.separator + "obb" + File.separator;
35+
36+
// save to private app's data on Android 6.0 to skip requesting permission.
37+
public static final String EXP_PATH_API23 = File.separator + "Android"
38+
+ File.separator + "data" + File.separator;
39+
40+
/** The intent that gets sent when the service must wake up for a retry */
41+
public static final String ACTION_RETRY = "android.intent.action.DOWNLOAD_WAKEUP";
42+
43+
/** the intent that gets sent when clicking a successful download */
44+
public static final String ACTION_OPEN = "android.intent.action.DOWNLOAD_OPEN";
45+
46+
/** the intent that gets sent when clicking an incomplete/failed download */
47+
public static final String ACTION_LIST = "android.intent.action.DOWNLOAD_LIST";
48+
49+
/** the intent that gets sent when deleting the notification of a completed download */
50+
public static final String ACTION_HIDE = "android.intent.action.DOWNLOAD_HIDE";
51+
52+
/**
53+
* When a number has to be appended to the filename, this string is used to separate the
54+
* base filename from the sequence number
55+
*/
56+
public static final String FILENAME_SEQUENCE_SEPARATOR = "-";
57+
58+
/** The default user agent used for downloads */
59+
public static final String DEFAULT_USER_AGENT = "Android.LVLDM";
60+
61+
/** The buffer size used to stream the data */
62+
public static final int BUFFER_SIZE = 4096;
63+
64+
/** The minimum amount of progress that has to be done before the progress bar gets updated */
65+
public static final int MIN_PROGRESS_STEP = 4096;
66+
67+
/** The minimum amount of time that has to elapse before the progress bar gets updated, in ms */
68+
public static final long MIN_PROGRESS_TIME = 1000;
69+
70+
/** The maximum number of rows in the database (FIFO) */
71+
public static final int MAX_DOWNLOADS = 1000;
72+
73+
/**
74+
* The number of times that the download manager will retry its network
75+
* operations when no progress is happening before it gives up.
76+
*/
77+
public static final int MAX_RETRIES = 5;
78+
79+
/**
80+
* The minimum amount of time that the download manager accepts for
81+
* a Retry-After response header with a parameter in delta-seconds.
82+
*/
83+
public static final int MIN_RETRY_AFTER = 30; // 30s
84+
85+
/**
86+
* The maximum amount of time that the download manager accepts for
87+
* a Retry-After response header with a parameter in delta-seconds.
88+
*/
89+
public static final int MAX_RETRY_AFTER = 24 * 60 * 60; // 24h
90+
91+
/**
92+
* The maximum number of redirects.
93+
*/
94+
public static final int MAX_REDIRECTS = 10;
95+
96+
/**
97+
* The time between a failure and the first retry after an IOException.
98+
* Each subsequent retry grows exponentially, doubling each time.
99+
* The time is in seconds.
100+
*/
101+
public static final int RETRY_FIRST_DELAY = 30;
102+
103+
/** Enable separate connectivity logging */
104+
public static final boolean LOGX = true;
105+
106+
/** Enable verbose logging */
107+
public static final boolean LOGV = false;
108+
109+
/** Enable super-verbose logging */
110+
private static final boolean LOCAL_LOGVV = false;
111+
public static final boolean LOGVV = LOCAL_LOGVV && LOGV;
112+
113+
/**
114+
* This download has successfully completed.
115+
* Warning: there might be other status values that indicate success
116+
* in the future.
117+
* Use isSucccess() to capture the entire category.
118+
*/
119+
public static final int STATUS_SUCCESS = 200;
120+
121+
/**
122+
* This request couldn't be parsed. This is also used when processing
123+
* requests with unknown/unsupported URI schemes.
124+
*/
125+
public static final int STATUS_BAD_REQUEST = 400;
126+
127+
/**
128+
* This download can't be performed because the content type cannot be
129+
* handled.
130+
*/
131+
public static final int STATUS_NOT_ACCEPTABLE = 406;
132+
133+
/**
134+
* This download cannot be performed because the length cannot be
135+
* determined accurately. This is the code for the HTTP error "Length
136+
* Required", which is typically used when making requests that require
137+
* a content length but don't have one, and it is also used in the
138+
* client when a response is received whose length cannot be determined
139+
* accurately (therefore making it impossible to know when a download
140+
* completes).
141+
*/
142+
public static final int STATUS_LENGTH_REQUIRED = 411;
143+
144+
/**
145+
* This download was interrupted and cannot be resumed.
146+
* This is the code for the HTTP error "Precondition Failed", and it is
147+
* also used in situations where the client doesn't have an ETag at all.
148+
*/
149+
public static final int STATUS_PRECONDITION_FAILED = 412;
150+
151+
/**
152+
* The lowest-valued error status that is not an actual HTTP status code.
153+
*/
154+
public static final int MIN_ARTIFICIAL_ERROR_STATUS = 488;
155+
156+
/**
157+
* The requested destination file already exists.
158+
*/
159+
public static final int STATUS_FILE_ALREADY_EXISTS_ERROR = 488;
160+
161+
/**
162+
* Some possibly transient error occurred, but we can't resume the download.
163+
*/
164+
public static final int STATUS_CANNOT_RESUME = 489;
165+
166+
/**
167+
* This download was canceled
168+
*/
169+
public static final int STATUS_CANCELED = 490;
170+
171+
/**
172+
* This download has completed with an error.
173+
* Warning: there will be other status values that indicate errors in
174+
* the future. Use isStatusError() to capture the entire category.
175+
*/
176+
public static final int STATUS_UNKNOWN_ERROR = 491;
177+
178+
/**
179+
* This download couldn't be completed because of a storage issue.
180+
* Typically, that's because the filesystem is missing or full.
181+
* Use the more specific {@link #STATUS_INSUFFICIENT_SPACE_ERROR}
182+
* and {@link #STATUS_DEVICE_NOT_FOUND_ERROR} when appropriate.
183+
*/
184+
public static final int STATUS_FILE_ERROR = 492;
185+
186+
/**
187+
* This download couldn't be completed because of an HTTP
188+
* redirect response that the download manager couldn't
189+
* handle.
190+
*/
191+
public static final int STATUS_UNHANDLED_REDIRECT = 493;
192+
193+
/**
194+
* This download couldn't be completed because of an
195+
* unspecified unhandled HTTP code.
196+
*/
197+
public static final int STATUS_UNHANDLED_HTTP_CODE = 494;
198+
199+
/**
200+
* This download couldn't be completed because of an
201+
* error receiving or processing data at the HTTP level.
202+
*/
203+
public static final int STATUS_HTTP_DATA_ERROR = 495;
204+
205+
/**
206+
* This download couldn't be completed because of an
207+
* HttpException while setting up the request.
208+
*/
209+
public static final int STATUS_HTTP_EXCEPTION = 496;
210+
211+
/**
212+
* This download couldn't be completed because there were
213+
* too many redirects.
214+
*/
215+
public static final int STATUS_TOO_MANY_REDIRECTS = 497;
216+
217+
/**
218+
* This download couldn't be completed due to insufficient storage
219+
* space. Typically, this is because the SD card is full.
220+
*/
221+
public static final int STATUS_INSUFFICIENT_SPACE_ERROR = 498;
222+
223+
/**
224+
* This download couldn't be completed because no external storage
225+
* device was found. Typically, this is because the SD card is not
226+
* mounted.
227+
*/
228+
public static final int STATUS_DEVICE_NOT_FOUND_ERROR = 499;
229+
230+
/**
231+
* The wake duration to check to see if a download is possible.
232+
*/
233+
public static final long WATCHDOG_WAKE_TIMER = 60*1000;
234+
235+
/**
236+
* The wake duration to check to see if the process was killed.
237+
*/
238+
public static final long ACTIVE_THREAD_WATCHDOG = 5*1000;
239+
240+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* Copyright (C) 2012 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.android.vending.expansion.downloader;
18+
19+
import android.os.Parcel;
20+
import android.os.Parcelable;
21+
22+
23+
/**
24+
* This class contains progress information about the active download(s).
25+
*
26+
* When you build the Activity that initiates a download and tracks the
27+
* progress by implementing the {@link IDownloaderClient} interface, you'll
28+
* receive a DownloadProgressInfo object in each call to the {@link
29+
* IDownloaderClient#onDownloadProgress} method. This allows you to update
30+
* your activity's UI with information about the download progress, such
31+
* as the progress so far, time remaining and current speed.
32+
*/
33+
public class DownloadProgressInfo implements Parcelable {
34+
public long mOverallTotal;
35+
public long mOverallProgress;
36+
public long mTimeRemaining; // time remaining
37+
public float mCurrentSpeed; // speed in KB/S
38+
39+
@Override
40+
public int describeContents() {
41+
return 0;
42+
}
43+
44+
@Override
45+
public void writeToParcel(Parcel p, int i) {
46+
p.writeLong(mOverallTotal);
47+
p.writeLong(mOverallProgress);
48+
p.writeLong(mTimeRemaining);
49+
p.writeFloat(mCurrentSpeed);
50+
}
51+
52+
public DownloadProgressInfo(Parcel p) {
53+
mOverallTotal = p.readLong();
54+
mOverallProgress = p.readLong();
55+
mTimeRemaining = p.readLong();
56+
mCurrentSpeed = p.readFloat();
57+
}
58+
59+
public DownloadProgressInfo(long overallTotal, long overallProgress,
60+
long timeRemaining,
61+
float currentSpeed) {
62+
this.mOverallTotal = overallTotal;
63+
this.mOverallProgress = overallProgress;
64+
this.mTimeRemaining = timeRemaining;
65+
this.mCurrentSpeed = currentSpeed;
66+
}
67+
68+
public static final Creator<DownloadProgressInfo> CREATOR = new Creator<DownloadProgressInfo>() {
69+
@Override
70+
public DownloadProgressInfo createFromParcel(Parcel parcel) {
71+
return new DownloadProgressInfo(parcel);
72+
}
73+
74+
@Override
75+
public DownloadProgressInfo[] newArray(int i) {
76+
return new DownloadProgressInfo[i];
77+
}
78+
};
79+
80+
}

0 commit comments

Comments
 (0)