每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,欢迎关注开源日报。交流QQ群:202790710;电报群 https://t.me/OpeningSourceOrg


今日推荐开源项目:《 Android APK 加壳

推荐理由:加壳,加壳的全称应该是可执行程序资源压缩,压缩后的程序可以直接运行。一般来说加壳的目的是为了阻止外部程序或软件对加壳程序本身的反汇编分析或者动态分析,以达到保护壳内原始程序以及软件不被外部程序破坏,保证原始程序正常运行。这种技术也常用来保护软件版权,防止软件被破解。但对于病毒,加壳可以绕过一些杀毒软件的扫描,从而实现它作为病毒的一些入侵或破坏的一些特性。

2018年4月27日:开源日报第50期

加壳的方式

其实是利用特殊的算法,对可执行文件里的资源进行压缩,这个压缩之后的文件可以独立运行,解压过程完全隐蔽,都在内存中完成。它们附加在原程序上通过加载器载入内存后,先于原始程序执行,得到控制权,执行过程中对原始程序进行解密、还原,完成后再把控制权交还给原始程序,执行原来的代码部分。这可以隐藏程序真正的入口点从而防止被破解。加上外壳后,原始程序代码在磁盘文件中一般是以加密后的形式存在的,只在执行时在内存中还原,这样就可以比较有效地防止破解者对程序文件的非法修改,同时也可以防止程序被静态反编译。

Apk 加壳原理

在 Android 中没有经过加密的 Apk 给人的感觉就是在裸奔,通过apktool , dex2jar , AndroidKill 等各式各样的反编译工具就可以轻松的获取其 smail 代码,程序被反编译以后,对于懂 smail 语法的逆向工程师来说就一览无余了。尽可能给自己的 Apk 多采取一些防护措施已经成为了一种必然。

Apk 加壳的步骤:

源 Apk:需要加壳的 Apk

加密的 Apk:源 Apk 经过加密算法加密后的 Apk

加壳程序 Apk:是有解密源 Apk 和动态加载启动源 Apk 的外壳

 

开源项目精选: Android APK 加壳

关于 Dex:

他是 Android 系统的可执行文件,包含应用程序的全部操作指令以及运行时数据。当 java 程序编译成 class 后,还需要使用 dx 工具将所有的class 文件整合到一个 Dex 文件,目的是其中各个类能够共享数据,在一定程度上降低了冗余,同时也是文件结构更加紧凑。

文件结构:

开源项目精选: Android APK 加壳

Magic

Magic 数是为了方便虚拟机识别目标文件是否是合格的 Dex 文件,在 Dex文件中 magic 的值固定

checksum

文件校验码 ,使用 alder32 算法校验文件除去 maigc ,checksum 外余下的所有文件区域 ,用于检查文件错误

signature

使用 SHA-1 算法 hash 除去 magic ,checksum 和 signature 外余下的所有文件区域 ,用于唯一识别本文件 。

file_size

当前Dex 文件的大小 。

改动 Dex 文件实际上是改动它的头部,即记录整个 Dex 文件相关属性的部分。改动其文件效验码 checksum 才能让这个合并后的 Dex 文件是正确的,改动 file_size 来重新设定 Dex 文件的大小,最后在文件的末尾标注上加密后 Apk 的大小,这样在脱壳时就能得到正确的 Apk 了。

将 Dex 与加密算法加密后的 Apk 合并生成新的Dex 后需要修改新 Dex 文件的这三个值,为了方便从新 Dex 中获得加密的 Apk,我们需要知道加密的 Apk 的大小,为了方便以后获得,我们将其大小放置在新 Dex 的后面。新生成的 Dex 文件结构:

生成新 Dex 后,将加壳程序 Apk 的 Dex 文件替换,重新签名后加壳的Apk 即完成了。


今日推荐英文原文:《Things You Should Know About Ubuntu 18.04》

原文链接:https://itsfoss.com/ubuntu-18-04-faq/ 作者:

推荐理由:关于 Ubuntu 18.04,你应该知道的那些事情,小编先透露的是,默认搭载的桌面环境是 GNOME 3.28 ,代号”Chongqing”!!!

Things You Should Know About Ubuntu 18.04

Ubuntu 18.04 release is just around the corner. I can see lots of questions from Ubuntu users in various Facebook groups and forums. I also organized Q&A sessions on Facebook and Instagram to know what Ubuntu users are wondering about Ubuntu 18.04.

I have tried to answer those frequently asked questions about Ubuntu 18.04 here. I hope it helps clear your doubts if you had any. And if you still have questions, feel free to ask in the comment section below.

What to expect in Ubuntu 18.04

Ubuntu 18.04 Frequently Asked Questions

Just for clarification, some of the answers here are influenced by my personal opinion. If you are an experienced/aware Ubuntu user, some of the questions may sound silly to you. If that’s case, just ignore those questions.

Can I install Unity on Ubuntu 18.04?

Yes, you can.

Canonical knows that there are people who simply loved Unity. This is why it has made Unity 7 available in the Universe repository. This is a community maintained edition and Ubuntu doesn’t develop it directly.

I advise using the default GNOME first and if you really cannot tolerate it, then go on installing Unity on Ubuntu 18.04.

What GNOME version does it have?

At the time of its release, Ubuntu 18.04 has GNOME 3.28.

Can I install vanilla GNOME on it?

Yes, you can.

Existing GNOME users might not like the Unity resembling, customized GNOME desktop in Ubuntu 18.04. There are some packages available in Ubuntu’s main and universe repositories that allows you to install vanilla GNOME on Ubuntu 18.04.

