NC 23 & Android 11

Working with NextCloud 23.0.3 and Android 11.
Follow this note:

Thanks all !

Great and working (today) with NextCloud 23.0.3…

Here some quick notes of what I have done on my docker install of NextCloud to enable and use OCSMS 2.2.0 !

from NC root folder of NextCloud container
root@STARGATE:/srv/NC# docker-compose exec db mysql -u root -p nextcloud

MYSQL DATABASES

use nextcloud
create table oc_ocsms_smsdatas(id int(10) auto_increment primary key,user_id varchar(64) not null, added timestamp not null default 0,lastmodified timestamp not null default 0, sms_id int(5) not null,sms_address varchar(64) not null,sms_msg mediumtext not null,sms_date BIGINT not null,sms_flags varchar(2) not null default '00',sms_mailbox int(1) not null,sms_type int(1) not null);
create table oc_ocsms_sendmessage_queue(id int(10) auto_increment primary key,user_id varchar(64) not null,sms_address varchar(64) not null,sms_msg mediumtext not null);
create table oc_ocsms_config(`user` varchar(255) not null,`key` varchar(255) not null,`value` varchar(255) not null);
create table oc_ocsms_user_datas(user_id varchar(64) not null,datakey varchar(64) not null,datavalue varchar(64) not null);
create table oc_ocsms_conversation_read_states(user_id varchar(64) not null,phone_number varchar(64) not null,int_date int(32) not null);

MYSQL INDEXES

create index user_datas_user_datakey on oc_ocsms_user_datas(user_id,datakey);
create index smsdata_user_mailbox on oc_ocsms_smsdatas(user_id,sms_mailbox);
create index smsdata_user_mailbox_date on oc_ocsms_smsdatas(user_id,sms_mailbox,sms_date);
create index smsdata_user_mailbox_address on oc_ocsms_smsdatas(user_id,sms_mailbox,sms_address);
create index smsdata_user_mailbox_address_date on oc_ocsms_smsdatas(user_id,sms_mailbox,sms_address,sms_date);
create index config_user_key on oc_ocsms_config(`user`,`key`);
create index smsdata_user_smsid on oc_ocsms_smsdatas(user_id,sms_id);
create index sms_conversation_rs_pkey on oc_ocsms_conversation_read_states(user_id,phone_number);

INSTALL OCSMS APP

cd /srv/NC/nextcloud/custom_apps/

curl -L https://github.com/nextcloud/ocsms/releases/download/2.1.9/ocsms-2.1.9.tar.gz --output ocsms-2.1.9.tar.gz

tar -zxf ocsms-2.1.9.tar.gz

chown 33:33 ocsms -R

ACTIVATE OCSMS APP

cd /srv/NC/

docker exec -it nextcloud occ app:enable ocsms

INSTALL OCSMS APP


cd /srv/NC/nextcloud/custom_apps/

curl -L https://github.com/nextcloud/ocsms/releases/download/2.2.0/ocsms-2.2.0.tar.gz --output ocsms-2.2.0.tar.gz

tar -zxf ocsms-2.2.0.tar.gz

PATCH OCSMS APP from Handle data migration for the tables renamed after v2.2.0 by floss4good · Pull Request #340 · nextcloud/ocsms · GitHub


wget https://raw.githubusercontent.com/nextcloud/ocsms/f2070b29443c5a62d8a2ebf9d4ce26fc66d757f9/lib/Migration/Version020300Date20210926000100.php

cp Version020300Date20210926000100.php ocsms/lib/Migration/

chown 33:33 ocsms -R

NAVIGATE TO NEXTCLOUD/SMS

INSTALL APK from FDROID with disabling APK INCOMPATIBILITY mode (from Android 10 · Issue #232 · nerzhul/ncsms-android · GitHub)

Add a ocsms account

Try to synchronise and accept necessary privileges

ENJOY…

EDITED:
TAKE CARE WITH COPY/PASTE FROM (here):
the lost of ` chars may issue some errors:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘varchar(255) not null,value varchar(255) not null)’ at line 1

Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘nextcloud.oc_ocsms_config’ doesn’t exist

These are correct!

create table oc_ocsms_config(`user` varchar(255) not null,`key` varchar(255) not null,`value` varchar(255) not null);
create index config_user_key on oc_ocsms_config(`user`,`key`);

May be upstreamed, in APK and in OCSMS !?..
May be simplified, may be…
But working…
So ENJOY !