Jekyll2021-08-30T15:49:01+09:00https://ntcho.github.io/feed.xmlNathan’s BlogNathan's discovery and experiences.Nathan Chontcho13@gmail.com2021 군장병 해커톤 코딩경진대회 참여 후기2021-07-28T17:00:00+09:002021-07-28T17:00:00+09:00https://ntcho.github.io/experiences/osam-hackathon-test<p>국방부에서 개최한 군장병 오픈소스 해커톤에 선발되게 된 과정입니다.</p>
<p><img src="https://user-images.githubusercontent.com/13298429/131220551-261e1532-f9de-4c67-8ef1-e1a404b2b3f3.png" alt="2021 OSAM Hackathon Thumbnail" class="align-center" /></p>
<h1 id="-군장병-공개sw-온라인-해커톤이란">💻 군장병 공개SW 온라인 해커톤이란?</h1>
<p><a href="https://osam.kr/hackathon/main">공개SW 해커톤 홈페이지</a></p>
<blockquote>
<p>국방 분야에 활용 가능한 참신한 아이디어를 발굴하고, SW인재 발굴을 위한 대회입니다.</p>
</blockquote>
<p>국방부에서 주최하는 소프트웨어 해커톤으로, 코로나19 상황으로 온라인으로 개최되는 해커톤입니다.</p>
<h2 id="-해커톤-요약">🧩 해커톤 요약</h2>
<p><strong>참가 분야</strong>: 병영생활 및 국방에서 활용 가능한 모바일 앱, 웹 서비스 또는 지정 과제</p>
<p><strong>대회 기간</strong>: 2021-08-23 ~ 2021-10-20 (약 2달 간)</p>
<p><strong>참가 방식</strong>: 온라인 개발 및 협업</p>
<p><strong>참가 대상</strong>: 온라인 우수 교육생으로 선발된 군장병</p>
<p><img src="https://user-images.githubusercontent.com/13298429/131234057-0726b242-6103-4a36-83be-8db69a69f2e2.png" alt="2021 OSAM Hackathon Prize List" class="align-center" /></p>
<p>총 12팀이 수상을 하게되며, 과학기술정보통신부 장관상, 국방부 장관상 등 여러가지 상장이 수여됩니다.</p>
<h1 id="-참가-과정">🧐 참가 과정</h1>
<p><img src="https://user-images.githubusercontent.com/13298429/131220720-ce56a31a-8d00-4ef4-89a7-30f1e062d850.png" alt="2021 OSAM Hackathon Scoring System" class="align-center" /></p>
<p>해커톤 참가자 선발은 해커톤 필수과정 이론평가 점수 50%, 코딩테스트 점수 25%, 개발계획서 점수 25%를 합산 한 점수로 이루어집니다.</p>
<p>해커톤 공지에는 5개 분야별 30명씩 선발해 총 150명을 선발할 예정이라고 공지되어있었지만, 최종 합격자로 총 200명이 선발되었습니다. 2021년 해커톤 기준으로 분야별 합격자 수는 Web 85명, App 40명, IoT 15명, Cloud 18명, AI 42명이었습니다.</p>
<h2 id="️-해커톤-필수과정-이론평가">✍️ 해커톤 필수과정 이론평가</h2>
<p><img src="https://user-images.githubusercontent.com/13298429/131220651-9307938c-5e59-4718-ae88-2789df959583.png" alt="2021 OSAM Hackathon Application Page" class="align-center" /></p>
<p>Web, App, IoT, Cloud, AI 분야 중 해커톤에 지원할 분야의 강의를 듣고 홈페이지에서 이론 평가 시험을 응시하면 됩니다.</p>
<p>저는 App 분야로 지원해서 Dart 와 Flutter 강의를 들었습니다. 강의는 유투브에 올라온 튜토리얼 강좌와 국방오픈소스아카데미에서 외부 유투버 강사를 통해서 제작한 영상으로 구성되어 있었습니다. 2021년 해커톤 기준 전체 강의 목록은 <a href="https://osam.kr/lecture/list/all?pageNo=1&ca=all">여기</a>에서 확인하실 수 있습니다.</p>
<p>필수 수강 강의는 아래의 4가지 강의였습니다. 각 강의당 80% 이상을 들어야 강의 수료로 인정됩니다.</p>
<details>
<summary>App 분야 필수 강의 목록</summary>
<ul>
<li>
<a href="https://osam.kr/lecture/view/64/detail">Dart 언어 기초</a> (약 3시간 40분, 코드팩토리 유투브 영상)
<ul><li>Dartpad 로 설명하며 주요 기능, 문법 설명</li></ul>
</li>
<li>
<a href="https://osam.kr/lecture/view/63/detail">Flutter 초급</a> (약 4시간, 데어프로그래밍 강좌)
<ul><li>개발 환경 설정, Dart 언어, 기본 위젯 설명</li></ul>
</li>
<li>
<a href="https://osam.kr/lecture/view/62/detail">Flutter 중급</a> (약 11시간)
<ul><li>여러가지 예제 어플리케이션 개발 실습 (쇼핑카트, 에어비엔비, 카카오톡 등)</li></ul>
</li>
<li>
<a href="https://osam.kr/lecture/view/87/detail">Flutter 고급</a> (약 8시간)
<ul><li>블로그 앱 개발로 GetX, 상태관리, 서버 통신 등 실습</li></ul>
</li>
</ul>
</details>
<p class="notice--info"><strong>Tip</strong>: 수강 확인은 강의를 전부 시청하지 않아도 화면 왼쪽 아래의 <code class="language-plaintext highlighter-rouge">학습완료</code> 버튼을 누르면 수강한 것으로 표시됩니다.</p>
<p>강의는 퀄리티도 높고 설명을 잘 해주셔서 도움이 많이 되었습니다. 강의에서 아쉬웠던 점이 있다면 Dart 언어 기초 강의와 Flutter 초급 강의가 겹치는 부분이 있어서 비슷한 내용을 다시 들어야 했던 것이었습니다. 😓</p>
<p>이론평가 시험은 웹페이지에서 진행되었고, 40문항이 출제되었으며, 총 1시간의 시간이 주어졌습니다. 시험 진행에 대한 별다른 공지가 없는 것을 보니 오픈북 시험인것 같았습니다.</p>
<p>미루고 미루다가 마지막에 강의를 몰아서 듣게된 저는 <span style="opacity: 0.6">(생각보다 내용이 많기 때문에 시간을 확보해놓고 천천히 들으시는 걸 추천합니다)</span> 고급 강의 뒷부분을 자세히 못 들었는데, 고급 과정의 내용이 시험 후반부에 다수 출제되어서 뒷부분 문제를 틀렸습니다. 강의에서 소개한 컴포넌트와 같은 세부 내용까지 출제되니 높은 점수를 받기 위해서는 철저한 준비가 필요할 것 같습니다. 시험이 종료된 후에는 문제의 정답은 공개되지 않고 점수만 공개되었습니다.</p>
<h2 id="-코딩-테스트">💯 코딩 테스트</h2>
<p>코딩 테스트는 프로그래머스에서 진행되었고, 난이도별로 4문항이 출제되었으며, 총 2시간의 시간이 주어졌습니다. 사용할 수 있는 언어는 C, C++, Java, Javascript, Python 이였습니다. 출제된 문제 유형은 아래와 같았습니다.</p>
<h3 id="1번-문제-문자열-추출">1번 문제: 문자열 추출</h3>
<p>조건에 맞는 문자열을 추출하는 문제. 주어지지 않은 테스트 케이스를 생각해보고, 주어진 조건에 맞는 반복문을 작성해서 쉽게 해결할 수 있었습니다.</p>
<h3 id="2번-문제-문자열-변환">2번 문제: 문자열 변환</h3>
<p>규칙에 맞게 문자열을 변환하는 문제. Python 의 dictionary 개념을 활용하면 쉽게 풀 수 있는 문제였지만 edge case 들이 있어서 디버깅에 시간이 생각보다 많이 걸렸습니다.</p>
<h3 id="3번-문제-backtracking-알고리즘">3번 문제: Backtracking 알고리즘</h3>
<p>특정 규칙을 가진 게임의 정답이 주어지면 그 정답에 이르는 과정을 계산하는 문제. Backtracking 알고리즘을 사용해서 푸는 문제 유형이였습니다.</p>
<h3 id="4번-문제-pathfinding-알고리즘">4번 문제: Pathfinding 알고리즘</h3>
<p>최단 경로 유형의 기출 변형 문제. 특정한 이동 규칙에 맞는 최단 거리를 이동하는 시간을 구하는 문제였습니다. Pathfinding (A* search) 알고리즘을 사용해서 푸는 문제 유형이였습니다.</p>
<p>저는 Python 을 사용해서 문제 풀이를 했고, 1번과 2번 문제에서 각각 40분 정도를 사용하고 남은 30분동안 3번 문제를 시도하던 중 시간 초과로 코딩 테스트를 마무리했습니다. 1번과 2번은 100점, 3번 문제는 약 10점으로 총점 210점으로 테스트를 마무리했고, 총 등수는 431명 중 105등을 기록했습니다. 코딩테스트 점수 1등부터 12등까지는 모두 400점이었고, 특히 1등을 기록하신 분은 40분도 안되는 시간에 모든 문제를 마무리하셨습니다. 😮</p>
<p>코딩테스트 리더보드는 <a href="https://programmers.co.kr/competitions/1585/2021-practice-coding">여기</a>에서 확인하실 수 있습니다.</p>
<h2 id="-개발계획서">🧾 개발계획서</h2>
<p>아이템 개요, 계획 및 목표, 효과 및 전망을 웹사이트 상에서 텍스트 형식으로 입력해서 제출하는 형식입니다. 저는 군 행정 업무에 도움이 될 수 있는 Web / App 서비스 아이디어를 제안했습니다. 계획서는 최대한 간결하게 다음과 같은 형식으로 작성했습니다.</p>
<h3 id="아이템-개요">아이템 개요</h3>
<p>어떤 서비스인지 한 줄로 요약하고, 서비스를 통해 개선되는 점과 주요 기능을 간략하게 작성했습니다.</p>
<h3 id="계획-및-목표">계획 및 목표</h3>
<p>처음에는 서비스의 성장 계획을 주 목표, 1,2,3차 목표로 나누어서 작성했습니다. 그리고 해커톤 기간 동안 대략적인 프로젝트 진행 계획을 작성하고, 해커톤의 취지에 맞는 목표를 설정했다고 작성했습니다. 마지막으로 팀원별 역할 분배도 추가했습니다.</p>
<h3 id="효과-및-전망">효과 및 전망</h3>
<p>서비스가 활성화됨에 따라 예상되는 긍정적인 변화와 서비스가 확장된다면 군 전체에 도움이 될 것이라는 전망을 설명했습니다.</p>
<h1 id="️-추가-정보">🙋♂️ 추가 정보</h1>
<p>전년도 수상작들은 <a href="https://github.com/osamhack2020">github.com/osamhack2020</a> 에서 확인하실 수 있습니다.</p>
<p>홈페이지에 있는 챗봇을 통해서 관계자분들에게 편하게 질문을 하고 빠른 답변을 받을 수 있었습니다. 👍</p>
<p>해커톤을 진행하면서 더 많은 글을 올릴 예정입니다! 많은 관심 부탁드립니다. 🙂</p>
<p class="notice--warning">궁금한 점이 있으시거나 내용에 수정이 필요한 경우는 <a href="mailto:ntcho13@gmail.com">ntcho13@gmail.com</a> 로 연락주시면 답변드리겠습니다.</p>Nathan Chontcho13@gmail.com국방부에서 개최한 군장병 오픈소스 해커톤에 선발되게 된 과정입니다.Why Project Euler?2021-06-14T20:00:00+09:002021-06-14T20:00:00+09:00https://ntcho.github.io/learning/project-euler<p>How do you improve your mathmatical problem solving skills?</p>
<h1 id="-why-project-euler">🤔 Why Project Euler?</h1>
<p>Recently, I felt the need to improve my problem solving skills in programming.</p>
<p><strong>LeetCode</strong>, <strong>HackerRank</strong>, <strong>Project Euler</strong> seemed like popular websites for coding problems. After trying each of them out, I settled down to use HackerRank and Project Euler.</p>
<p>For me, HackerRank was better than LeetCode. It didn’t ask me to pay every page, and it had a better coding environment as they provide the starting codes.</p>
<h2 id="-why-project-euler-with-hackerrank">🙋 Why Project Euler with Hackerrank?</h2>
<p>While HackerRank focuses on Computer Science concepts such as data structures and algorithms, Project Euler focuses on pure mathematics. Problems from Project Euler made me use pure mathematical properties before using any other type of data structures or computing tricks.</p>
<p>I found it helpful because in CS, we always work with some sort of data - which can be represented in a mathematical way - so using mathematical properties in actual codes can greatly improve the performance.</p>
<h2 id="-tldr">😑 TL;DR</h2>
<p><strong>HackerRank</strong> for coding problems, <strong>Project Euler</strong> for mathematical problems.</p>
<p>I solve my Project Euler problems on <a href="https://ntcho.github.io/project_euler">my blog</a>! (Please check it out and leave your thoughts on the comments 🙂)</p>
<h3 id="-bonus-my-problem-solving-workflow">✨ Bonus: My problem solving workflow</h3>
<p>In case you wonder how I solve Project Euler problems:</p>
<ol>
<li>Solve the problem with Python.</li>
<li>Look for ideas or better solutons on the problem thread.</li>
<li>Organize it into a Jupyter notebook on <a href="https://github.com/ntcho/project_euler">my GitHub Repo</a>.</li>
<li>Publish the notebook automatically to <a href="https://ntcho.github.io/project_euler">my blog</a> with <a href="https://github.com/fastai/fastpages"><code class="language-plaintext highlighter-rouge">fastpages</code></a>.</li>
</ol>Nathan Chontcho13@gmail.comHow do you improve your mathmatical problem solving skills?Boost Your Remote Desktop Performance2021-05-09T13:09:00+09:002021-05-09T13:09:00+09:00https://ntcho.github.io/software/optimizing-rdp<p>Achieving native experience through RDP. Can it reach 60FPS?</p>
<h1 id="-problem">🧾 Problem</h1>
<p>Your RDP environment has poor performance. Poor performance can include the following, but not limited to:</p>
<ul>
<li>Frame drops</li>
<li>Poor image quality or compression</li>
<li>High latency</li>
<li>Disabled GPU (e.g. WebGL unavailable)</li>
</ul>
<h1 id="-solution">💡 Solution</h1>
<h2 id="-materials-needed">🛠 Materials needed</h2>
<ul>
<li>A host PC <em>(Remote Desktop <strong>Session Host</strong>)</em></li>
<li>A client device <em>(Remote Desktop <strong>Connection Client</strong>)</em></li>
</ul>
<h3 id="-disclaimers">⚠ Disclaimers</h3>
<p>This tutorial is written for Remote Desktop <strong>Connection Client</strong> in mobile devices such as Android or iOS devices. It might have less performance improvements for clients on PC.</p>
<h2 id="-prerequisites">📚 Prerequisites</h2>
<p>You need a <strong>working Remote Desktop setup</strong> to configure further. <strong>WOL (Wake-on-LAN) configuration</strong> for the host PC is recommended since the process requires restarting the host PC.</p>
<p>You would also need administrative rights on your local account in order to change group policy options.</p>
<p>You might need a stable and fast internet connection to see the full performance improvement. Internet connection with speed exceeding 5Mbps is recommended.</p>
<h3 id="-remote-desktop-setup">🖥 Remote Desktop setup</h3>
<p>You need <strong>Windows 10 Pro or higher</strong> in order to connect with Remote Desktop Protocol.</p>
<h3 id="-gpu-specifications">⚙ GPU Specifications</h3>
<p>You need a GPU or its driver supporting <strong>DirectX 11 or higher</strong>. And to use enhanced graphics on your Remote Desktop session, your system needs to support RemoteFX.</p>
<p class="notice--info"><strong>Note</strong>: Most of modern GPUs and Windows 10 system supports both.</p>
<h3 id="-client-application">📱 Client application</h3>
<p>You need a client to establish a connection to the host PC. You can get clients for your platform <a href="https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-desktop-clients">here</a>.</p>
<h2 id="-problem-details">📑 Problem details</h2>
<h3 id="-lack-of-configuration-options-on-mobile-clients">😕 Lack of configuration options on mobile clients</h3>
<p><img src="https://user-images.githubusercontent.com/13298429/125189747-a1965600-e274-11eb-89d0-9ab812dd5fe3.png" alt="Remote Desktop Connection Window, Experience Tab" /></p>
<p>Compared to performance options in PC client, mobile clients only have the option to change the resolution. We can maximize the performance by modifying settings from the host PC.</p>
<h3 id="-lack-of-hardware-acceleration-using-gpu">💔 Lack of hardware acceleration using GPU</h3>
<p><img src="https://user-images.githubusercontent.com/13298429/125301110-9e2ec780-e365-11eb-874f-0012bf01e95d.png" alt="Device Manager Window, Microsoft Remote Display Adapter" /></p>
<p>By default, the display adapter driver for Remote Desktop connection is <code class="language-plaintext highlighter-rouge">WDDM</code>. Therefore, you won’t see the GPU installed on your host PC in Device Manager or utilitize its performance. We can disable WDDM graphics on Remote Desktop connection by modifying group policy on the host PC.</p>
<h2 id="-step-by-step-guide">📇 Step-By-Step Guide</h2>
<h3 id="step-1-open-local-group-policy-editor">Step 1. Open <em>Local Group Policy Editor</em></h3>
<p><img src="https://user-images.githubusercontent.com/13298429/125190258-339f5e00-e277-11eb-8a26-a3794617a1c1.png" alt="Run Window, Opening `gpedit.msc`" /></p>
<p>Press <code class="language-plaintext highlighter-rouge">Win + R</code> to open <code class="language-plaintext highlighter-rouge">Run</code>. Type <code class="language-plaintext highlighter-rouge">gpedit.msc</code> and press <code class="language-plaintext highlighter-rouge">OK</code>.</p>
<p class="notice--info"><strong>Note</strong>: You can also search for <code class="language-plaintext highlighter-rouge">Group Policy</code> or <code class="language-plaintext highlighter-rouge">gpedit</code> on the start menu.</p>
<h3 id="step-2-configure-remote-session-environment-settings">Step 2. Configure <em>Remote Session Environment</em> settings</h3>
<p>In order to achieve smooth experience, we can compress the image from the host PC to reduce the bandwith, which will result in more frames per second.</p>
<p class="notice--success"><strong>Note</strong>: I recommend to set all the settings as I did for maximum framerate, but you can fine tune for your use case.</p>
<h4 id="step-21-locate-remote-session-environment-folder">Step 2.1. Locate <em>Remote Session Environment</em> folder</h4>
<p><img src="https://user-images.githubusercontent.com/13298429/126342772-3c2d134a-7399-46d0-a5b9-4a0f45f4c6f8.png" alt="Local Group Policy Editor Window, Remote Session Envionment" /></p>
<p>Navigate to <strong>Computer Configuration</strong> – <strong>Administrative Templates</strong> – <strong>Control Panel</strong> – <strong>Remote Desktop Services</strong> – <strong>Remote Desktop Session Host</strong> – <strong>Remote Session Environment</strong>.</p>
<p>In this folder, you will find all the options you can modify to fine tune your Remote Desktop experience.</p>
<p class="notice--success"><strong>Note</strong>: The settings in the screenshot above is frame rate optimized settings. You can follow these settings if you are looking for smoothest experience over better image quality.</p>
<h4 id="disable-use-wddm-graphics-display-driver-for-remote-desktop-connections">Disable <em>Use WDDM graphics display driver for Remote Desktop Connections</em></h4>
<p class="no_toc"><img src="https://user-images.githubusercontent.com/13298429/125190898-84648600-e27a-11eb-9c90-d798e8cb4520.png" alt="Local Group Policy Editor Window, Use WDDM graphics display driver for Remote Desktop Connections" /></p>
<p>By disabling this policy setting, Remote Desktop Connections will <strong>not</strong> use WDDM graphics display driver. In this case, the Remote Desktop Connections will use XDDM graphics display driver.</p>
<p class="notice--warning"><strong>⚠ Warning:</strong> This policy setting change requires restarting the host PC.</p>
<h4 id="enable-use-hardware-graphics-adapters-for-all-remote-desktop-services-sessions">Enable <em>Use hardware graphics adapters for all Remote Desktop Services sessions</em></h4>
<p class="no_toc"><img src="https://user-images.githubusercontent.com/13298429/125301572-13020180-e366-11eb-8c48-9bcc54c3cc33.png" alt="Local Group Policy Editor Window, Use hardware graphics adapters for all Remote Desktop Services sessions" /></p>
<p>By enabling this policy setting, all Remote Desktop Services sessions use the hardware graphics renderer instead of the Microsoft Basic Render Driver as the default adapter. This means you will be able to recognize the GPU installed in the host PC from the Remote Desktop session.</p>
<h4 id="enable-use-advanced-remotefx-graphics-for-remoteapp">Enable <em>Use advanced RemoteFX graphics for RemoteApp</em></h4>
<p class="no_toc"><img src="https://user-images.githubusercontent.com/13298429/125302089-9a4f7500-e366-11eb-9a59-a72e7cb21c80.png" alt="Local Group Policy Editor Window, Use advanced RemoteFX graphics for RemoteApp" /></p>
<p>By enabling this policy setting, RemoteApp programs will use advanced graphics, including support for transparency, live thumbnails, and seamless application moves.</p>
<p class="notice--info"><strong>Note</strong>: This policy setting applies only to <em>RemoteApp programs</em> and does not apply to remote desktop sessions.</p>
<h4 id="enable-prioritize-h264avc-444-graphics-mode-for-remote-desktop-connections">Enable <em>Prioritize H.264/AVC 444 graphics mode for Remote Desktop Connections</em></h4>
<p class="no_toc"><img src="https://user-images.githubusercontent.com/13298429/125302832-45602e80-e367-11eb-86fb-4d18b04a69b0.png" alt="Prioritize H.264/AVC 444 graphics mode for Remote Desktop Connections" /></p>
<p>By enabling this policy setting, the server (host PC) will use H.264/AVC 444 as the codec in an RDP 10 connection where both the client and server can use H.264/AVC 444. This will improve the performance in watching videos encoded in H.264 codec.</p>
<h4 id="enable-configure-h264avc-hardware-encoding-for-remote-desktop-connections">Enable <em>Configure H.264/AVC hardware encoding for Remote Desktop Connections</em></h4>
<p class="no_toc"><img src="https://user-images.githubusercontent.com/13298429/125303610-e353f900-e367-11eb-97e5-c3820901c869.png" alt="Local Group Policy Editor Window, Configure H.264/AVC hardware encoding for Remote Desktop Connections" /></p>
<p>By enabling this policy setting, Remote Desktop Conection will try to use H.264/AVC hardware encoding support for applicable clients. This will improve the performance in watching videos encoded in H.264 codec if the client supports hardware encoding.</p>
<h4 id="enable-and-configure-configure-compression-for-remotefx-data">Enable and configure <em>Configure compression for RemoteFX data</em></h4>
<p class="no_toc"><img src="https://user-images.githubusercontent.com/13298429/125304654-b9e79d00-e368-11eb-874c-ee71cb261604.png" alt="Local Group Policy Editor Window, Configure compression for RemoteFX data" /></p>
<p>By enabling this policy setting, you can specify which RDP compression algorithm to use.</p>
<p>I prioritized frame rates over image quality, so I selected <strong>Optimized to use less network bandwidth</strong>. This will decrease the network bandwith usage with compressing the image a bit more. From my experience, the image compression wasn’t noticeable but it gave me higher frame rates. I recommend using this option.</p>
<p>If you need better image quality even with lags, you can select <strong>Optimized to use less memory</strong> or <strong>Do not use an RDP compression algorithm</strong> option.</p>
<h4 id="enable-and-configure-configure-image-quality-for-remotefx-adaptive-graphics">Enable and configure <em>Configure image quality for RemoteFX Adaptive Graphics</em></h4>
<p class="no_toc"><img src="https://user-images.githubusercontent.com/13298429/125306522-421a7200-e36a-11eb-8e58-7767d3a67f54.png" alt="Local Group Policy Editor Window, Configure image quality for RemoteFX Adaptive Graphics" /></p>
<p>By enabling this policy setting and set quality to <strong>Low</strong>, RemoteFX Adaptive Graphics uses an encoding mechanism that results in low quality images. This mode consumes the lowest amount of network bandwidth of the quality modes. This will increase the maximum refresh rate of the Remote Desktop session.</p>
<p>If you need better image quality even with lags, you can select <strong>Medium</strong> or <strong>High</strong> option. The performance will depend on your internet connection.</p>
<h4 id="enable-enable-remotefx-encoding-for-remotefx-clients-designed-for-windows-server-2008-r2-sp1">Enable <em>Enable RemoteFX encoding for RemoteFX clients designed for Windows Server 2008 R2 SP1</em></h4>
<p class="no_toc"><img src="https://user-images.githubusercontent.com/13298429/126171939-cdfda2aa-6f86-439a-a5af-e8a8d5626161.png" alt="Local Group Policy Editor Window, Enable RemoteFX encoding for RemoteFX clients designed for Windows Server 2008 R2 SP1" /></p>
<p>By enabling this policy setting, you can configure graphics encoding to use the RemoteFX Codec on the Remote Desktop Session Host server. This policy setting applies only to clients that are using Remote Desktop Protocol (RDP) 7.1, and does not affect clients that are using other RDP versions. This will enhance the Remote Desktop experience in certain client version.</p>
<h4 id="enable-and-configure-configure-remotefx-adaptive-graphics">Enable and configure <em>Configure RemoteFX Adaptive Graphics</em></h4>
<p class="no_toc"><img src="https://user-images.githubusercontent.com/13298429/126173697-411fac1f-fb19-467b-a7d6-423375118768.png" alt="Local Group Policy Editor Window, Configure RemoteFX Adaptive Graphics" /></p>
<p>By enabling this policy setting, you can configure the default RemoteFX experience settings.</p>
<p>As mentioned above, I prioritized frame rates over image quality, so I selected <strong>Optimize for minimum bandwidth usage</strong>. This will decrease the network bandwith usage with compressing the image. From my experience, the image compression wasn’t noticeable for most of the time but it gave me higher frame rates. I recommend using this option.</p>
<h4 id="disable-use-wddm-graphics-display-driver-for-remote-desktop-connections-1">Disable <em>Use WDDM graphics display driver for Remote Desktop Connections</em></h4>
<p class="no_toc"><img src="https://user-images.githubusercontent.com/13298429/126334434-3f62b0c1-3b1a-4e57-8666-226adcbfebee.png" alt="Local Group Policy Editor Window, Use WDDM graphics display driver for Remote Desktop Connections" /></p>
<p>By disabling this policy setting, Remote Desktop Connections will <strong><em>not</em></strong> use WDDM graphics display driver. In this case, the Remote Desktop Connections will use XDDM graphics display driver. This will enable you to utilitize the performance of your GPU installed on the host PC.</p>
<p class="notice--warning"><strong>⚠ Warning:</strong> This policy setting change requires restarting the host PC.</p>
<h3 id="step-3-configure-remotefx-settings">Step 3. Configure <em>RemoteFX</em> settings</h3>
<p>In order to utilitize the GPU installed on the host PC, we have to enable <strong>RemoteFX</strong> on the host PC first.</p>
<h4 id="what-is-remotefx">What is RemoteFX?</h4>
<p><strong>Microsoft RemoteFX</strong> is a set of technologies that enhance visual experiences in Remote Desktop Protocol (RDP). It utilitizes the GPU installed on the host PC to render the graphics and compress it over the network to optimize the bandwith usage. It means it uses more of your hardware to make your Remote Desktop environment smoother.</p>
<p>For example, if you are trying to send 1080p 60fps session over the internet without any compression, you would need almost 3 Gbit/s network connection. But with RemoteFX configured, the host PC uses an efficient compression algorithm to reduce the bandwith usage, and also processes it with the installed hardware. And also, since the graphics are rendered from the server, you can use graphic intense applications over Remote Desktop.</p>
<p class="notice">Read more: <a href="https://en.wikipedia.org/wiki/RemoteFX">RemoteFX on Wikipedia</a></p>
<h4 id="step-31-locate-remotefx-for-windows-server-2008-r2-folder">Step 3.1. Locate <em>RemoteFX for Windows Server 2008 R2</em> folder</h4>
<p><img src="https://user-images.githubusercontent.com/13298429/126506569-c5265f65-e998-4131-a8ee-02b87c84c0e4.png" alt="Local Group Policy Editor Window, RemoteFX for Windows Server 2008 R2" /></p>
<p>Navigate to <strong>Computer Configuration</strong> – <strong>Administrative Templates</strong> – <strong>Control Panel</strong> – <strong>Remote Desktop Services</strong> – <strong>Remote Desktop Session Host</strong> – <strong>Remote Session Environment</strong> - <strong>RemoteFX for Windows Server 2008 R2</strong>.</p>
<p>In this folder, you will find all the options you can modify to fine tune your RemoteFX configurations.</p>
<h4 id="enable-configure-remotefx">Enable <em>Configure RemoteFX</em></h4>
<p class="no_toc"><img src="https://user-images.githubusercontent.com/13298429/126499389-e64560f1-c0bc-40db-a518-c2c64b3dc4fa.png" alt="Local Group Policy Editor Window, Configure RemoteFX" /></p>
<p>By enabling this policy setting, RemoteFX will be enabled. RemoteFX will deliver a rich user experience over LAN connections and RDP 7.1.</p>
<h4 id="enable-and-configure-optimize-visual-experience-when-using-remotefx">Enable and configure <em>Optimize visual experience when using RemoteFX</em></h4>
<p class="no_toc"><img src="https://user-images.githubusercontent.com/13298429/126499724-67935e89-2a37-41a7-96d8-3686c74abe6b.png" alt="Local Group Policy Editor Window, Optimize visual experience when using RemoteFX" /></p>
<p>By enabling this policy setting, you can specify the visual experience in Remote Desktop Connection (RDC) connections that use RemoteFX.</p>
<p>For <strong>Screen capture rate (frames per second)</strong>, I selected <strong>Highest (best quality)</strong> for maximum refresh rate, and for <strong>Screen Image Quality</strong>, I selected <strong>Medium (default)</strong> for decent image quality. In my case, selecting <strong>Lowest</strong> resulted in pixelated graphics in some occasions.</p>
<h4 id="enable-and-configure-optimize-visual-experience-for-remote-desktop-service-sessions">Enable and configure <em>Optimize visual experience for Remote Desktop Service Sessions</em></h4>
<p class="no_toc"><img src="https://user-images.githubusercontent.com/13298429/126500730-9762007d-3f05-4043-9385-71902714dfc8.png" alt="Local Group Policy Editor Window, Optimize visual experience for Remote Desktop Service Sessions" /></p>
<p>By enabling this policy setting, you can specify the visual experience that remote users receive in Remote Desktop Services sessions.</p>
<p>In my case, I watched some videos and photos through the Remote Desktop, so I selected <strong>Rich multimedia</strong>. You can configure this option to your preferences.</p>
<h3 id="step-4-apply-changes">Step 4. Apply changes</h3>
<p>After making changes in <strong>Local Group Policy Editor</strong>, you can just close the window as the settings are automatically applied. If you changed any settings that require restart, restart your host PC once. After your host PC restarts, you can reconnect to the session and compare the differences in refresh rate or image quality.</p>
<h4 id="bonus-testing-your-refresh-rate">Bonus: Testing your refresh rate</h4>
<p class="no_toc">If you are not sure about whether you are getting 60fps on your Remote Desktop session, you can use <a href="https://testufo.com/">testufo.com</a> to test your refresh rate.</p>
<h4 id="troubleshooting-still-having-performance-issues">Troubleshooting: Still having performance issues?</h4>
<p>The problems could be one or more of the following:</p>
<ul>
<li>Internet connection speed / latency between client and host</li>
<li>Driver problems for GPU installed on host PC</li>
<li>Didn’t restart the host PC after configuration</li>
</ul>
<p class="notice">🚩 Disclaimer: This post was inspired from <a href="https://m.blog.naver.com/qhagosk0277/221957885625">this post by <em>ceol</em></a>.</p>Nathan Chontcho13@gmail.comAchieving native experience through RDP. Can it reach 60FPS?Modifying an APK File2021-05-01T09:50:00+09:002021-05-01T09:50:00+09:00https://ntcho.github.io/software/decompiling-apk<p>Decompiling and recompiling an APK can be easily done using <strong>Apktool</strong>.</p>
<h1 id="-problem">🧾 Problem</h1>
<p>You have an <code class="language-plaintext highlighter-rouge">.apk</code> file that you want to <strong>view/edit</strong> these following contents:</p>
<ul>
<li>Resources such as <code class="language-plaintext highlighter-rouge">strings.xml</code> or other drawables</li>
<li>App configurations such as <code class="language-plaintext highlighter-rouge">AndroidManifest.xml</code></li>
<li>Source codes such as <strong>Java classes</strong></li>
</ul>
<p class="notice--danger">This post is not intended for piracy and other non-legal uses. This post could be used for localizing, adding features, supporting custom platforms, analyzing applications.</p>
<h1 id="-solution">💡 Solution</h1>
<h2 id="-materials-needed">🛠 Materials needed</h2>
<p><code class="language-plaintext highlighter-rouge">.apk</code> file that you want to decompile.</p>
<h4 id="dont-have-the-apk-file">Don’t have the <code class="language-plaintext highlighter-rouge">.apk</code> file?</h4>
<p>If the app is listed on the Google Play Store, you can use websites such as <a href="https://m.apkpure.com">apkpure.com</a>, <a href="https://www.apkmirror.com">apkmirror.com</a>.</p>
<p>If it’s not listed but installed on your Android device, you can use APK extracting apps such as <a href="https://play.google.com/store/apps/details?id=com.ext.ui&hl=en">Apk Extractor</a> to get the <code class="language-plaintext highlighter-rouge">.apk</code> file for the app.</p>
<p class="notice--warning">Warning: APK decompiliation using Apktool might not work properly for apps encrypted with <a href="https://developer.android.com/studio/build/shrink-code#enable">ProGuard</a> or other methods.</p>
<h2 id="-prerequisites">📚 Prerequisites</h2>
<p>You would need basic knowledge of using the Android SDK and how an Android app is built.</p>
<h3 id="java-jrejdk">Java JRE/JDK</h3>
<p>At least <strong>Java 1.8</strong> should be installed to use Apktool. If you intend to rebuild the app, you would need <strong>JDK</strong> to use the command <code class="language-plaintext highlighter-rouge">keytool</code> and <code class="language-plaintext highlighter-rouge">jarsigner</code>.</p>
<p class="notice">To check your Java version, run <code class="language-plaintext highlighter-rouge">java -version</code> on command prompt. To install Java, click <a href="https://java.com/download/">here</a>.</p>
<p class="notice">To install JDK, click <a href="https://www.oracle.com/java/technologies/javase-downloads.html">here</a>.</p>
<h3 id="apktool"><a href="https://ibotpeaches.github.io/Apktool/">Apktool</a></h3>
<p>Click <a href="https://ibotpeaches.github.io/Apktool/install/">here</a> to learn how to install <strong>Apktool</strong> for Windows, Linux and macOS.</p>
<p class="notice">If you want to use the command <code class="language-plaintext highlighter-rouge">apktool</code> globally, you can install Apktool on <code class="language-plaintext highlighter-rouge">C:/Windows</code>. But if you plan to only use it for a short time, you can install Apktool on your project folder to only use it in the folder.</p>
<h4 id="apktool-online-optional"><a href="http://www.javadecompilers.com/apktool">Apktool Online</a> <em>(optional)</em></h4>
<p>If you only intend to decompile the app without rebuilding the app to the <code class="language-plaintext highlighter-rouge">.apk</code> format, you can use <a href="http://www.javadecompilers.com/apktool">Apktool online</a> without installing Apktool on your computer.</p>
<p>If you intend to build the app with the changes you made, you need to install Apktool.</p>
<h3 id="apk-decompiler-optional"><a href="http://www.javadecompilers.com/apk">APK Decompiler</a> <em>(optional)</em></h3>
<p>If you intend to analyze the source codes such as Java classes, you need to use <a href="https://sourceforge.net/projects/dex2jar/files/">dex2jar compiler</a>. You can use it online from <a href="http://www.javadecompilers.com/apk">here</a>.</p>
<p class="notice--info"><strong>Tip</strong>: I recommend using both <strong>Apktool</strong> and <strong>APK decompiler</strong> in order to trace which resource is used where and how.</p>
<h2 id="-step-by-step-guide">📇 Step-By-Step Guide</h2>
<h3 id="step-1-preparing-project-folder">Step 1. Preparing project folder</h3>
<p>Put your <code class="language-plaintext highlighter-rouge">.apk</code> file in a project folder of your choice. In this tutorial, the project folder is named as <code class="language-plaintext highlighter-rouge">\proj</code>.</p>
<p>Your project folder would look like this:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>proj
+-- app.apk // the app to decompile
+-- apktool.bat
+-- apktool.jar
</code></pre></div></div>
<p class="notice">In this tutorial, I installed the Apktool locally in the project folder. Therefore <code class="language-plaintext highlighter-rouge">apktool.bat</code> and <code class="language-plaintext highlighter-rouge">apktool.jar</code> exists in the same folder.</p>
<h3 id="step-2-decompiling-the-apk-file">Step 2. Decompiling the <code class="language-plaintext highlighter-rouge">.apk</code> file</h3>
<p>Decompile <code class="language-plaintext highlighter-rouge">app.apk</code> using Apktool.</p>
<div class="language-ps highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nf">.\apktool.bat</span> <span class="nf">d</span> <span class="nf">app.apk</span>
</code></pre></div></div>
<p class="notice">In this tutorial, I used Windows PowerShell for command prompt.</p>
<p>After execution, you will see the <code class="language-plaintext highlighter-rouge">\app</code> folder created by Apktool. In the folder, you can see all the resources such as <code class="language-plaintext highlighter-rouge">AndroidManifest.xml</code> and the resource directory <code class="language-plaintext highlighter-rouge">\res</code> and its contents in original form.</p>
<p>If you want to edit <code class="language-plaintext highlighter-rouge">AndroidManifest.xml</code> or the resource, you can edit and overwrite to the original file.</p>
<h4 id="decompiling-with-readable-source-code">Decompiling with readable source code</h4>
<p>Source code is decompiled to <code class="language-plaintext highlighter-rouge">.smali</code> files, making it unreadable. So if you want to read the source code, you have to use the <a href="http://www.javadecompilers.com/apk">APK Decompiler</a> using dex2jar compiler.</p>
<p>Open <a href="http://www.javadecompilers.com/apk">APK Decompiler</a> on your browser, and choose your <code class="language-plaintext highlighter-rouge">.apk</code> file with the <strong><em>Choose File</em></strong> option. Decompile the file by clicking on <strong><em>Upload and Decompile</em></strong> button.</p>
<p>After the processing is done, download the results by clicking on <strong><em>Save</em></strong> button. Download the <code class="language-plaintext highlighter-rouge">.zip</code> file to the project folder and unzip it.</p>
<h3 id="step-3-recompiling-the-app">Step 3. Recompiling the app</h3>
<p>Recompile <code class="language-plaintext highlighter-rouge">\app</code> into <code class="language-plaintext highlighter-rouge">app.apk</code> using Apktool.</p>
<div class="language-ps highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nf">.\apktool.bat</span> <span class="nf">b</span> <span class="nf">app</span>
</code></pre></div></div>
<p>The built APK would be located in <code class="language-plaintext highlighter-rouge">\app\dist</code>. The changes you made in the <code class="language-plaintext highlighter-rouge">\app</code> folder is applied to the new APK file.</p>
<h4 id="step-31-creating-a-key-for-signing">Step 3.1. Creating a key for signing</h4>
<p>To install the edited APK to an Android device, you need to sign it with a signature key. Create a key using <code class="language-plaintext highlighter-rouge">keytool</code>, a tool provided as a part of JDK.</p>
<div class="language-ps highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nf">keytool</span> <span class="nf">-genkey</span> <span class="nf">-v</span> <span class="nf">-keystore</span> <span class="nf">release.keystore</span> <span class="nf">-alias</span> <span class="nf">alias_name</span> <span class="nf">-keyalg</span> <span class="nf">RSA</span> <span class="nf">-keysize</span> <span class="mf">2048</span> <span class="nf">-validity</span> <span class="mf">10000</span>
</code></pre></div></div>
<p>Enter password, name, organization information, address for the new keystore. This will generate <code class="language-plaintext highlighter-rouge">release.keystore</code>, and this will be used to sign your new app.</p>
<p class="notice--warning">The password will be used as a passphrase to sign the app.</p>
<h4 id="step-32-signing-the-app">Step 3.2. Signing the app</h4>
<p>Sign the APK with the generated key using <code class="language-plaintext highlighter-rouge">jarsigner</code>, a tool provided as a part of JDK.</p>
<div class="language-ps highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nf">jarsigner</span> <span class="nf">-verbose</span> <span class="nf">-sigalg</span> <span class="nf">SHA1withRSA</span> <span class="nf">-digestalg</span> <span class="nf">SHA1</span> <span class="nf">-keystore</span> <span class="nf">release.keystore</span> <span class="nf">app</span><span class="nv">/dist/app.apk</span> <span class="nf">alias_name</span>
</code></pre></div></div>
<p>Enter the passphrase for your keystore. This will sign and update the apk file <code class="language-plaintext highlighter-rouge">\app\dist\app.apk</code>.</p>
<h3 id="step-4-installing-the-app">Step 4. Installing the app</h3>
<p>Locate and install the apk file <code class="language-plaintext highlighter-rouge">\app\dist\app.apk</code> to your device of choice.</p>
<p class="notice--info">If you don’t see changes after installing the app, double check whether you installed the updated version in <code class="language-plaintext highlighter-rouge">\dist</code>, not the original APK file.</p>Nathan Chontcho13@gmail.comDecompiling and recompiling an APK can be easily done using Apktool.