38 Commits

Author SHA1 Message Date
Evan Hahn
864b2d1b3d Fix file header template (and a violation)
Files are supposed to start with a line like this:

    // Copyright 20XX Signal Messenger, LLC

However, the IDE template macro looked like this:

    // Copyright (c) 20XX Signal Messenger, LLC

That caused our linter at `Scripts/lint/lint-license-headers` to
complain. This fixes that, and a violation of it.

I introduced this recently in 370ff654e7.
2022-10-13 15:28:18 -07:00
Evan Hahn
370ff654e7 Change license to AGPL
Change license to AGPL

This commit:

- Updates the `LICENSE` file

- Start every file with something like:

      // Copyright YEAR_FIRST_PUBLISHED Signal Messenger, LLC
      // SPDX-License-Identifier: AGPL-3.0-only

---

First, I removed existing license headers with this Ruby 3.1.2 script:

    require 'set'

    EXTENSIONS_TO_CHECK = Set['.h', '.hpp', '.cpp', '.m', '.mm', '.pch', '.swift']

    same = 0
    different = 0

    all_files = `git ls-files`.lines.map { |line| line.strip }
    all_files.each do |relative_path|
      if relative_path == 'Pods'
        next
      end

      unless EXTENSIONS_TO_CHECK.include? File.extname(relative_path)
        next
      end

      path = File.expand_path(relative_path)

      contents = File.read(path)
      new_contents = contents.sub(/\/\/\n\/\/  Copyright .*\n\/\/\n\n/, '')

      if contents == new_contents
        same += 1
      else
        different += 1
      end

      File.write(path, new_contents)
    end

    puts "updated #{different} file(s), left #{same} untouched"

I'm sure this script could be improved, but it worked well enough.

Then, I created `Scripts/lint/lint-license-headers` and ran it to auto-
fix a lot of files. This changed the mode of some files, but I think
that's actually desirable. For example,
`SignalServiceKit/src/Util/AppContext.m` previously had a mode of
`0755/-rwxr-xr-x`, and it's now `0644/-rw-r--r--`.

Then I fixed some stragglers and updated the precommit script.

See [a similar change in the Desktop app][0].

[0]: 8bfaf598af
2022-10-13 08:25:37 -05:00
Max Radermacher
a18d6034ee Fix copyright year in Xcode template
Use a `___YEAR___` macro to avoid updating it in the future.

More details are available in Apple’s documentation:
- https://help.apple.com/xcode/mac/11.4/index.html?localePath=en.lproj#/devc8a500cb9
- https://help.apple.com/xcode/mac/11.4/index.html?localePath=en.lproj#/dev7fe737ce0
2022-04-25 12:16:49 -07:00
Eugene Bistolas
9917f0126a Update workspace settings to use modern build system. Update Podfile to strip VALID_ARCHS flag from generated target xcconfig (deprecated in Xcode 12) 2021-06-17 14:29:14 -07:00
Nora Trapp
45e4c184b8 Disable new build system 2021-04-19 09:34:49 -07:00
Nora Trapp
2d76b7c6e0 Don't build for armv7 2021-04-15 10:57:17 -07:00
Nora Trapp
36015c8fb8 Fix build 2021-04-14 21:41:08 -07:00
Nora Trapp
d4881bada7 Use new build system 2021-04-13 20:40:17 -07:00
Matthew Chen
125563db25 Revert to old build system. 2021-03-25 20:46:12 -03:00
Matthew Chen
be4acdd4c5 New build system. 2021-03-24 10:02:14 -03:00
Michelle Linington
dbda264c13 PR feedback: Also update default copyright year 2020-07-06 14:42:47 -07:00
Michelle Linington
f2b0b2abd4 IOS-640: Remove trailing whitespace from copyright header template
This is so minor I feel ridiculous making a PR for this. But each new
file I create has the trailing whitespace flagged in git. I can't
imagine this is intentional.
2020-07-06 14:42:47 -07:00
Michael Kirk
cce628a069 fixup! Merge branch 'mkirk/pdf-share' 2020-01-14 09:24:06 -07:00
Michael Kirk
1ac44de0d5 FIX: some PDF's fail to share
Some PDF shares (and presumably other files) were not shareable due to a failure to convert.

