Skip to content

Commit

Permalink
## 4.6.0.3
Browse files Browse the repository at this point in the history
* Bug Fixes
  * migrate to the latest ukraine strings
  * free up the labels if the sensor field of view has been released.
  * do not overwrite an existing iconset blindly - clobbering users iconsets.
  * protect against a crash in certificate enrollment (Playstore Crash Log)
  * unable to reproduce crash log from a Nokia 3.1 A (Playstore Crash Log)
  * remove query all packages on the playstore publication apk
  * fix incorrect rendering of the overlayed layers on Navigation icons
  • Loading branch information
takdeveloper committed Oct 18, 2024
2 parents 44216aa + e110c30 commit fcae866
Show file tree
Hide file tree
Showing 16 changed files with 574 additions and 567 deletions.
11 changes: 11 additions & 0 deletions VERSION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Version History

## 4.6.0.3

* Bug Fixes
* migrate to the latest ukraine strings
* free up the labels if the sensor field of view has been released.
* do not overwrite an existing iconset blindly - clobbering users iconsets.
* protect against a crash in certificate enrollment (Playstore Crash Log)
* unable to reproduce crash log from a Nokia 3.1 A (Playstore Crash Log)
* remove query all packages on the playstore publication apk
* fix incorrect rendering of the overlayed layers on Navigation icons

## 4.6.0.2

* Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion atak/ATAK/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ buildscript {
apply from: '../../gradle/versions.gradle', to: project

ext.ATAK_VERSION = "4.6.0"
ext.ATAK_VERSION_SUBMINOR = ".2"
ext.ATAK_VERSION_SUBMINOR = ".3"

ext.isDevKitEnabled = { ->
return getProperty('takRepoMavenUrl', null) != null &&
Expand Down
4 changes: 4 additions & 0 deletions atak/ATAK/app/src/civSmall/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
<!-- for the civilian small version, do not include the SEND_SMS permission -->
<uses-permission android:name="android.permission.SEND_SMS" tools:node="remove"/>

<!-- for the civilian small version, do not include the QUERY_ALL_PACKAGES permission -->
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" tools:node="remove" />


</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
Expand All @@ -18,11 +17,9 @@
import com.atakmap.android.user.icon.Icon2525cPallet;
import com.atakmap.android.user.icon.SpotMapPallet;
import com.atakmap.android.user.icon.UserIconPalletFragment;
import com.atakmap.android.util.ATAKConstants;
import com.atakmap.android.util.NotificationUtil;
import com.atakmap.app.R;
import com.atakmap.coremap.filesystem.FileSystemUtils;
import com.atakmap.coremap.io.IOProvider;
import com.atakmap.coremap.io.IOProviderFactory;
import com.atakmap.coremap.locale.LocaleUtil;
import com.atakmap.coremap.log.Log;
Expand Down Expand Up @@ -75,38 +72,6 @@ public IconsMapAdapter(Context context) {
*/
public static synchronized UserIconDatabase initializeUserIconDB(
Context context, SharedPreferences prefs) {
File iconDB = new File(UserIconDatabase.DATABASE_NAME);
boolean iconDBexists = IOProviderFactory.exists(iconDB);

//check if the latest default iconset is loaded
String versionCode = String.valueOf(ATAKConstants.getVersionCode());
if (FileSystemUtils.isEmpty(versionCode))
versionCode = "unknown";

//check which default iconset is loaded (based on ATAK version)
//force load if DB does not exist
String currentVersion = prefs.getString(
"iconset.default.loaded.version", "");

if (!iconDBexists
|| !versionCode.equals(currentVersion)) {
Log.d(TAG, "Replacing iconset version: " + currentVersion);
//if the copy succeeded, make a note in the preferences
Editor editor = prefs.edit();
editor.putString("iconset.default.loaded.version", versionCode);
editor.apply();
Log.d(TAG, "Updated to iconset version: " + versionCode);

// XXX - this is not per-provider sufficient

// delete the file, this will trigger the UserIconDatabase to rebuild
IOProviderFactory.delete(new File(UserIconDatabase.DATABASE_NAME),
IOProvider.SECURE_DELETE);
} else {
Log.d(TAG,
"Already running latest iconset version: " + versionCode);
}

return UserIconDatabase.instance(context);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public GLSensorFOV(MapRenderer surface, SensorFOV subject) {
refreshStyle();
}

/**
* Ensures that the labels exist
* @return true if the labels did not exist and were created.
*/
protected boolean ensureLabel() {
if (_labelIDl == GLLabelManager.NO_ID) {
//Log.d("GLSensorFOV", "ensureLabel");
Expand Down Expand Up @@ -164,7 +168,11 @@ public void draw(GLMapView ortho, int renderPass) {
if (_surfaceControl == null)
_surfaceControl = ortho.getControl(SurfaceRendererControl.class);

ensureLabel();
if(ensureLabel()) {
// if the labels did not previously exist, go ahead and update the
// polygon to reassociated them with the sensor field of view.
updatePolygon();
}

_poly.draw(ortho);

Expand Down Expand Up @@ -227,6 +235,8 @@ public void release() {
l.release();
rangeLines = null;
}

removeLabel();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import android.text.TextUtils;

import androidx.annotation.Nullable;

import com.atakmap.android.math.MathUtils;
import com.atakmap.android.navigation.NavButtonManager;
import com.atakmap.android.navigation.views.loadout.LoadoutManager;
Expand All @@ -21,8 +23,6 @@
import java.util.Set;
import java.util.UUID;

import androidx.annotation.Nullable;

/**
* Model used for a button loadout (the tool buttons in the top left)
*/
Expand Down Expand Up @@ -396,8 +396,16 @@ else if (s1 != null)
if (q == null)
q = models.size();
int min = Math.min(s, q);
models.addAll(min, noOrder);

try {
models.addAll(min, noOrder);
} catch (Exception e) {
// Playstore Crash: NullPointerException during menu sorting
// Experienced on a Nokia 3.1 A Android 9 (SDK 28) - unable
// to find steps for reproduction. Just add to the end of the
// models.
models.addAll(noOrder);
}
// Update sort order with new tools included
setSortOrder(models);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,10 @@ private void drawShadow(Canvas canvas) {
//_baseDrawable.setColorFilter(null);

// Draw the base drawable to the scratch bitmap
drawToScratch(_baseDrawable);
if (_baseDrawable instanceof LayerDrawable)
drawToScratch(((LayerDrawable) _baseDrawable).getDrawable(0));
else
drawToScratch(_baseDrawable);

// Generate and render shadow
if (_shadowRadius > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ public void enroll(final Context context, final String desc,
this.certificateEnrollmentCompleteCallback = certificateEnrollmentCompleteCallback;

this.view = MapView.getMapView();
if (view == null) {
// Possibly caused by ATAK crashing while the preference screen is open
Log.d(TAG, "mapview is null, cannot enroll");
return;
}

this.appCtx = view.getContext();

view.post(new Runnable() {
Expand Down
Loading

0 comments on commit fcae866

Please sign in to comment.