Has the memory leak in GNOME fixed?

Yes. The infamous memory leak in GNOME 3.28 has been fixed and Ubuntu is already testing the fix.

Just to clarify, the memory leak was not caused by Ubuntu. It was/is impacting all Linux distributions that use GNOME 3.28. A new patch was released under GNOME 3.28.1 to fix this memory leak.

How long will Ubuntu 18.04 be supported?

It is a long-term support (LTS) release and like any LTS release, it will be supported for five years. Which means that Ubuntu 18.04 will get security and maintenance updates until April 2023.

When will Ubuntu 18.04 be released?

Ubuntu 18.04 LTS will be released on 26th April. All the participating flavors like Kubuntu, Lubuntu, Xubuntu, Budgie, MATE etc will have their 18.04 release available on the same day.

It seems Ubuntu Studio will not have 18.04 as LTS release.

Is it possible to upgrade to Ubuntu 18.04 from 16.04/17.10? Can I upgrade from Ubuntu 16.04 with Unity to Ubuntu 18.04 with GNOME?

Yes, absolutely. Once Ubuntu 18.04 LTS is released, you can easily upgrade to the new version.

If you are using Ubuntu 17.10, make sure that in Software & Updates -> Updates, the ‘Notify me of a new Ubuntu version’ is set to ‘For any new version’.

Get notified for a new version in Ubuntu

If you are using Ubuntu 16.04, make sure that in Software & Updates -> Updates, the ‘Notify me of a new Ubuntu version’ is set to ‘For long-term support versions’.

Ubuntu 18.04 upgrade from Ubuntu 16.04

You should get system notification about the availability of the new versions. After that, upgrading to Ubuntu 18.04 is a matter of clicks.

Even if Ubuntu 16.04 was Unity, you can still upgrade to Ubuntu 18.04 GNOME.

When will I get to upgrade to Ubuntu 18.04?

If you are using Ubuntu 17.10 and have correct update settings in place (as mentioned in the previous section), you should be notified for upgrading to Ubuntu 18.04 within a few days of Ubuntu 18.04 release. Since Ubuntu servers encounter heavy load on the release day, not everyone gets the upgrade the same day.

For Ubuntu 16.04 users, it may take some weeks before they are officially notified of the availability of Ubuntu 18.04. Usually, this will happen after the first point release Ubuntu 18.04.1. This point release fixes the newly discovered bugs in 18.04.

If I upgrade to Ubuntu 18.04 can I downgrade to 17.10 or 16.04?

No, you cannot. While upgrading to the newer version is easy, there is no option to downgrade.  If you want to go back to Ubuntu 16.04, you’ll have to do a fresh install.

Can I use Ubuntu 18.04 on 32-bit systems?

Yes and no.

If you are already using the 32-bit version of Ubuntu 16.04 or 17.10, you may still get to upgrade to Ubuntu 18.04. However, you won’t find Ubuntu 18.04 bit ISO in 32-bit format anymore. In other words, you cannot do a fresh install of the 32-bit version of Ubuntu 18.04 GNOME.

The good news here is that other official flavors like Ubuntu MATE, Lubuntu etc still have the 32-bit ISO of their new versions.

In any case, if you have a 32-bit system, chances are that your system is weak on hardware. You’ll be better off using lightweight Ubuntu MATE or Lubuntu on such system.

Where can I download Ubuntu 18.04?

Once 18.04 is released, you can get the ISO image of Ubuntu 18.04 from its website. You have both direct download and torrent options. Other official flavors will be available on their official websites.

Should I do a fresh install of Ubuntu 18.04 or upgrade to it from 16.04/17.10?

If you have a choice, make a backup of your data and do a fresh install of Ubuntu 18.04.

Upgrading to 18.04 from an existing version is a convenient option. However, in my opinion, it still keeps some traces/packages of the older version. A fresh install is always cleaner.

For a fresh install, should I install Ubuntu 16.04 or Ubuntu 18.04?

If you are going to install Ubuntu on a system, go for Ubuntu 18.04 instead of 16.04.

Both of them are long-term support release and will be supported for a long time. Ubuntu 16.04 will get maintenance and security updates until 2021 and 18.04 until 2023.

However, I would suggest that you use Ubuntu 18.04. Any LTS release gets hardware updates for a limited time (two and a half years I think). After that, it only gets maintenance updates. If you have newer hardware, you’ll get better support in 18.04.

Also, many application developers will start focusing on Ubuntu 18.04 soon. Newly created PPAs might only support 18.04 in a few months. Using 18.04 has its advantages over 16.04.

Will it be easier to install printer-scanner drivers instead of using the CLI?

I am not an expert when it comes to printers so my opinion is based on my limited knowledge in this field. Most of the new printers support IPP protocol and thus they should be well supported in Ubuntu 18.04. I cannot say the same about older printers.

Does Ubuntu 18.04 have better support for Realtek and other WiFi adapters?

No specific information on this part.

What are the system requirements for Ubuntu 18.04?

For the default GNOME version, you should have 4 GB of RAM for a comfortable use. A processor released in last 8 years will work as well. Anything older than that should use a lightweight Linux distribution such as Lubuntu.

Any other questions about Ubuntu 18.04?

If you have any other doubts regarding Ubuntu 18.04, please feel free to leave a comment below. If you think some other information should be added to the list, please let me know.


每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,欢迎关注开源日报。交流QQ群:202790710;电报群 https://t.me/OpeningSourceOrg