Help needed in developing an Obex FTP java app - Android Q&A, Help & Troubleshooting

I am trying to develop a sample java app to connect my bluetooth laptop(UIbuntu 14) with my Android Phone(Moto E 1st gen) through Obex FTP.
I used the following lines
Using libraries : bluecove-2.1.1-Snapshot.jar, bluecove-gpl-2.1.1.-Snapshot.jar
String btURL = "btgoep://806C1BD808F0:10;authenticate=false;encrypt=false;master=false";
ClientSession conn = (ClientSession) Connector.open(btURL);
But IOException generated : Failed to connect [111] Connection refused. Dont know what is causing. Can anybody help me?

Related

[Q] Android + PHP + SSL issues

Hey Everyone,
I recently downloaded and installed "PHP for Android." I created a .php file that utilizes an SSL connection with port 2195. When I tried running it, I get the following error message:
HTML:
Error:14094410:SSL routines:func(148):reason(1040) in /mnt/sdcard/sl4a/scripts/lot.php on line 19
Warning: stream_socket_client(): Failed to enable crypto in /mnt/sdcard/sl4a/scripts/lot.php on line 19
Warning: stream_socket_client(): unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /mnt/sdcard/sl4a/scripts/lot.php on line 19
This is my line 19:
"$apns = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext);"
I researched what "reason(1040)" means, and supposedly it means that the port is closed. But what firewall is blocking it? The same exact script works when I execute it from my computer from the same wifi connection. Could it be a firewall inside the Android OS?
Any input will be greatly appreciated!!
Thanks!
Does anyone know?
Hey,
We also got that error with the iPhone Push service, and it was due to the certificate not being set correctly (actually the certificate file didn't exist).
I hope this solves your problem if you haven't solved it by now.
Regards,
Chris

[Q] How to get ReponseData and Signature for android LVL

Hi,
I try to implement a server side verification of an application with LVL library.
I use this php code : http://code.google.com/p/android-market-license-verification/
In the file sample/verify.php, I have two lines to complete :
Code:
$responseData = '';
$signature = '';
I see in the google LVL that there is a function called verify which has these parameters :
public void verify(PublicKey publicKey, int responseCode, String signedData, String signature);
But I don't undestand where this function is called and by what function.
Also I want to get this datas.
How can I do that ?
Thank you,
Yeah!! Same here!
Can someone tell us?
Most apps use client side license verification, don't know why... This would be very useful!

Enable Bluetooth on Android VM

Hi everybody,
I have installed Android-x86 on a Virtual Box VM. I'm trying now to activate bluetooth capability on it.
I plugged-in my usb bluetooth dongle, I mounted it in my VM. Everything is ok so far.
On Android side, I can detect my dongle through the hciconfig and scan with it with hcitool.
The problem appears when I try to enable it in the graphic interface. It always shows me Bluetooth as off.
When I try to move the button on the right to activate it - nothing happens... It completely ignores my attitude.
It is also not possible to enable it through the applications: when an app asks me for an authorization to allow bluetooth, I authorize it to do so but it doesn't succeed.
The error I observe through the adb logs is as follows:
723338-01-21 11:02:23.948 1378 2327 D BluetoothManagerService: enable(com.android.systemui): mBluetooth =null mBinding = false mState = OFF
723474-01-21 11:02:23.948 1378 2327 D BluetoothManagerService: enable returning
723549-01-21 11:02:23.949 1378 1415 D BluetoothManagerService: MESSAGE_ENABLE(0): mBluetooth = null
723644:01-21 11:02:23.949 1378 1415 E BluetoothManagerService: Fail to bind to: Intent { act=android.bluetooth.IBluetooth }
But it doesn't help me much...
Please, if you have any idea how to solve this issue or progress in locating the problem, it would be great.
Thanks in advance for your time!

What can I do if I cannot upload the native symbol file when using the Crash service?

I have been using the Crash service provided by HUAWEI AppGallery Connect recently. However, I encountered two problems when using it. One is that the native symbol file failed to be generated, and two, I failed to upload the file. In this post, I summarized my experience in the hope that it will help others who encounter the same problem.
Generating a Native Symbol File​I added the following code by referring to the official materials but couldn't find the agcp task in the Tasks directory under
Gradle.
Code:
agcp{
debug = true
appVersion = 1.0
symbolUpload = true
debugSoDirectory = "D:\\Onebox\\AndroidProject\\crashdemo\\app\\build\\intermediates\\cmake"
ndkDirectory = "D:\\AndroidSDK\\sdk\\ndk\\21.3.6528147"
}
I checked the documentation and found that I hadn't added the JSON file, so I added the JSON file to the app directory and synchronized the project. This resolved the problem.
A missing debugSoDirectory parameter will also cause the problem. So, make sure you add it as well.
Uploading a Native Symbol File​Once the file was generated, I double-clicked processReleaseSymbolUpload. An HTTP exception was reported, as shown in the following figure.
I often connect my PC to our company's proxy. Once I disconnected from the proxy, the file was uploaded successfully.
If you cannot upload the file using a gradle plugin, you can also use a symbol table tool.
Or, you can manually upload the file in AppGallery Connect.
For more info see the official documentation

[Ugoos X3 and probably a lot of other devices, and even NAS devices] [Solved] Why samba/smb transfer rate is slow despite a gigabit Ethernet port ?

Hello everyone,
For my first thread, I won't ask a question, I will post a solution.
I have recently acquired a second-hand Ugoos X3 device, which is quite a good device.
But I have been really frustrated upon testing it after unboxing it, because despite the fact that this device advertises for the ability of having a Gigabit ethernet port and a builtin samba server, my tests showed a max 11,4 MiB/s instead of rather a 114 MiB/s.
I started to identify the reason, with a vast amount of Googling. After realizing how many people on earth already been through this (mostly unsolved) issue, and after testing the good gigabit-readiness of my Ethernet cable, I dug into the rabbit hole of the system.
I then discovered the root causes, and you won't like it :
- the smbd binary dates from 2005
- the smb.conf is counter-optimized and dates from this 2005 era
See for yourself:
Code:
/data/system/samba_________________ug # ./smbd -V
Version 3.0.20a
Code:
[global]
interfaces = wlan0 eth0 eth1 eth2
min protocol = SMB2
bind interfaces only = yes
workgroup = WORKGROUP
server string = Samba on Android mediacenter
netbios name = mybox
#remote announce = 255.255.255.255
encrypt passwords = yes
security = SHARE
restrict anonymous = 0
load printers = no
printcap name = /dev/null
disable spoolss = yes
deadtime = 5
delete readonly = yes
nt acl support = no
inherit permissions = yes
socket options = IPTOS_LOWDELAY TCP_NODELAY SO_SNDBUF=64000 SO_RCVBUF=64000 SO_KEEPALIVE
local master = no
unix extensions = yes
[internal storage]
vfs objects = fake_perms
comment = mybox /sdcard
path = /sdcard
force user = root
read only = no
writable = yes
guest ok = yes
A lot of directives in this config file are totally deprecated, and the "socket options" is responsible for capping at 11,4 MiB/s.
So after having spent this vast amount of time finding the issue, I took some to patch.
Here's my solution.
0) Root your device
1) Download the Termux compiled package of your device architecture of the "samba" package : https://grimler.se/termux-packages-24/pool/main/s/samba/
2) On your device, replace the smbd binary with the Termux one, at this location : "/data/system/samba_________________ug"
3) Replace the original "smb.conf" (same directory than previous) configuration with this one (which by way the contains security hardening features and support SMBv2 which allows not installing SMBv1 on Windows...)
Code:
[global]
lock dir = /data/local/tmp/lock/
state directory = /data/local/tmp/state/
ncalrpc dir = /data/local/tmp/ncalrpc/
interfaces = wlan0 eth0 eth1 eth2
server min protocol = SMB2
bind interfaces only = yes
workgroup = WORKGROUP
server string = Samba on Android mediacenter
netbios name = mybox
server role = standalone server
security = user
map to guest = Bad Password
usershare allow guests = yes
load printers = no
printcap name = /dev/null
disable spoolss = yes
deadtime = 5
delete readonly = yes
nt acl support = no
inherit permissions = yes
local master = no
disable netbios = yes
smb ports = 445
lm announce = no
multicast dns register = no
[internal storage]
vfs objects = fake_perms
comment = mybox /sdcard
path = /sdcard
force user = root
read only = no
writable = yes
guest ok = yes
4) Edit the "smbd" binary calling line in the "samba-rc" launching script, with this one
Code:
$PRE/smbd -D -s /data/system/samba_________________ug/smb.conf
Reboot your device, you now have a best-of-breed samba server and configuration.
A simple but heartful message to Ugoos: update the packages you use in your image ! We need more up-to-date binaries and configuration from your products ! Provide firmwares that does not require to make people do insecure stuff such as installing SMBv1 client on their client !
I am really grateful to these resources which helped a lot:
- https://lafibre.info/nas/perfs-moisies-avec-samba/ (sorry, in french, use google translate)
- https://serverfault.com/questions/470650/samba-configuration-for-public-shares/700449#700449
- https://blog.hiebl.cc/posts/why-your-samba-config-does-not-work/
Hello. According to your instructions with file replacement and line editing, the server becomes inoperable. The server activation checkbox is not activated in the ugoos settings. Please describe the actions in more detail or upload files for replacement.
Hello @Nereal-NeSkill,
As of step 1), try to perform a "pkg install samba" first with Termux.
Then, can you perform a "./samba-rc start" and paste here the output ?
Was a bit skeptical replacing daemon but It works great!

Categories

Resources