批量處理ios破解後的資源檔為android所用

來源:互聯網
上載者:User

這兩天把ios上的應用破解了,把它的資源全部拷貝到android上使用。

但是ios上的資源很多包含android不允許的特殊字元,比如*@2x.png這樣結尾的資源。這裡麵包含了@這個特殊字元。需要過濾掉。

android上只允許a-z和0-9以及_ .這些字元,同時,不能以0-9這樣的數字開頭,還有不能是保留字,比如:default.png是不行的。大寫字母也是不行的。


所以,在mac下寫了一個指令檔rename.sh把@2x.png替換為.png。指令檔內容如下(建立指令檔後,把這個檔案拷貝到資來源目錄下,加上執行許可權chmod +x rename.sh。然後運行。):

1 #!/bin/sh

2 # rename *@2x.png as *.png

3 find . -name "*@2x.png" -type f | while read file

4 do

5 mv $file${file%@2x.*}.png

6 done


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.