Compare commits

...

6 Commits

7 changed files with 57 additions and 32 deletions

View File

@@ -7,7 +7,7 @@ repositories {
android {
compileSdkVersion 28
defaultConfig {
versionCode 4745264
versionCode 4745266
versionName "$I2P_VERSION"
minSdkVersion 14
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION as String)

View File

@@ -59,6 +59,7 @@ class InitActivities {
}
void initialize() {
Util.i("Initializing the I2P resources");
if (checkNewVersion()) {
List<Properties> lProps = Util.getPropertiesFromPreferences(ctx);
@@ -131,9 +132,9 @@ class InitActivities {
File certDir = new File(myDir, "certificates");
certDir.mkdir();
File certificates = new File(myDir, "certificates");
File[] allcertificates = certificates.listFiles();
if ( allcertificates != null) {
for (File f : allcertificates) {
File[] allCertificates = certificates.listFiles();
if ( allCertificates != null) {
for (File f : allCertificates) {
Util.d("Deleting old certificate file/dir " + f);
FileUtil.rmdir(f, false);
}
@@ -178,10 +179,16 @@ class InitActivities {
out.write(buf, 0, read);
} catch (IOException ioe) {
Util.e("copyResourceToFile" + "IOE: ", ioe);
} catch (Resources.NotFoundException nfe) {
Util.e("copyResourceToFile" + "NFE: ", nfe);
} finally {
if (in != null) try { in.close(); } catch (IOException ioe) {}
if (out != null) try { out.close(); } catch (IOException ioe) {}
if (in != null) try { in.close(); } catch (IOException ioe) {
Util.e("copyResourceToFile" + "IOE in.close(): ", ioe);
}
if (out != null) try { out.close(); } catch (IOException ioe) {
Util.e("copyResourceToFile" + "IOE out.close(): ", ioe);
}
}
}
/**
@@ -192,7 +199,7 @@ class InitActivities {
FileOutputStream out = null;
ZipInputStream zis = null;
Util.d("Creating files in '" + myDir + "/" + folder + "/' from resource");
Util.i("Creating files in '" + myDir + "/" + folder + "/' from resource");
try {
// Context methods
in = ctx.getResources().openRawResource(resID);
@@ -209,26 +216,48 @@ class InitActivities {
}
String name = ze.getName();
File f = new File(myDir + "/" + folder +"/" + name);
if (ze.isDirectory()) {
Util.d("Creating directory " + myDir + "/" + folder +"/" + name + " from resource");
String canonicalPath = f.getCanonicalPath().replace("/user/0/", "/data/");
// account for canonical path differences when using .aab bundles
if (!canonicalPath.startsWith(myDir.replace("/user/0/", "/data/"))) {
// If these don't match, there's a path-traversal possibility.
// So ignore it.
Util.e("Path mismatch bug " + canonicalPath.toString() + " " + myDir.toString());
} else if (ze.isDirectory()) {
Util.i("Creating directory " + myDir + "/" + folder +"/" + name + " from resource");
f.mkdir();
} else {
Util.d("Creating file " + myDir + "/" + folder +"/" + name + " from resource");
Util.i("Creating file " + myDir + "/" + folder +"/" + name + " from resource");
byte[] bytes = baos.toByteArray();
out = new FileOutputStream(f);
out.write(bytes);
}
} catch (IOException ioe) {
Util.e("unzipResourceToDir" + "IOE: ", ioe);
} finally {
if (out != null) { try { out.close(); } catch (IOException ioe) {} out = null; }
if (out != null) {
try {
out.close();
} catch (IOException ioe) {
Util.e("unzipResourceToDir" + "IOE: interior out.close ", ioe);
}
out = null;
}
}
}
} catch (IOException ioe) {
Util.e("unzipResourceToDir" + "IOE: ", ioe);
} catch (Resources.NotFoundException nfe) {
Util.e("unzipResourceToDir" + "NFE: ", nfe);
} finally {
if (in != null) try { in.close(); } catch (IOException ioe) {}
if (out != null) try { out.close(); } catch (IOException ioe) {}
if (zis != null) try { zis.close(); } catch (IOException ioe) {}
if (in != null) try { in.close(); } catch (IOException ioe) {
Util.e("unzipResourceToDir" + "IOE: in.close() ", ioe);
}
if (out != null) try { out.close(); } catch (IOException ioe) {
Util.e("unzipResourceToDir" + "IOE: out.close() ", ioe);
}
if (zis != null) try { zis.close(); } catch (IOException ioe) {
Util.e("unzipResourceToDir" + "IOE: zis.close() ", ioe);
}
}
}

View File

@@ -25,16 +25,16 @@ public class AboutDialog extends DialogFragment {
View view = li.inflate(R.layout.fragment_dialog_about, null);
final String currentVersion = Util.getOurVersion(getActivity());
TextView tv = (TextView)view.findViewById(R.id.about_version);
TextView tv = (TextView) view.findViewById(R.id.about_version);
tv.setText(currentVersion);
tv = (TextView)view.findViewById(R.id.url_project);
tv = (TextView) view.findViewById(R.id.url_project);
Linkify.addLinks(tv, I2Patterns.I2P_WEB_URL, "http://");
tv = (TextView)view.findViewById(R.id.url_android_bugs);
tv = (TextView) view.findViewById(R.id.url_android_bugs);
Linkify.addLinks(tv, I2Patterns.I2P_WEB_URL, "http://");
tv = (TextView)view.findViewById(R.id.url_android_volunteer);
tv = (TextView) view.findViewById(R.id.url_android_volunteer);
Linkify.addLinks(tv, I2Patterns.I2P_WEB_URL, "http://");
tv = (TextView)view.findViewById(R.id.url_donate);
tv = (TextView) view.findViewById(R.id.url_gitlab);
Linkify.addLinks(tv, I2Patterns.I2P_WEB_URL, "http://");
AlertDialog.Builder b = new AlertDialog.Builder(getActivity());

View File

@@ -64,13 +64,13 @@
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/about_donate" />
android:text="@string/about_gitlab" />
<TextView
android:id="@+id/url_donate"
android:id="@+id/url_gitlab"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/url_donate" />
android:text="@string/url_gitlab" />
</LinearLayout>

View File

@@ -156,12 +156,8 @@ href="git.idk.i2p/i2p-hackers/i2p.i2p/-/commits/master" target="_blank">git.idk.
</li>
<li class="tidylist"><b>Get Involved!</b><br>I2P is developed and maintained
mostly through unfunded, voluntary participation by community members. We're
happy to accept <a href="http://i2p-projekt.i2p/donate.html"
target="_blank">donations</a>, which go into essential hosting and
administrative costs. We have <a href="http://i2p-projekt.i2p/bounties.html"
target="_blank">cash bounties</a> for aspects of I2P for developers looking for
incentives to participate, and we're always looking for more <a
mostly through unfunded, voluntary participation by community members. We're
always looking for more <a
href="http://i2p-projekt.i2p/newdevelopers.html" target="_blank">Java coders</a>,
<a href="http://i2p-projekt.i2p/newtranslators.html"
target="_blank">translators</a>, promoters and users to help I2P grow. The

View File

@@ -216,8 +216,8 @@
<string name="url_android_forum" translatable="false">http://zzz.i2p/forums/17</string>
<string name="about_helpwanted">Help Wanted!</string>
<string name="about_volunteer">Want to help make the app better? Volunteer on the Android forum:</string>
<string name="about_donate">Want to donate money or bitcoins to buy more Android devices for development and testing? Go to:</string>
<string name="url_donate" translatable="false">https://geti2p.net/en/donate | http://i2p-projekt.i2p/en/donate</string>
<string name="about_gitlab">Want to suggest a feature or fix a bug? make a Merge Request on the Android Gitlab:</string>
<string name="url_gitlab" translatable="false">https://i2pgit.org/i2p-hackers/i2p.android.base | http://git.idk.i2p/i2p-hackers/i2p.android.base</string>
<string name="menu_help">Help</string>
<string name="general">General</string>

View File

@@ -14,7 +14,7 @@ POM_DEVELOPER_ID=idk
POM_DEVELOPER_NAME=idk
POM_DEVELOPER_EMAIL=hankhill19580@gmail.com
ANDROID_BUILD_TARGET_SDK_VERSION=29
ANDROID_BUILD_TARGET_SDK_VERSION=30
ANDROID_BUILD_SDK_VERSION=28
I2P_VERSION=1.6.0
I2P_VERSION=1.7.0