Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="55"
android:versionName="3.0.5">
android:versionCode="56"
android:versionName="3.0.6">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,18 @@ public static boolean installSamples( Context context) {
while((ze = zin.getNextEntry()) != null) {
Log.v("MicroBit", "Unzipping " + ze.getName());

File f = projectFile(context, ze.getName());
if (!f.getCanonicalPath().startsWith(projectRoot(context).getCanonicalPath())) {
// Skip file with unexpected directory
continue;
}

if (ze.isDirectory()) {
File f = projectFile( context, ze.getName());
if ( !f.isDirectory()) {
f.mkdirs();
}
} else {
FileOutputStream fout = new FileOutputStream( projectFile( context, ze.getName()));
FileOutputStream fout = new FileOutputStream(f);
BufferedOutputStream bufout = new BufferedOutputStream(fout);
byte[] buffer = new byte[1024];
int read = 0;
Expand Down