Skip to main content

Posts

Showing posts with the label ios

Making GIF of iOS Simulator without additional apps

This is how I did it: open Terminal and execute this command: ``` xcrun simctl io booted recordVideo \   --code=h264 \   --force "$( date +%Y%m%d%H%M%S ).mov" ``` Running this will record the Simulator screen until you press ` Control+C `. The filename will be something like ` 20200730095757.mov `. The next step is to convert this video into GIF, FFMPEG is required for this. You can either install it via Homebrew but I prefer running it in a Docker container, something like this: ``` docker run --rm -it -v $PWD:/data -w /data --entrypoint /bin/bash jrottenberg/ffmpeg ``` Once you have FFMPEG installed or are inside the container, execute this command: ``` ffmpeg -i 20200730095757.mov \   -vf "fps=fps=5,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \   20200730095757.gif ``` I have played around with the command line arguments and came up with those. Basically it will create a decent GIF to use in issue report etc. Bec...

Vọc thử các ứng dụng ngân hàng trực tuyến

Nhân dịp vấn đề an toàn giao dịch ngân hàng trực tuyến đang nóng, mình làm một vài bài thử nghiệm với các dịch vụ của 5 ngân hàng lớn trong nước: BIDV, Vietcombank, ACB, Techcombank và Sacombank. Các bài thử nghiệm sẽ là ( hoặc tua xuống cuối bài để xem nhanh nên xài ngân hàng nào thì an toàn :P ): Trang web TLS: phải bật SSL Server Test : phải từ A trở lên HPKP : phải sử dụng hoặc phải mã hóa tên và mật khẩu bằng Javascript trước khi đăng nhập Ứng dụng di động: lúc đầu mình tính kiểm tra riêng Android và iOS nhưng thực tế thấy ứng dụng mỗi ngân hàng ở hai nền tảng khá giống nhau nên gom lại chung cho gọn TLS: phải sử dụng Certificate/Public Key Pinning : phải sử dụng hoặc phải mã hóa tên và mật khẩu đăng nhập Giới thiệu TLS trước đây còn có rào cản về chi phí tuy nhiên gần đây đã có chứng chỉ miễn phí từ Let's Encrypt nên không còn lý do gì nữa để không làm việc này. TLS là bước cơ bản nhất để bảo mật thông tin giữa ngân hàng và người sử dụng. SSL Server T...

Reverse engineering Pubvn apps for fun and... larger-screen-fun

It's Friday night and the wife TM wanted to watch Games of Thrones on the TV (via Chromecast). Should be easy right? We have lots of apps installed for exactly this purpose: Netflix, HBO Now, Flix , etc. None of them worked though... Netflix just doesn't have HBO contents like GoT. HBO Now works but it requires a US proxy to watch and there is no way to tell the Chromecast to go through a proxy. Flix, a promising local app, good with TV streaming but not series. So we had to settle to use HBO Now and Google Chrome's cast tab feature to have it on the big screen. A complicated setup, and slow. The casting was broken a few times during the episode, probably because of wifi interferences. This problem needs some engineering! Proxy Those Apps First order of business would be proxy their apps to catch all network requests. I used Charles  with their iOS app. At first I thought it would be tricky if they use https or certificate pinning but it turned out everything ...

The new UISplitViewController, Swift and iOS 7

I was playing around with Swift today and stumbled upon the new awesome UISplitViewController  in iOS 8. This enhanced version of the controller makes it work for all iOS devices (originally, it only works with iPads). With the introduction of the "phablet", Apple had to improved their SDK to make it easier for devs to build app that works across all screen sizes. That's a good thing, but a little too late IMHO. Anyway, back to UISplitViewController, the app created by the Xcode template only works with iOS 8 so I tried to dig in and see if it is possible to support iOS 7 with the same code, same storyboard and everything. It looked like it was possible. Many people tried that, particularly this blog post , but the best solution out there still doesn't have it working smoothly in iPad portrait mode where it should show a button to open the master view in a popup... After a few hours looking around, I finally found the solution and have a demo project available at g...