Skip to content

Commit

Permalink
Increment version + other misc changes that went untracked
Browse files Browse the repository at this point in the history
  • Loading branch information
petabyt committed Aug 19, 2023
1 parent 4b5e5dc commit 35fda9a
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 24 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "dev.danielc.fujiapp"
minSdk 21
targetSdk 33
versionCode 1
versionName "0.1.0-beta"
versionCode 2
versionName "0.1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

<application
android:requestLegacyExternalStorage="true"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.NoActionBar"
tools:targetApi="31">
tools:targetApi="32">
<activity
android:name=".Help"
android:exported="false" />
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
app:layout_constraintTop_toTopOf="parent">

<TextView
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/app_name"
Expand All @@ -97,8 +97,9 @@
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:padding="10dp"
android:tint="@color/white"
app:srcCompat="@drawable/baseline_settings_24" />
android:visibility="invisible"
app:srcCompat="@drawable/baseline_settings_24"
app:tint="@color/white" />

</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Expand Down
22 changes: 12 additions & 10 deletions app/src/main/res/layout/activity_viewer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,22 @@

<ImageButton
android:id="@+id/download_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:clickable="true"
android:contentDescription="Download button"
android:focusable="true"
style="@style/GreyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:padding="10dp"
app:tint="@color/white"
app:srcCompat="@drawable/download" />

<ImageButton
android:id="@+id/share_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:clickable="true"
android:contentDescription="Share button"
android:focusable="true"
style="@style/GreyButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:padding="10dp"
app:tint="@color/white"
app:srcCompat="@drawable/share" />

</LinearLayout>
Expand Down
2 changes: 2 additions & 0 deletions lib/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ void jni_verbose_log(char *str);
void tester_log(char *fmt, ...);
void tester_fail(char *fmt, ...);

void reset_connection();

#endif
2 changes: 1 addition & 1 deletion lib/camlib
Submodule camlib updated 7 files
+2 −5 src/bind.c
+15 −11 src/camlib.h
+1 −1 src/canon.c
+3 −0 src/conv.c
+16 −16 src/data.c
+2 −3 src/operations.c
+35 −13 src/util.c
6 changes: 3 additions & 3 deletions lib/fuji.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Fujifilm WiFi connection library - this code is a portable extension to camlib -
// don't add any iOS, JNI, or Dart stuff to it
// Fujifilm WiFi connection library - this code is a portable extension to camlib.
// Don't add any iOS, JNI, or Dart stuff to it
// Copyright 2023 (c) Unofficial fujiapp
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <camlib.h>

#include "myjni.h"
//#include "myjni.h"
#include "models.h"
#include "fuji.h"
#include "fujiptp.h"
Expand Down
4 changes: 4 additions & 0 deletions lib/jni.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

JNI_FUNC(jint, cPtpFujiInit)(JNIEnv *env, jobject thiz) {
backend.env = env;

// Take this as an opportunity to reset all the structures for a new connection
reset_connection();

int rc = ptpip_fuji_init(&backend.r, "fujiapp");

struct PtpFujiInitResp resp;
Expand Down
8 changes: 7 additions & 1 deletion lib/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@

struct AndroidBackend backend;

void reset_connection() {
memset(&fuji_known, 0, sizeof(struct FujiDeviceKnowledge));
ptp_generic_reset(&backend.r);
backend.r.connection_type = PTP_IP;
}

void jni_verbose_log(char *str) {
if (backend.log_fp == NULL) return;

Expand Down Expand Up @@ -75,7 +81,7 @@ JNI_FUNC(void, cInit)(JNIEnv *env, jobject thiz, jobject pac, jobject conn) {
// TODO: cmd_close

ptp_generic_init(&backend.r);
backend.r.connection_type = PTP_IP;
reset_connection();
}

JNI_FUNC(jint, cRouteLogs)(JNIEnv *env, jobject thiz, jstring path) {
Expand Down
7 changes: 4 additions & 3 deletions lib/vusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int ptpip_connection_init() {
}

int ptpip_cmd_write(struct PtpRuntime *r, void *to, int length) {
CAMLIB_SLEEP(10);
CAMLIB_SLEEP(5);
static int first_write = 1;

if (first_write) {
Expand All @@ -62,7 +62,8 @@ int ptpip_cmd_write(struct PtpRuntime *r, void *to, int length) {
first_write = 0;

ptpip_connection_init();


// Pretend like we read the packet
return length;
}

Expand All @@ -71,7 +72,7 @@ int ptpip_cmd_write(struct PtpRuntime *r, void *to, int length) {
}

int ptpip_cmd_read(struct PtpRuntime *r, void *to, int length) {
CAMLIB_SLEEP(10);
CAMLIB_SLEEP(5);
static int left_of_init_packet = sizeof(socket_init_resp);

if (left_of_init_packet) {
Expand Down

0 comments on commit 35fda9a

Please sign in to comment.