<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/122020/">https://git.reviewboard.kde.org/r/122020/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On gener 13th, 2015, 2:01 a.m. CET, <b>Saikrishna Arcot</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/122020/diff/2/?file=341485#file341485line189" style="color: black; font-weight: bold; text-decoration: underline;">src/org/kde/kdeconnect/Backends/BluetoothBackend/BluetoothLink.java</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">189</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="n">np</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="na">encrypt</span><span class="o">(</span><span class="n">key</span><span class="o">);</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">One question I have here is the process of sending an encrypted network package.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The LAN backend did something where it seemed to send the port to listen on in an unencrypted manner, and then encrypted the package and sent it on that port. Here, I'm encrypting the package first and then just sending over the payload. Will this (combined with the logic around line 90 above) work?</p></pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">In the lan backend we send first the (encrpyted) text message and then on a different socket (hence the different port) we send the (unencrypted) payload. Sadly the payloads are actually not encrypted in the lan backend, only the JSON text.</p></pre>
<br />




<p>- Albert</p>


<br />
<p>On gener 13th, 2015, 1:12 a.m. CET, Saikrishna Arcot wrote:</p>









<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for kdeconnect.</div>
<div>By Saikrishna Arcot.</div>


<p style="color: grey;"><i>Updated gen. 13, 2015, 1:12 a.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdeconnect-android
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">(Note that this isn't ready for merging yet.)</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This is an initial implementation of a bluetooth backend. This backend implementation can be run only on Android 4.0.2 or higher. The implementation as-is only looks at already-bonded devices; it does not start a discovery session to see other bluetooth devices nearby.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">There are several things that need to be worked out.</p>
<ol style="padding: 0;text-rendering: inherit;margin: 0 0 0 2em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">When requesting permission to enable Bluetooth (if it's not already enabled), <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">startActivityForResult</code> needs to be called. However, this must be called by a class that implements <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">Activity</code>. One possible solution is to call this on the home screen. Another is to just not request it.</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">I believe starting a discovery session also requires calling <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">startActivityForResult</code>, which has to be called from a class that implements <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">Activity</code>. The same solutions for the previous item exist here.</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Options for enabling the Bluetooth backend need to be added to the settings window.</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Some sections of code may warrant a new thread being created, as they may take a while to run.</li>
</ol></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Installed on my Android 4.1.2, and it correctly detected that there are 2 bonded devices. No crashes.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Note that since the KDE side doesn't have a bluetooth backend, much of the code wasn't executed.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>AndroidManifest.xml <span style="color: grey">(6cbe4a7830cfe416fe98e42be143c0f26f2bf1e8)</span></li>

 <li>src/org/kde/kdeconnect/Backends/BluetoothBackend/BluetoothLink.java <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/org/kde/kdeconnect/Backends/BluetoothBackend/BluetoothLinkProvider.java <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/org/kde/kdeconnect/BackgroundService.java <span style="color: grey">(576425cf568e4b223d9840842803d7adabf6b990)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/122020/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>








  </div>
 </body>
</html>