The root of this is that the behavior of
NSItemProvider.loadItemForTypeIdentifier(_:,options:,completionHandler:)
depends on the signature of the completion handler.

The documented signature of the completion handler is: (NSSecureCoding, NSError) -> Void

For example, if you want an NSURL back, it's expected that you'll pass in a
`(NSUrl, NSError)` block, or if you want a Data you'll pass in a `(NSData, NSError)`.

However, that's not possible with Swift strict typing. The type of the block must match.

```
loadItmForTypeIdentifier('myType', nilOptions) { loadedItem, error in

}
```

The type of `loadedItem` is SecureCoding. What we were seeing is that we were
getting returned to us unexpected classes, e.g. private iOS internal classes
like "_NSSandboxedDocument", which indeed do conform to NSSecureCoding.

Instead, we should cut with the grain of the existing API design and request
the exact type of object we want. We do this is ObjC, since this isn't possible in swift,
and provide some bespoke Swift wrappers.

Doing this requires tracking some information about the itemprovider, and
funneling that through the extensionItem -> SignalAttachment process.
2020-01-14 09:21:04 -07:00
Matthew Chen
7703155bb3 Enable legacy build system. 2018-12-13 11:47:50 -05:00
Jesse Squires
868a35ce4c Add IDE template macro for consistent headers
Xcode has undesirable default header comments, and now you can customize them.
This adds an `IDETemplateMacros.plist` file to the `xcworkspace` so that new files created
in the workspace have the same, consistent default header comments automatically added:

```
//
//  Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
```

This will prevent contributors from either (1) committing Xcode's default, or
(2) having to manually copy-pasta the standard comment headers for every new file added.

[See here for more details](https://oleb.net/blog/2017/07/xcode-9-text-macros/)
2018-07-25 11:55:27 -04:00
Matthew Chen
a5a2f02edc Respond to CR. 2018-04-13 14:53:14 -04:00
Matthew Chen
7135895c1c Modify TSStorageManager to use separate shared read and write connections.
// FREEBIE
2017-07-05 17:01:28 -04:00
Matthew Chen
f49309bf66 Add incoming and outgoing message database views.
// FREEBIE
2017-05-31 09:58:32 -04:00
Matthew Chen
96e155c75e Rework appearance of voice messages and audio attachments.
// FREEBIE
2017-05-12 09:46:54 -04:00
Matthew Chen
9db33a9651 Remove RedPhone code.
// FREEBIE
2017-03-29 12:25:33 -04:00
Michael Kirk
99c982fbb2 change ZXing to framework for faster incremental compiles in xcode
// FREEBIE
2017-03-16 12:04:45 -04:00
Matthew Chen
d49d6077da Respond to CR.
// FREEBIE
2017-03-02 14:14:58 -05:00
Michael Kirk
ca85fe1684 [SSK] Avoid crashes when signed prekey lookup fails.
// FREEBIE
2017-02-14 15:56:39 -05:00
Michael Kirk
1dd06a5e6c Fix registration flow / Keep push tokens in sync
* Separate registering an account from registering for push notifications
  * Allows us to complete registration without prompting user for
    notification settings.

UX Changes
----------
* Automatically keep push tokens in sync on startup.
  Push tokens *can* change, though they rarely do. It happens more often
  for people switching between appstore/beta builds.

  fixes #1174

* Show alert with registration failure
  * add secret 8-tap debug log gesture to registration flow

* Move registration to separate flow
  * don't see flash of inbox when first launching

* show useful error messages when given wrong code / no code

* remove background fetch
  We werent using it, but only relying on a side effect of it which is
  no longer necessary.

Code Changes
------------

* More registration logging.

* Install PromiseKit with carthage

  Our dependencies are not yet framework compatible, so we can't use
  cocoapods.

* Merge preferences util "category" into superclass.

  The immediate reason for this is Swift interop was assuming optional
  types were not optional, and exploding when a value was nil.

  This is clearer anyway, since we were treating it like a subclass, and
  it was the only thing using the class anyway.

* auto-genstrings now searches *.swift (and *.h, which was previously
  broken) for translateable strings.

// FREEBIE
2016-11-03 16:13:49 -04:00
Michael Kirk
cc2d47fbd3 Update protocol (#1315)
* Update to latest SignalServiceProtocol
* Show SignalServiceKit compiler warnings

// FREEBIE

* Update to latest signal protocol

// FREEBIE
2016-08-22 16:54:31 -04:00
Michael Kirk
7fef6aeab2 Fix crash after deleting message (#1219)
* update to JSQMessageViewController fixes #1218
* no need for SVC to retain membership of MVC

// FREEBIE
2016-06-15 12:46:29 -07:00
Michael Kirk
965261f465 attempt to fix intermittent SEGFAULT in SocketRocket (Maybe Fixes #1196) (#1217)
* Rebased OWS fork of SocketRocket against upstream
* Pulling in SocketRocket directly from OWS Github rather than going
  through the motions of publishing a pod that only we use.
* Bump version

// FREEBIE
2016-06-14 14:19:28 -07:00
Frederic Jacobs
4034baedb9 Adapting to renaming. 2016-04-08 09:47:41 +02:00
Frederic Jacobs
c6d44e59e2 TextSecureKit Refactoring
- Using same clang format file for old and new files.
- Moving out all TextSecure code to allow other clients (OS X, iOS) to
  integrate easily TextSecure functionality.
- Use TextSecure API to signup.
2015-12-22 23:41:10 +01:00
Frederic Jacobs
bbde7cd2a8 iOS 9 Support
- Fixing size classes rendering bugs.
- Supporting native iOS San Francisco font.
- Quick Reply
- Settings now slide to the left as suggested in original designed
  opposed to modal.
- Simplification of restraints on many screens.
- Full-API compatiblity with iOS 9 and iOS 8 legacy support.
- Customized AddressBook Permission prompt when restrictions are
  enabled. If user installed Signal previously and already approved
  access to Contacts, don't bugg him again.
- Fixes crash in migration for users who installed Signal <2.1.3 but hadn't signed up
  yet.

- Xcode 7 / iOS 9 Travis Support
- Bitcode Support is disabled until it is better understood how exactly
  optimizations are performed. In a first time, we will split out the
  crypto code into a separate binary to make it easier to optimize the
  non-sensitive code. Blog post with more details coming.
- Partial ATS support. We are running our own Certificate Authority at
  Open Whisper Systems. Signal is doing certificate pinning to verify
  that certificates were signed by our own CA. Unfortunately Apple's App
  Transport Security requires to hand over chain verification to their
  framework with no control over the trust store. We have filed a radar
  to get ATS features with pinned certificates. In the meanwhile, ATS is
  disabled on our domain. We also followed Amazon's recommendations for
  our S3 domain we use to upload/download attachments. (#891)
- Implement a unified `AFSecurityOWSPolicy` pinning strategy accross
  libraries (AFNetworking RedPhone/TextSecure & SocketRocket).
2015-10-31 04:45:55 +01:00
Frederic Jacobs
fc6b4b5549 New wire format
Unnecessary base64 encoding has now been removed.
2015-01-04 12:12:45 +01:00
Christine Corbett
5b0914c038 Signup flow: request call.
• enables the "Send Again button"
• enables the display of the number the user entered in the Registration View in this subsequent scene (so they can see whether they should go back or not)
• enables the "call me instead button"

Reviewed-by: @FredericJacobs
2015-01-04 11:30:24 +01:00
dtsbourg
e48ea52924 ContactDetail: Fix crash on parsedPhoneNumbers 2015-01-04 11:30:21 +01:00
dtsbourg
a60bc8be92 Initial Message UI 2015-01-04 11:28:38 +01:00
Frederic Jacobs
dc4e4689e0 Checks and extra logging for login issues 2014-08-14 16:36:17 +02:00
Frederic Jacobs
c52c6c6248 Clearing notifications from notification center
Application acknowledges notifications and then clears them from
notification center.
//FREEBIE
2014-08-14 00:45:59 +02:00
Frederic Jacobs
9051045b9e Fixes for Travis setup
//FREEBIE
2014-08-05 07:19:17 +02:00